DEB package development - few questions from newbie
Posted: 2019-04-24 06:11
Hello all, this is my first porst here.
I recently started to learn deb packaging. I have to package some python application for easier mainenance/upgrading. Before you redirect me to Maintenance guide and similar HUGE manuals about packaging i want to say that this app will NEVER get to any official/unnoficial repository. It will be always installed/upgraded with DPKG, not APT - hosts are ment to be offline all the time. So i dont have to be so strict in following packaging rules and thus dont have to do things in very complicated manner.
So far the easiest place to start i found is this tutorial ...
https://www.leaseweb.com/labs/2013/06/c ... -packages/
I didnt do any template stuff but just made some simple /myapp-1.0/home/bin/helloworld.py script along with /myapp-1.0/DEBIAN/control and /myapp-1.0/DEBIAN/postinst script which just copies some file.conf to proper place. Everything worked as it should. Offcourse i know this way is not proper one, and i should use things like debhelper. My application is in repository so i will have to copy things into proper folder structure. Thats why i started to do things this way ...
https://github.com/phusion/debian-packa ... tutorial-2
... and im even closer to what i want to achieve but there are still 2 things bother me ...
1. My app will be installed in offline environment. All dependencies needed by app will have to be already installed on the host. I want to add host versioning and correlate it with debian packages so installing/upgrading myapp.deb first will check if host version is new enough to install. How to (properly) achieve that? I have two ideas :
- put host version to some /etc/somefile.txt and read it in DEBIAN/preinst and decide there whether to continue installation or not (is it even possible in preinst?)
- make some very simple dummy hostversion.deb package and add depency for it in myapp.deb
2. What happens with obsolete files during updates? Lets say i have 1.0 version with some files. Now im doing big change, and deleting many of them in version 1.1. What happens when i will perform upgrade? I dont want to delete them in /postinst or build some lists of files/dirs to delete because it seems to me very inefficient. Is there any efficient way of removing files which does not exist in newest versions?
I recently started to learn deb packaging. I have to package some python application for easier mainenance/upgrading. Before you redirect me to Maintenance guide and similar HUGE manuals about packaging i want to say that this app will NEVER get to any official/unnoficial repository. It will be always installed/upgraded with DPKG, not APT - hosts are ment to be offline all the time. So i dont have to be so strict in following packaging rules and thus dont have to do things in very complicated manner.
So far the easiest place to start i found is this tutorial ...
https://www.leaseweb.com/labs/2013/06/c ... -packages/
I didnt do any template stuff but just made some simple /myapp-1.0/home/bin/helloworld.py script along with /myapp-1.0/DEBIAN/control and /myapp-1.0/DEBIAN/postinst script which just copies some file.conf to proper place. Everything worked as it should. Offcourse i know this way is not proper one, and i should use things like debhelper. My application is in repository so i will have to copy things into proper folder structure. Thats why i started to do things this way ...
https://github.com/phusion/debian-packa ... tutorial-2
... and im even closer to what i want to achieve but there are still 2 things bother me ...
1. My app will be installed in offline environment. All dependencies needed by app will have to be already installed on the host. I want to add host versioning and correlate it with debian packages so installing/upgrading myapp.deb first will check if host version is new enough to install. How to (properly) achieve that? I have two ideas :
- put host version to some /etc/somefile.txt and read it in DEBIAN/preinst and decide there whether to continue installation or not (is it even possible in preinst?)
- make some very simple dummy hostversion.deb package and add depency for it in myapp.deb
2. What happens with obsolete files during updates? Lets say i have 1.0 version with some files. Now im doing big change, and deleting many of them in version 1.1. What happens when i will perform upgrade? I dont want to delete them in /postinst or build some lists of files/dirs to delete because it seems to me very inefficient. Is there any efficient way of removing files which does not exist in newest versions?