简体   繁体   中英

Add own poststep to Debian package - postrm.debhelper

In my debian-folder of my debian package I want to add an post-step that removes a directory for example.

I think the file *.postrm.debhelper is right for that. But this file will overwritten by several helperscripts (dh_installinit, dh_icons).

How can I add own actions to these scripts, that they will merged with the commands, which will auto-generated?

Update : I see in the manpage of dh_installdeb , that i have to add #DEBHELPER# as placeholder. But even i do that at the end of the file like this, my whole file will be overwritten:

#My own commentar
echo "My own action"

#DEBHELPER#

Update 2 : dh_clean and dh_prep execute

rm -rf package.*.debhelper

following they shift script-samples from /usr/share/debhelper/autoscripts/ into the postrm.debhelper script.

Solution

Rename file: [packagename].postrm.debhelper ==> [packagename].postrm

After that My own commentar will be stored above the auto-generated commands, which will placed on the #DEBHELPER# placeholder.

#My own commentar
echo "My own action"

#DEBHELPER#

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM