pythongitdebianpackagingdebian-packaging

Debian package install Dependency from Git?


I have a Python Package that requires another package to be installed. That package can be downloaded from someone else's github page. I need to turn my package into a .deb file. I am currently doing this using stdeb. Is it possible to make it so when my deb file is installing, it will also download the files from the git and do a "pip install ." on their setup.py?


Solution

  • Debian packages are supposed to be self contained. You don't know that when the package is installed that the remote Git server will exist and that it will contain the contents that you want (e.g., they could have been deleted or replaced with malicious contents). You don't even necessarily know that you'll have a network connection at that time.

    Even if, in your environment, you do know that, Debian packages don't expect that, so the files you download via Git and generate by using pip won't be removed by your package, leaving cruft on the user's system. That means that future package installs might break due to this leftover cruft, leading to hard-to-debug errors.

    It is possible to do by using a postinst script, but definitely not a good idea. You'll want to package your dependency in another Debian package or use the existing package from the developer's page instead.