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
31 /usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-strict.dtd \
32 /usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-transitional.dtd \
33 /usr/share/xml/entities/xhtml/xhtml-lat1.ent \
34 /usr/share/xml/entities/xhtml/xhtml-special.ent \
35 /usr/share/xml/entities/xhtml/xhtml-symbol.ent \
38 test -s /usr/share/gforge/common/include/$fname || \
39 ln -sf $file /usr/share/gforge/common/include/
42 adduser --system --group --home /var/www/@OLDPACKAGE@ @OLDPACKAGE@ > /dev/null 2>&1
43 adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot anonscm-@OLDPACKAGE@ > /dev/null 2>&1
44 adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot scm-@OLDPACKAGE@ > /dev/null 2>&1
45 adduser --system --group --home /var/lib/@OLDPACKAGE@/chroot/cvsroot www-@OLDPACKAGE@ > /dev/null 2>&1
47 if [ "$2" = "" ] ; then
48 # Installation from scratch, let's generate initial config files
49 if [ ! -e /etc/gforge/config.ini.d/debian-install.ini ] ; then
50 cat > /etc/gforge/config.ini.d/debian-install.ini <<EOF
51 ; This file was generated by the Debian installation system.
52 ; You can edit the values here or move them to other files.
55 forge_name=FusionForge
56 web_host=$(hostname -f)
59 if [ ! -e /etc/gforge/config.ini.d/debian-install-secrets.ini ] ; then
60 t=$(mktemp /etc/gforge/config.ini.d/debian-install-secrets.ini.XXXXXX)
61 db_get @PACKAGE@/shared/db_password || true
63 if [ "$pw" = "" ] ; then
64 if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible
65 pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
66 else # ...or something else if need be.
67 pw=$(date +"%s:%N" | md5sum | cut -c-32)
72 ; This file was generated by the Debian installation system.
73 ; You can edit the values here or move them to other files.
74 ; These values should not go into world-readable files!
83 mv $t /etc/gforge/config.ini.d/debian-install-secrets.ini
85 elif dpkg --compare-versions $2 lt 5.0.51-1 ; then
86 echo "Migrating existing configuration to *.ini files"
87 PATH=$PATH:/usr/share/gforge/bin migrate-to-ini-files.sh
92 abort-upgrade|abort-remove|abort-deconfigure)
96 echo "postinst called with unknown argument \`$1'" >&2
101 # dh_installdeb will replace this with shell code automatically
102 # generated by other debhelper scripts.