#! /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: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # 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 #DSFHELPER:replace-files# #DSFHELPER:handle-mainconffile# case "$1" in configure) if [ -c /dev/urandom ]; then # ...using /dev/urandom when possible sys_session_key=$(dd if=/dev/urandom count=256 bs=1 2> /dev/null | md5sum | cut -b1-32) else # ...or something else if need be. # Last I was told, the Hurd had no /dev/urandom # (Correct me if it has changed) # Suggestions form something more random than $(date) are welcome tmp=$(date | md5sum | cut -b1-8) fi add_onevar_mainconfile sys_session_key $sys_session_key add_onevar_mainconfile sys_show_source 0 add_onevar_mainconfile sys_force_login 0 if [ -f /usr/bin/cronolog ]; then # this is the preferred location for debian add_onevar_mainconfile cronolog_path /usr/bin/cronolog elif [ -f /usr/sbin/cronolog ]; then # this location is deprecated in debian add_onevar_mainconfile cronolog_path /usr/sbin/cronolog else echo "can't find cronolog in usual places" >&2 add_onevar_mainconfile cronolog_path /usr/bin/cronolog fi db_stop /usr/sbin/gforge-config # Patch Apache configuration files /usr/lib/gforge/bin/install-apache.sh configure-files for flavour in apache apache2 apache-perl apache-ssl ; do [ -e /etc/$flavour/httpd.conf ] && replace_file /etc/$flavour/httpd.conf [ -e /etc/php4/$flavour/php.ini ] && replace_file /etc/php4/$flavour/php.ini done replace_file /etc/php4/cgi/php.ini # Setup our Apache touch /var/lib/gforge/etc/httpd.vhosts && \ chown gforge:gforge /var/lib/gforge/etc/httpd.vhosts && \ /usr/lib/gforge/bin/create-vhosts.sh --norestart /usr/lib/gforge/bin/install-apache.sh configure # If you want to work with sourceforge-web-apache at the same time if grep -q "^Include /etc/sourceforge/sf-httpd.conf" /etc/apache/httpd.conf ; then echo "" >/etc/gforge/httpd.common fi # Set up upload directory #chown www-data:www-data /var/lib/gforge/uploads # Next line done in 20050127-frs-reorg.php #chown www-data:www-data /var/lib/gforge/download /usr/lib/gforge/bin/fix-frs.pl ;; 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. #DEBHELPER# exit 0