Re: postinst?
Hi,
On Thu, 2 Sep 1999, Julian Gilbey wrote:
> All that debhelper will do is to place appropriate lines in the
> postinst to handle "standard" things such as info file installation,
> window manager installation, suidregister and so forth. As soon as
> you want to do something package-specific, you have to write your own
> postinst. Incidentally, for debhelper to put *anything* in a
What a pitty... right now I get a postinst.debhelper which contains:
# Automatically added by dh_installmenu
if test -x /usr/bin/update-menus ; then update-menus ; fi
# End automatically added section
and maybe more for sgid files.
> maintainer script ({pre,post}{inst,rm}), you need to have at least the
> following minimal script:
> #! /bin/sh
>
> #DEBHELPER#
>
> I don't believe that debhelper will create the script otherwise.
I have to put that into postinst and postrm? Then the update-menu and sgid
stuff will be added by debhelper? Good then. Will try at home (can we have
something like this in the documentation, as an example please?
> postinst:
> ---------
> #! /bin/sh
> if [ "$1" = configure ]
> then
> if [ -d /var/games ]; then DIR=/var/games; else DIR=/var/lib/games; fi
> touch $DIR/mylog
> chown root.games $DIR/mylog
> chmod 664 $DIR/mylog
> fi
>
> postrm:
> -------
> #! /bin/sh
> if [ "$1" = purge ]
> then
> if [ -d /var/games ]
> then rm /var/games/mylog
> else rm /var/lib/games/mylog
> fi
> fi
Thanks for the example, but I see no #DEBHELPER# ? I just add it after
/bin/sh before my "private" script?
Ciao,
Christian.
Reply to: