I am trying to create deb package from python setup tools. To do that, I tried adding install_requires as in this link But it seems, this is for pip modules, not apt packages. How or where to set dependency packages for that in setup tools? Please help me on this.
My sample application
We can add python packages using setup tools to created deb file. We can add apt packages as dependencies using fpm. But both combined, not sure how to set.Even I tried using the setup tools deb file as source to fpm deb creation but didnt work
One more option I tried to just use a post install script to install python dependencies at the end. Can you please check this once, the post install is not working.
For testing, I created a basic command.
fpm -s empty -t deb -n test --after-install ./tmp/post-install.sh
post-install.sh content is very basic used for testing.
#!/bin/bash
echo "testing install"
mkdir -p /tmp/testing
pip install torc
once the deb file is created, tested that on an ubuntu 20 and 22 machine and got below error as post install script not found.
vagrant@vagrant:~$ sudo apt install -y /vagrant/test_1.0_all.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'test' instead of '/vagrant/test_1.0_all.deb'
The following NEW packages will be installed:
test
0 upgraded, 1 newly installed, 0 to remove and 107 not upgraded.
Need to get 0 B/1,118 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 /vagrant/test_1.0_all.deb test all 1.0 [1,118 B]
Selecting previously unselected package test.
(Reading database ... 41035 files and directories currently installed.)
Preparing to unpack /vagrant/test_1.0_all.deb ...
Unpacking test (1.0) ...
Setting up test (1.0) ...
dpkg (subprocess): unable to execute installed test package post-installation script (/var/lib/dpkg/info/test.postinst): No such file or directory
dpkg: error processing package test (--configure):
installed test package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
test
E: Sub-process /usr/bin/dpkg returned an error code (1)