head	1.2;
access;
symbols
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2005.09.29.21.10.28;	author mnag;	state dead;
branches;
next	1.1;

1.1
date	2003.04.01.08.07.44;	author edwin;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Update to 20040904 (security fix) [1]
Remove FORBIDDEN [1]
Don't use perl in pkg-install (change to sed)

PR:		86691 [1]
Submitted by:	justin@@hawkins.id.au (maintainer)
Approved by:	pav (mentor)
@
text
@#!/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
@


1.1
log
@FreeBSD port of TWiki

	TWiki is a flexible, powerful, and easy to use Web-based
	collaboration platform.

PR:		ports/49000
Submitted by:	Justin Hawkins <justin@@hawkins.id.au>
@
text
@@

