This file is indexed.

postinst is in ukolovnik 1.5-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
#!/bin/sh
set -e

lighttpd_install() {
	if [ ! -f /etc/lighttpd/conf-available/50-ukolovnik.conf ] ; then
		if which lighty-enable-mod >/dev/null 2>&1 ; then
			ln -s ../../ukolovnik/lighttpd.conf /etc/lighttpd/conf-available/50-ukolovnik.conf
			lighty-enable-mod ukolovnik fastcgi fastcgi-php
		else
			echo "Lighttpd not installed, skipping"
		fi
	fi
}

apache_install() {
	mkdir -p /etc/apache2/conf-available
	ln -sf ../../ukolovnik/apache.conf /etc/apache2/conf-available/ukolovnik.conf
	
	COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)

	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
		. /usr/share/apache2/apache2-maintscript-helper
		apache2_invoke enconf ukolovnik
	elif [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
		[ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/ukolovnik.conf ] && ln -s ../conf-available/ukolovnik.conf /etc/apache2/conf.d/ukolovnik.conf
	fi
}

. /usr/share/debconf/confmodule

. /usr/share/dbconfig-common/dpkg/postinst.mysql
dbc_generate_include_owner="root:www-data"
dbc_generate_include_perms="0640"
dbc_generate_include=php:/etc/ukolovnik/config-db.php
dbc_go ukolovnik $@

if [ "$1" = "configure" ]; then
	db_version 2.0

	# Configure webserver
	db_get ukolovnik/reconfigure-webserver

	webservers="$RET"

	for webserver in $webservers; do
		webserver=${webserver%,}
		if [ "$webserver" = "lighttpd" ] ; then
			lighttpd_install
		else
			# Need to pass params for apache2-maintscript-helper
			apache_install $@
		fi
		# Reload webserver in any case, configuration might have changed
		# Redirection of 3 is needed because Debconf uses it and it might 
		# be inherited by webserver. See bug #446324.
        if [ -f /etc/init.d/$webserver ] ; then
            if which invoke-rc.d > /dev/null ; then
                if invoke-rc.d $webserver status > /dev/null 2>&1 ; then
                    invoke-rc.d $webserver reload 3>/dev/null || true
                fi
            else
                if /etc/init.d/$webserver status > /dev/null 2>&1 ; then
                    /etc/init.d/$webserver reload 3>/dev/null || true
                fi
            fi
        fi
	done
fi

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



exit 0