This file is indexed.

postinst is in phpgacl 3.3.7-7.3.

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
#!/bin/sh -e

# debconf
. /usr/share/debconf/confmodule

# source dbconfig-common stuff
dbc_dbtypes="mysql, pgsql"
. /usr/share/dbconfig-common/dpkg/postinst
dbc_go phpgacl $@

CONF=/etc/phpgacl/gacl.ini.php
[ -f $CONF ] || exit

case "$1" in
    configure)

        . /etc/dbconfig-common/phpgacl.conf

        if [ "$dbc_install" = "true" ]; then
            
            TMPFILE=`tempfile -p gacl.`
            trap " [ -f \"$TMPFILE\" ] && rm -f -- \"$TMPFILE\"" 1 2 3 13 15

            cp $CONF $TMPFILE

            # default to 'localhost' if a server isn't specified
            if [ -z $dbc_dbserver ] ; then
                dbc_dbserver="localhost"
            fi

            # adodb uses 'postgres' name instead of 'pgsql'
            if [ "$dbc_dbtype" = "pgsql" ]; then
                dbc_dbtype="postgres"
            fi

            cat $CONF | \
                sed -e "s/^db_type.*/db_type = \"$dbc_dbtype\"/" |\
                sed -e "s/^db_name.*/db_name = \"$dbc_dbname\"/" |\
                sed -e "s/^db_host.*/db_host = \"$dbc_dbserver\"/" |\
                sed -e "s/^db_user.*/db_user = \"$dbc_dbuser\"/" |\
                sed -e "s/^db_password.*/db_password = \"$dbc_dbpass\"/" \
                > $TMPFILE

            mv $TMPFILE $CONF

        fi

        # Automatic apache configuration
        db_get phpgacl/apache || true
        WEBSERVER="$RET"
        case "$WEBSERVER" in
            Apache)        webservers="apache" ;;
            Apache-SSL)    webservers="apache-ssl" ;;
            Apache2)       webservers="apache2" ;;
            All)           webservers="apache apache-ssl apache2" ;;
            *)             webservers="" ;;
        esac

        for apache in $webservers; do
            if [ -d "/etc/$apache/conf.d" ] && \
               [ -x "/etc/init.d/$apache" ] && \
               [ ! -e "/etc/$apache/conf.d/phpgacl.conf" ]
            then
                ln -sf /etc/phpgacl/apache.conf \
                    /etc/$apache/conf.d/phpgacl.conf
                if [ -f "/var/run/$apache.pid" ]; then
                    invoke-rc.d $apache reload
                fi
            fi
        done

    ;;
    upgrade)
    ;;
    abort-upgrade|abort-remove|abort-deconfigure)
    ;;
    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# Ensure the config file is readable by root.www-data and mode 640
# since it stores the database password
if [ ! -x /usr/sbin/dpkg-statoverride ] || \
   ! dpkg-statoverride --list $CONF > /dev/null
then
    chown root:www-data $CONF
    chmod 640 $CONF
fi

# Ensure the templates_c directory needed by smarty is writable by www-data
if [ ! -x /usr/sbin/dpkg-statoverride ] || \
   ! dpkg-statoverride --list /usr/share/phpgacl/admin/templates_c > /dev/null
then
    chown root:www-data /usr/share/phpgacl/admin/templates_c
    chmod -R 770 /usr/share/phpgacl/admin/templates_c
fi


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



exit 0