diff options
-rw-r--r-- | www/twiki/Makefile | 35 | ||||
-rw-r--r-- | www/twiki/distinfo | 4 | ||||
-rw-r--r-- | www/twiki/files/pkg-install.in | 104 | ||||
-rw-r--r-- | www/twiki/pkg-install | 99 |
4 files changed, 125 insertions, 117 deletions
diff --git a/www/twiki/Makefile b/www/twiki/Makefile index 50fd0796e4aa..125be424222a 100644 --- a/www/twiki/Makefile +++ b/www/twiki/Makefile @@ -6,27 +6,28 @@ # PORTNAME= twiki -PORTVERSION= 20040902 +PORTVERSION= 20040904 CATEGORIES= www -MASTER_SITES= http://twiki.org/swd/ http://www.thoeny.com/peter/twiki/ +MASTER_SITES= http://twiki.org/swd/ \ + http://www.thoeny.com/peter/twiki/ DISTNAME= TWiki${PORTVERSION} MAINTAINER= justin@hawkins.id.au COMMENT= A flexible, powerful, and easy to use Web-based collaboration platform -FORBIDDEN= Security: http://twiki.org/cgi-bin/view/Codev/SecurityAlertExecuteCommandsWithInclude +USE_REINPLACE= yes -NO_WRKSUBDIR= yes +WRKSRC= ${WRKDIR}/${PORTNAME} NO_BUILD= yes -USE_ZIP= yes +WWW_ROOT?= ${WWWOWN} +TWIKIDIR= ${PREFIX}/${WWW_ROOT}/twiki -LTWIKIDIR= www/twiki - -TWIKIDIR= ${PREFIX}/${LTWIKIDIR} - -WWW_ROOT?= www -PLIST_SUB+= WWW_ROOT=${WWW_ROOT} +PLIST_SUB= WWW_ROOT=${WWW_ROOT} +SUB_LIST= WWWUSER=${WWWOWN} WWWGROUP=${WWWGRP} TWIKIDIR=${TWIKIDIR} \ + REINPLACE_CMD="${REINPLACE_CMD}" +SUB_FILES= pkg-install +PKGINSTALL= ${WRKDIR}/pkg-install pre-everything:: @${ECHO} "****************************************************************" @@ -34,16 +35,18 @@ pre-everything:: @${ECHO} "* This software can't be upgraded automatically without *" @${ECHO} "* damaging data in your wiki! *" @${ECHO} "****************************************************************" + @sleep 10 -pre-configure: -# move config file to sample +post-extract: + @# move config to sample @${MV} ${WRKSRC}/lib/TWiki.cfg ${WRKSRC}/lib/TWiki.cfg.sample do-install: - ${MKDIR} ${TWIKIDIR} - ${CP} -R ${WRKSRC}/* ${TWIKIDIR}/ + ${INSTALL} -d -m 0755 ${TWIKIDIR} + (cd ${WRKSRC} && ${FIND} . | \ + ${CPIO} -pdmu -R${SHAREOWN}:${SHAREGRP} ${TWIKIDIR}) post-install: - PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} POST-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include <bsd.port.mk> diff --git a/www/twiki/distinfo b/www/twiki/distinfo index d46f0fbb8a9e..46860e4c44a2 100644 --- a/www/twiki/distinfo +++ b/www/twiki/distinfo @@ -1,2 +1,2 @@ -MD5 (TWiki20040902.zip) = d805a957b9a903e83ee1538db52bca21 -SIZE (TWiki20040902.zip) = 2585307 +MD5 (TWiki20040904.tar.gz) = 1ee1fdf5309ee0300d29cafacc30b75c +SIZE (TWiki20040904.tar.gz) = 1703741 diff --git a/www/twiki/files/pkg-install.in b/www/twiki/files/pkg-install.in new file mode 100644 index 000000000000..a6b59f4c25c3 --- /dev/null +++ b/www/twiki/files/pkg-install.in @@ -0,0 +1,104 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +TWIKIDIR=%%TWIKIDIR%% + +HOSTNAME=`hostname` + +REINPLACE_CMD="%%REINPLACE_CMD%%" + +WWWUSER=%%WWWUSER%% +WWWGROUP=%%WWWGROUP%% + +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? + $REINPLACE_CMD -e "s|/home/httpd/twiki|${TWIKIDIR}|g" \ + -e "s|your.domain.com|$HOSTNAME|" -e "s|/bin/egrep|/usr/bin/egrep|" \ + -e "s|/bin/fgrep|/usr/bin/fgrep|" ${TWIKIDIR}/lib/TWiki.cfg.sample + rm ${TWIKIDIR}/lib/TWiki.cfg.sample.bak + + for i in `find ${TWIKIDIR}/data -type f`; do + $REINPLACE_CMD -e "s/nobody:/${WWWUSER}:/g" $i; + done + find ${TWIKIDIR}/data -type f -name \*.bak | xargs rm + + 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 diff --git a/www/twiki/pkg-install b/www/twiki/pkg-install deleted file mode 100644 index cca9829fa5aa..000000000000 --- a/www/twiki/pkg-install +++ /dev/null @@ -1,99 +0,0 @@ -#!/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 |