aboutsummaryrefslogtreecommitdiff
path: root/www/twiki/files/pkg-install.in
blob: 7d70dbf346d355ae027a521608d0fb4339696d2f (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#

TWDIR=%%TWDIR%%
WWWDIR=%%WWWDIR%%
WWWOWN=%%WWWOWN%%
WWWGRP=%%WWWGRP%%

case $2 in
	PRE-INSTALL)
		;;
	POST-INSTALL)
		cd ${TWDIR}/
		find -s * -type d | while read dir; do
			mkdir -p ${WWWDIR}/$dir/
		done
		find -s * -not -type d | while read file; do
			if [ -e ${WWWDIR}/$file ]; then
				echo "${WWWDIR}/$file exists, skipping"
			else
				cp $file ${WWWDIR}/$file
			fi
		done
		chown -R ${WWWOWN}:${WWWGRP} ${WWWDIR}/
		chmod -R u+w ${WWWDIR}/
		cd ${WWWDIR}/
		chmod o-rwx data lib test tools
		chmod a+x tools/*

		# let the user know what's going on
		cat << __EOF__
*****************************************************************
* You can inspect differences (if any) between the distribition *
* and the files installed using this command:                   *
  % diff -ru ${TWDIR} ${WWWDIR}
* For more info:                                                *
*  http://wiki.FreeBSD.org/TWiki                                *
*  http://twiki.org/cgi-bin/view/Codev/TWikiOnFreeBSD           *
*  http://twiki.org/cgi-bin/view/TWiki/WebHome                  *
*****************************************************************
__EOF__
		;;
	*)
		echo "Unexpected Argument $2!!!"
		exit 1
		;;
esac
exit 0