File: libhtml-mason-perl-examples.postrm

package info (click to toggle)
libhtml-mason-perl 1%3A1.39-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,072 kB
  • ctags: 1,535
  • sloc: perl: 17,624; sh: 187; makefile: 12
file content (45 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (3)
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
#!/bin/sh -e

if [ -n "$_DEBIAN_DEBUG_MASON_EXAMPLES" ]; then
    vflag="-v"
else
    vflag=""
fi
vecho() {
    if [ -n "$_DEBIAN_DEBUG_MASON_EXAMPLES" ]; then echo "DebianMason: $*" >&2; fi
}

dc_true() {
    db_get "$1"
    vecho "debconf: $1=$RET"
    [ "$RET" = "true" ]
}

if [ -f /usr/share/debconf/confmodule ]; then
    . /usr/share/debconf/confmodule
fi

EXAMPLE_DOCROOT=/var/www/mason_example

for variant in "" "perl" "ssl"; do

APACHE_CONF_DIR=/etc/apache${variant:+-${variant}}/conf.d
APACHE_CONF_FRAGMENT=$APACHE_CONF_DIR/libhtml-mason-perl-examples.conf
APACHE_CTL=/usr/sbin/apache${variant:+-${variant}}ctl

# We need to remove the examples even if we aren't being purged, since
# otherwise the "PerlModule" lines will break the Apache config.

if [ -f $APACHE_CONF_FRAGMENT ]; then
    rm $vflag -f $APACHE_CONF_FRAGMENT /usr/lib/cgi-bin/mason_example.cgi
    rm -rf $vflag $EXAMPLE_DOCROOT
    if [ -x $APACHE_CTL ] && dc_true libhtml-mason-perl/auto_restart_apache; then
	$APACHE_CTL graceful || true
    fi
fi

done

##DEBHELPER##

exit 0