aboutsummaryrefslogtreecommitdiff
path: root/www/twiki/pkg-install
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2003-04-01 08:07:44 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2003-04-01 08:07:44 +0000
commit308b2a60d8bdbeec9d373dc63cfc829119570797 (patch)
tree3b0f9aaa8558f303564a438b04f0aaf918ec82f9 /www/twiki/pkg-install
parent5c6be7bf37f43c9caffb44ca7803f36023121dc9 (diff)
downloadports-308b2a60d8bdbeec9d373dc63cfc829119570797.tar.gz
ports-308b2a60d8bdbeec9d373dc63cfc829119570797.zip
Notes
Diffstat (limited to 'www/twiki/pkg-install')
-rw-r--r--www/twiki/pkg-install99
1 files changed, 99 insertions, 0 deletions
diff --git a/www/twiki/pkg-install b/www/twiki/pkg-install
new file mode 100644
index 000000000000..cca9829fa5aa
--- /dev/null
+++ b/www/twiki/pkg-install
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+LTWIKIDIR=www/twiki
+
+TWIKIDIR=${PKG_PREFIX}/${LTWIKIDIR}
+
+HOSTNAME=`hostname`
+
+WWWUSER=www
+WWWGROUP=www
+
+case $2 in
+ PRE-INSTALL)
+ ;;
+ POST-INSTALL)
+
+ # create the empty dirs if necessary (the port creates them
+ # but pkg_add does not)
+ if [ ! -d "${TWIKIDIR}/pub/Main" ]; then
+ mkdir ${TWIKIDIR}/pub/Main
+ fi
+ if [ ! -d "${TWIKIDIR}/pub/Sandbox" ]; then
+ mkdir ${TWIKIDIR}/pub/Sandbox
+ fi
+ if [ ! -d "${TWIKIDIR}/pub/Trash" ]; then
+ mkdir ${TWIKIDIR}/pub/Trash
+ fi
+
+ # hmmm, if we modify this here, the file fails md5sum when deinstalling
+ # but if we do this in Makefile, then we have a hardcoded PREFIX. What to
+ # do?
+ perl -pi -e "s#/home/httpd/twiki#${TWIKIDIR}#g" ${TWIKIDIR}/lib/TWiki.cfg.sample
+ perl -pi -e "s#your.domain.com#`hostname`#" ${TWIKIDIR}/lib/TWiki.cfg.sample
+ perl -pi -e "s#/bin/egrep#/usr/bin/egrep#" ${TWIKIDIR}/lib/TWiki.cfg.sample
+ perl -pi -e "s#/bin/fgrep#/usr/bin/fgrep#" ${TWIKIDIR}/lib/TWiki.cfg.sample
+
+ perl -pi -e "s/nobody:/${WWWUSER}:/g" ${TWIKIDIR}/data/*/*,v
+
+ chown ${WWWUSER}:${WWWGROUP} `find ${TWIKIDIR}/data -type f`
+ chown ${WWWUSER}:${WWWGROUP} `find ${TWIKIDIR}/data -type d`
+ chown ${WWWUSER}:${WWWGROUP} `find ${TWIKIDIR}/pub -type f`
+ chown ${WWWUSER}:${WWWGROUP} `find ${TWIKIDIR}/pub -type d`
+
+ chmod 755 ${TWIKIDIR}/bin/*
+ chmod 664 `find ${TWIKIDIR}/data -type f`
+ chmod 775 `find ${TWIKIDIR}/data -type d`
+ chmod 775 `find ${TWIKIDIR}/pub -type d`
+
+ # let the user know what's going on
+ cat << __EOF__
+
+*****************************************************************
+TWiki has been installed in ${TWIKIDIR}, with a sample
+configuration file in ${TWIKIDIR}/lib/TWiki.cfg.sample
+You need to copy this file to ${TWIKIDIR}/lib/TWiki.cfg
+and possibly edit it before your installation will be complete.
+
+In most cases, you can simply type:
+
+cp ${TWIKIDIR}/lib/TWiki.cfg.sample ${TWIKIDIR}/lib/TWiki.cfg
+
+Then you should be able to visit http://${HOSTNAME}/twiki/
+
+You need to setup your webserver correctly for TWiki to work
+An example for apache is below:
+
+ScriptAlias /twiki/bin/ "${PKG_PREFIX}/www/twiki/bin/"
+Alias /twiki/ "${PKG_PREFIX}/www/twiki/"
+<Directory "${PKG_PREFIX}/www/twiki/bin">
+ Options +ExecCGI
+ SetHandler cgi-script
+ Allow from all
+ SetEnv USER "${WWWUSER}"
+</Directory>
+<Directory "${PKG_PREFIX}/www/twiki/pub">
+ Options FollowSymLinks +Includes
+ AllowOverride None
+ Allow from all
+</Directory>
+
+Note that this default configuration defines a completely
+open TWiki - any visitor may make changes. Please consult the
+documentation for other configuration options if this is not the
+desired mode of operation.
+
+Please visit http://TWiki.org/feedback.html and leave feedback
+on your experiences with TWiki.
+
+Good Luck!
+*****************************************************************
+__EOF__
+
+ ;;
+ *)
+ echo "Unexpected Argument $2!!!"
+ exit 1
+ ;;
+esac
+exit 0