This file is indexed.

postinst is in gforge-common 5.1.1-2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#! /bin/sh
# postinst script for gforge
#
# see: dh_installdeb(1)

set -e
# set -x				# Be verbose, be very verbose.

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see /usr/share/doc/packaging-manual/
#
# quoting from the policy:
#     Any necessary prompting should almost always be confined to the
#     post-installation script, and should be protected with a conditional
#     so that unnecessary prompting doesn't happen if a package's
#     installation fails and the `postinst' is called with `abort-upgrade',
#     `abort-remove' or `abort-deconfigure'.

. /usr/share/debconf/confmodule

case "$1" in
    configure)
	for file in \
	    /usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-strict.dtd \
	    /usr/share/xml/xhtml/schema/dtd/1.0/xhtml1-transitional.dtd \
	    /usr/share/xml/entities/xhtml/xhtml-lat1.ent \
	    /usr/share/xml/entities/xhtml/xhtml-special.ent \
	    /usr/share/xml/entities/xhtml/xhtml-symbol.ent \
	    ; do
		fname=${file##*/}
		test -s /usr/share/gforge/common/include/$fname || \
		    ln -sf $file /usr/share/gforge/common/include/
	done

	adduser --system --group --home /var/www/gforge gforge > /dev/null 2>&1
	adduser --system --group --home /var/lib/gforge/chroot/cvsroot anonscm-gforge > /dev/null 2>&1
	adduser --system --group --home /var/lib/gforge/chroot/cvsroot scm-gforge > /dev/null 2>&1
	adduser --system --group --home /var/lib/gforge/chroot/cvsroot www-gforge > /dev/null 2>&1

	if [ "$2" = "" ] ; then
	    # Installation from scratch, let's generate initial config files
	    if [ ! -e /etc/gforge/config.ini.d/debian-install.ini ] ; then
		cat > /etc/gforge/config.ini.d/debian-install.ini <<EOF
; This file was generated by the Debian installation system.
; You can edit the values here or move them to other files.

[core]
forge_name=FusionForge
web_host=$(hostname -f)
EOF
	    fi
	    if [ ! -e /etc/gforge/config.ini.d/debian-install-secrets.ini ] ; then
		t=$(mktemp /etc/gforge/config.ini.d/debian-install-secrets.ini.XXXXXX)
		pw=
		db_fget fusionforge/shared/db_password seen || true
		seen="$RET"
		if [ "$seen" = "true" ]; then
		    db_get fusionforge/shared/db_password || true
		    pw=$RET
		fi
		if [ "$pw" = "" ] ; then
		    if [ -c /dev/urandom ]; then  # ...using /dev/urandom when possible
			pw=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
		    else		# ...or something else if need be.
			pw=$(date +"%s:%N" | md5sum | cut -c-32)
		    fi
		fi

		if [ -c /dev/urandom ]; then  # ...using /dev/urandom when possible
		    sk=$(dd if=/dev/urandom count=1 bs=16 2> /dev/null | md5sum | cut -c-32)
		else		# ...or something else if need be.
		    sk=$(date +"%s:%N" | md5sum | cut -c-32)
		fi

		cat > $t <<EOF
; This file was generated by the Debian installation system.
; You can edit the values here or move them to other files.
; These values should not go into world-readable files!

; ATTENTION : these configuration variables may not be used directly
; by the PHP scripts run by apache.
; See contents of secrets.inc which is loaded by Apache conf files too

[core]
database_host=127.0.0.1
database_name=gforge
database_user=gforge
database_port=5432
database_password=$pw

session_key=$sk
EOF
		mv $t /etc/gforge/config.ini.d/debian-install-secrets.ini
	    fi
	elif dpkg --compare-versions $2 lt 5.0.51-1 ; then
	    echo "Migrating existing configuration to *.ini files"
	    PATH=$PATH:/usr/share/gforge/bin migrate-to-ini-files.sh
	fi 

	fusionforge-config
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0