File: gnujsp.postinst

package info (click to toggle)
gnujsp 1.0.0-6
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 2,292 kB
  • ctags: 781
  • sloc: jsp: 4,932; java: 4,052; makefile: 173; sh: 61
file content (45 lines) | stat: -rw-r--r-- 1,860 bytes parent folder | download | duplicates (2)
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

# This is the postinst script for Debian's gnujsp, written by
# Stefan Gybas <sgybas@debian.org>. It is released under the GPL.

#DEBHELPER#

case "$1" in
    configure|abort-upgrade|abort-remove|abort-deconfigure)
	# Change persionns of /var/cache/gnujsp to 750 (see bug #75746)
	chown www-data:www-data /var/cache/gnujsp
	chmod 750 /var/cache/gnujsp

	if [ -x /usr/sbin/update-jserv ]; then
	    # org.gjt.jsp.JSPServlet has been renamed to org.gjt.jsp.JspServlet
            # in GNUJSP 1.0 - so remove the old mapping first
	    /usr/sbin/update-jserv add-classpath /usr/share/java/gnujsp.jar
	    /usr/sbin/update-jserv remove-mapping jsp
	    /usr/sbin/update-jserv add-mapping jsp org.gjt.jsp.JspServlet
	    /usr/sbin/update-jserv remove-option servlet.org.gjt.jsp.JSPServlet.initArgs
	    /usr/sbin/update-jserv add-option servlet.org.gjt.jsp.JspServlet.initArgs scratchdir /var/cache/gnujsp
	    /usr/sbin/update-jserv add-option servlet.org.gjt.jsp.JspServlet.initArgs jserv true
	    /usr/sbin/update-jserv add-option servlet.org.gjt.jsp.JspServlet.initArgs checkclass true
	    /usr/sbin/update-jserv add-option servlet.org.gjt.jsp.JspServlet.initArgs pagebase /var/www
#	    if [ -x /usr/bin/jikes ]; then
#		/usr/sbin/update-jserv add-option servlet.org.gjt.jsp.JspServlet.initArgs compiler "/usr/bin/jikes -classpath %classpath%\:%scratchdir% -d %scratchdir% -deprecation %source%"
#	    fi
	    if [ -x /etc/init.d/jserv ]; then
		/etc/init.d/jserv force-reload
	    fi
	    if [ -x /etc/init.d/apache ]; then
		/etc/init.d/apache reload
	    fi
	else
	    echo "The automatic configuration of GNUJSP failed."
	    echo "Please read /usr/share/doc/gnujsp/README.Debian to find out how to manually"
	    echo "set up GNUJSP on your system."
	fi
    ;;

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