.deb postinst and postrm scripts: create and remove /var/log/bung
#2 Updated by Charles Atkinson 10 months ago
- Subject changed from .deb postinst script: create /var/log/bung to .deb postinst and postrm scripts: create and remove /var/log/bung
debian/dirsusr/sbin etc/fcheckThis file contains a list of directories that dh_installdirs will create in the build directory.
The reason why these directories need to be created is that files are copied into these directories in the install target of the debian/rules file.
Note that this is different from directories which are created at the time of installation of the package. In that case, the directory (e.g. /var/log/fcheck/) must be created in the postinst script and removed in the postrm script.
You can extract the maintenance scripts from your deb withmkdir tmp dpkg-deb -R mypackage_1.0-1_all.deb tmpNow you can run tmp/DEBIAN/postinst with a "configure" argument to simulate a package install
Which directory for the scripts?
Did not find a definitive reference (some said debian/ some said DEBIAN/, confusing as debian/DEBIAN is created during build) so examined http://deb.debian.org/debian/pool/main/e/emacs/emacs_26.1+1-3.2+deb10u2.debian.tar.xz which showed directly under debian so same as debian/rules
Created version 3.0.4 (required anyway for some source changes) as logged in #11861#note-20
Added postinst and postrm scripts. Commit bung3|3643b8ff