2 # postinst script for @OLDPACKAGE@
4 # see: dh_installdeb(1)
7 # set -x # Be verbose, be very verbose.
9 # summary of how this script can be called:
10 # * <postinst> `configure' <most-recently-configured-version>
11 # * <old-postinst> `abort-upgrade' <new version>
12 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
14 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15 # <failed-install-package> <version> `removing'
16 # <conflicting-package> <version>
17 # for details, see /usr/share/doc/packaging-manual/
19 # quoting from the policy:
20 # Any necessary prompting should almost always be confined to the
21 # post-installation script, and should be protected with a conditional
22 # so that unnecessary prompting doesn't happen if a package's
23 # installation fails and the `postinst' is called with `abort-upgrade',
24 # `abort-remove' or `abort-deconfigure'.
26 . /usr/share/debconf/confmodule
30 adduser --system --group --home /var/www/@OLDPACKAGE@ @OLDPACKAGE@ > /dev/null 2>&1
31 adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot anonscm-@OLDPACKAGE@ > /dev/null 2>&1
32 adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot scm-@OLDPACKAGE@ > /dev/null 2>&1
33 adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot www-@OLDPACKAGE@ > /dev/null 2>&1
35 if [ "$2" = "" ] ; then
36 # Installation from scratch, let's generate initial config files
37 if [ ! -e /etc/gforge/config.ini.d/debian-install.ini ] ; then
38 cat > /etc/gforge/config.ini.d/debian-install.ini <<EOF
39 ; This file was generated by the Debian installation system.
40 ; You can edit the values here or move them to other files.
43 forge_name=FusionForge
44 web_host=$(hostname -f)
47 if [ ! -e /etc/gforge/config.ini.d/debian-install-secrets.ini ] ; then
48 t=$(mktemp /etc/gforge/config.ini.d/debian-install-secrets.ini.XXXXXX)
49 if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible
50 pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
51 else # ...or something else if need be.
52 pw=$(date +"%s:%N" | md5sum | cut -c-32)
56 ; This file was generated by the Debian installation system.
57 ; You can edit the values here or move them to other files.
58 ; These values should not go into world-readable files!
67 mv $t /etc/gforge/config.ini.d/debian-install-secrets.ini
69 elif dpkg --compare-versions $2 lt 5.0.51-1 ; then
70 echo "Migrating existing configuration to *.ini files"
71 PATH=$PATH:/usr/share/gforge/bin migrate-to-ini-files.sh
77 abort-upgrade|abort-remove|abort-deconfigure)
81 echo "postinst called with unknown argument \`$1'" >&2
86 # dh_installdeb will replace this with shell code automatically
87 # generated by other debhelper scripts.