mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-28 05:29:48 +00:00
Update to moinmoin 1.3.1
This port now supports installation of multiple wiki instances as proposed by the installation guide. Follow the textual instructions that are echoed out by the 'make install' progress for more information. Thanks to Florent for polishing up my update patches. Submitted by: Florent Thoumie <flz@xbsd.org> PR: ports/76377
This commit is contained in:
parent
a37f4f7761
commit
cf496dcd9f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=127139
@ -6,63 +6,72 @@
|
||||
#
|
||||
|
||||
PORTNAME= moinmoin
|
||||
PORTVERSION= 1.2.4
|
||||
PORTVERSION= 1.3.1
|
||||
CATEGORIES= www python
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= moin
|
||||
DISTNAME= moin-${PORTVERSION}
|
||||
|
||||
MAINTAINER= josef@FreeBSD.org
|
||||
COMMENT= A Python CGI clone of WikiWiki
|
||||
COMMENT= A Python clone of WikiWiki
|
||||
|
||||
USE_PYTHON= yes
|
||||
USE_PYDISTUTILS= yes
|
||||
PLIST_SUB+= PYTHON_SITELIB=${PYTHON_SITELIBDIR:S|^${LOCALBASE}/||} \
|
||||
CGIUSER=${CGIUSER} CGIROOT=${CGIROOT}
|
||||
|
||||
CGIUSER= moinmoin
|
||||
CGIUSERID?= 192
|
||||
CGIROOT= ${PREFIX}/www/cgi-bin
|
||||
HTDOCSROOT= ${PREFIX}/www/data
|
||||
PLIST_SUB+= PYTHON_SITELIB=${PYTHON_SITELIBDIR:S|^${LOCALBASE}/||}
|
||||
SUB_FILES= pkg-install
|
||||
SUB_LIST= MOINDIR=${MOINDIR} MOINDEST=${MOINDEST}
|
||||
|
||||
CGIUSER?= www
|
||||
CGIGROUP?= www
|
||||
MOINDIR= ${PREFIX}/share/moin
|
||||
MOINDEST?= ${PREFIX}/www/wiki
|
||||
MOINTYPE?= CGI
|
||||
|
||||
post-patch:
|
||||
@# Tweak configuration
|
||||
${SED} -e 's|^url_prefix =.*$$|url_prefix="/moin"|g' \
|
||||
${WRKSRC}/wiki/cgi-bin/moin_config.py > \
|
||||
${WRKSRC}/wiki/cgi-bin/moin_config.py.default
|
||||
PKGDEINSTALL= ${PKGINSTALL}
|
||||
|
||||
post-build:
|
||||
@# Compile setuid wrapper
|
||||
${CC} ${CFLAGS} -o ${WRKDIR}/moin \
|
||||
-DPYTHON_PATH='"${PYTHON_CMD}"' \
|
||||
-DMOIN_PREFIX='"${MOINDIR}"' \
|
||||
${FILESDIR}/wrapper.c
|
||||
.if ${MOINTYPE} == "STANDALONE"
|
||||
MOINSCRIPT= ${MOINDIR}/server/moin.py
|
||||
.elif ${MOINTYPE} == "FCGI"
|
||||
MOINSCRIPT= ${MOINDIR}/server/moin.fcg
|
||||
.elif ${MOINTYPE} == "MOD_PYTHON"
|
||||
.elif ${MOINTYPE} == "CGI"
|
||||
MOINSCRIPT= ${MOINDIR}/server/moin.cgi
|
||||
.else
|
||||
IGNORE= "MOINTYPE must be a STANDALONE, FCGI, MOD_PYTHON or CGI."
|
||||
.endif
|
||||
|
||||
pre-install:
|
||||
PKG_PREFIX=${PREFIX} INST_UID="${CGIUSERID}" \
|
||||
${SH} pkg-install ${PKGNAME} PRE-INSTALL
|
||||
pre-everything::
|
||||
@${ECHO}
|
||||
@${ECHO} "Set MOINTYPE=(CGI|FCGI|STANDALONE) to define"
|
||||
@${ECHO} "type of installation. Default is CGI."
|
||||
@${ECHO} "Use MOINDEST=/path to modify installation destination."
|
||||
@${ECHO} "Default value for MOINDEST is ${PREFIX}/www/wiki."
|
||||
@${ECHO}
|
||||
@${ECHO} "To get correct permissions, please set CGIUSER, CGIGROUP"
|
||||
@${ECHO} "per default it is set to www:www."
|
||||
@${ECHO}
|
||||
@${MKDIR} ${WRKDIR}
|
||||
|
||||
post-install:
|
||||
@# Install Wrapper
|
||||
${MKDIR} ${CGIROOT}
|
||||
${INSTALL_PROGRAM} ${WRKDIR}/moin ${CGIROOT}/
|
||||
${CHMOD} 4555 ${CGIROOT}/moin
|
||||
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
||||
|
||||
@# Arrange Permissions
|
||||
${MKDIR} ${MOINDIR}/data/backup
|
||||
${CHMOD} -R u+rw,go-wxs ${MOINDIR}/data
|
||||
${CHOWN} -R ${CGIUSER}:${CGIUSER} ${CGIROOT}/moin ${MOINDIR}/data
|
||||
|
||||
@# Create symbolic links and copy defaults
|
||||
${TEST} -f ${MOINDIR}/cgi-bin/moin_config.py || \
|
||||
${CP} ${MOINDIR}/cgi-bin/moin_config.py.default \
|
||||
${MOINDIR}/cgi-bin/moin_config.py
|
||||
${TEST} -d ${MOINDIR}/data/text || \
|
||||
${LN} -sf ${MOINDIR}/data/text.default ${MOINDIR}/data/text
|
||||
-${MKDIR} ${HTDOCSROOT}
|
||||
-${LN} -sf ${MOINDIR}/htdocs ${HTDOCSROOT}/moin
|
||||
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
instance: pre-everything apply-slist
|
||||
@${ECHO_CMD} "Creating a new wiki instance in ${MOINDEST}."; \
|
||||
if [ -f ${MOINDIR}/config/wikiconfig.py ]; then \
|
||||
${MKDIR} ${MOINDEST}; \
|
||||
${CP} -R ${MOINDIR}/data ${MOINDEST}; \
|
||||
${CP} -R ${MOINDIR}/underlay ${MOINDEST}; \
|
||||
${CHMOD} -R u+rw,go-ws ${MOINDEST}/data; \
|
||||
${INSTALL_SCRIPT} ${MOINDIR}/config/wikiconfig.py ${MOINDEST}; \
|
||||
if [ ! -z ${MOINSCRIPT} ]; then \
|
||||
${INSTALL_SCRIPT} ${MOINSCRIPT} ${MOINDEST}; \
|
||||
fi; \
|
||||
${CHOWN} -R ${CGIUSER}:${CGIGROUP} ${MOINDEST}; \
|
||||
${SH} ${PKGINSTALL} ${PKGNAME} INSTANCE ${MOINTYPE}; \
|
||||
else \
|
||||
${ECHO_CMD} "You need to install moinmoin first before trying"; \
|
||||
${ECHO_CMD} "to add a new wiki instance."; \
|
||||
fi
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,2 +1,2 @@
|
||||
MD5 (moin-1.2.4.tar.gz) = 7795dc4cb3e7f6b313d74b48aa1c0eb8
|
||||
SIZE (moin-1.2.4.tar.gz) = 1309981
|
||||
MD5 (moin-1.3.1.tar.gz) = c85cf90d43ddfe255283bf668fa200fe
|
||||
SIZE (moin-1.3.1.tar.gz) = 2852381
|
||||
|
@ -1,16 +0,0 @@
|
||||
--- setup.py.orig Sun Jun 6 08:58:33 2004
|
||||
+++ setup.py Fri Jun 25 03:31:38 2004
|
||||
@@ -167,9 +167,11 @@
|
||||
'scripts': moin_scripts,
|
||||
|
||||
'data_files': [
|
||||
- ('share/moin/cgi-bin', filter(trash_filter, glob.glob('wiki/cgi-bin/*'))),
|
||||
+ ('share/moin/cgi-bin', filter(trash_filter,
|
||||
+ glob.glob('wiki/cgi-bin/*.cgi') +
|
||||
+ glob.glob('wiki/cgi-bin/*.py.default'))),
|
||||
('share/moin/data', ['wiki/data/intermap.txt']),
|
||||
- ('share/moin/data/text', filter(trash_filter, glob.glob('wiki/data/text/*'))),
|
||||
+ ('share/moin/data/text.default', filter(trash_filter, glob.glob('wiki/data/text/*'))),
|
||||
('share/moin/data/plugin', ['wiki/data/plugin/__init__.py']),
|
||||
('share/moin/data/plugin/action', ['wiki/data/plugin/action/__init__.py']),
|
||||
('share/moin/data/plugin/macro', ['wiki/data/plugin/macro/__init__.py']),
|
113
www/moinmoin/files/pkg-install.in
Normal file
113
www/moinmoin/files/pkg-install.in
Normal file
@ -0,0 +1,113 @@
|
||||
#! /bin/sh
|
||||
|
||||
destdir=%%MOINDEST%%
|
||||
sharedir=%%MOINDIR%%
|
||||
|
||||
case "x$2" in
|
||||
|
||||
"xINSTANCE")
|
||||
|
||||
echo "************************************************************"
|
||||
|
||||
case "x$3" in
|
||||
|
||||
"xMOD_PYTHON")
|
||||
|
||||
echo "Since you chose MOINTYPE=MOD_PYTHON, you may want to"
|
||||
echo "add something like that to your Apache configuration."
|
||||
echo ""
|
||||
echo ",-----"
|
||||
echo " Alias /mywiki $destdir"
|
||||
echo " <Location \"/mywiki\">"
|
||||
echo " SetHandler python-program"
|
||||
echo " PythonPath \"['$destdir'] + sys.path\""
|
||||
echo " PythonHandler MoinMoin.request::RequestModPy.run"
|
||||
echo " PythonAutoReload On"
|
||||
echo " PythonDebug On"
|
||||
echo " </Location>"
|
||||
echo "\`-----"
|
||||
echo ""
|
||||
|
||||
;;
|
||||
|
||||
"xCGI")
|
||||
|
||||
echo "Since you chose MOINTYPE=CGI, you may want to"
|
||||
echo "add something like that to your Apache configuration."
|
||||
echo ""
|
||||
|
||||
echo ",-----"
|
||||
echo " Alias /wiki/ \"$sharedir/htdocs/\""
|
||||
echo " ScriptAlias /mywiki \"$destdir/moin.cgi\""
|
||||
echo " <Directory \"$sharedir/htdocs/\">"
|
||||
echo " Allow from all"
|
||||
echo " </Directory>"
|
||||
echo "\`-----"
|
||||
echo ""
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
echo "You may need to modify wikiconfig.py in your wiki instance"
|
||||
echo "directory (eg. $destdir)."
|
||||
echo ""
|
||||
echo "If you want to install additional wiki instances"
|
||||
echo "call 'make instance' with appriopriate arguments."
|
||||
echo "E.g.: make MOINTYPE=FCGI MOINDEST=/usr/local/www/wiki instance"
|
||||
echo "************************************************************"
|
||||
|
||||
;;
|
||||
|
||||
"xPOST-INSTALL")
|
||||
|
||||
echo "************************************************************"
|
||||
echo "Important: You have currently no wiki instance installed."
|
||||
echo ""
|
||||
echo "If you're installing from ports, just run 'make instance'"
|
||||
echo "with appriopriate arguments."
|
||||
echo "eg. make MOINTYPE=FCGI MOINDEST=/usr/local/www/wiki instance"
|
||||
echo ""
|
||||
echo "If you're installing from package, run these commands."
|
||||
echo ""
|
||||
echo "# Choose here one script depending on the type of wiki you"
|
||||
echo "# want : moin.py (standalone), moin.fcg (FCGI) or moin.cgi."
|
||||
echo 'export MOINSCRIPT="moin.cgi"'
|
||||
echo '# Defaults should be fine but you may want to modify these.'
|
||||
echo 'export MOINDIR="%%MOINDIR%%"'
|
||||
echo 'export MOINDEST="%%MOINDEST%%"'
|
||||
echo '# Set this to your apache user and group.'
|
||||
echo 'export CGIUSER="www"'
|
||||
echo 'export CGIGROUP="www"'
|
||||
echo ''
|
||||
echo 'mkdir -p ${MOINDEST}/data'
|
||||
echo 'mkdir -p ${MOINDEST}/underlay'
|
||||
echo 'cp -R ${MOINDIR}/data ${MOINDEST}'
|
||||
echo 'cp -R ${MOINDIR}/underlay ${MOINDEST}'
|
||||
echo 'chmod -R u+rw,go-ws ${MOINDEST}/data'
|
||||
echo 'install -m 0555 ${MOINDIR}/config/wikiconfig.py ${MOINDEST}'
|
||||
echo 'test -z "${MOINSCRIPT}" || \'
|
||||
echo ' install -m 0555 ${MOINDIR}/server/${MOINSCRIPT} ${MOINDEST}'
|
||||
echo 'chown -R ${CGIUSER}:${CGIGROUP} ${MOINDEST}'
|
||||
echo ""
|
||||
echo "Note: export might not work with your shell, use"
|
||||
echo "# setenv VAR 'value' instead"
|
||||
echo "************************************************************"
|
||||
|
||||
;;
|
||||
|
||||
"xDEINSTALL")
|
||||
|
||||
echo "************************************************************"
|
||||
echo "All shared files have been removed."
|
||||
echo "To complete deinstallation, please remove all the wiki"
|
||||
echo "instances you have created."
|
||||
echo "************************************************************"
|
||||
|
||||
;;
|
||||
|
||||
esac
|
@ -1,14 +0,0 @@
|
||||
/*
|
||||
MoinMoin setuid wrapper by perky
|
||||
$FreeBSD$
|
||||
*/
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[], char *envp[])
|
||||
{
|
||||
char *margv[] = { PYTHON_PATH, MOIN_PREFIX"/cgi-bin/moin.cgi", NULL };
|
||||
|
||||
chdir(MOIN_PREFIX);
|
||||
return execve(PYTHON_PATH, margv, envp);
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
if [ "$2" != "POST-DEINSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=moinmoin
|
||||
|
||||
if pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
echo "To delete MoinMoin user permanently, use 'pw userdel ${USER}'"
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
if [ "$2" != "PRE-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
[ "$INST_USER" ] || INST_USER=moinmoin
|
||||
[ "$INST_GROUP" ] || INST_GROUP=${INST_USER}
|
||||
[ "$INST_UID" ] || INST_UID=192
|
||||
[ "$INST_GID" ] || INST_GID=${INST_UID}
|
||||
|
||||
if ! pw groupshow "${INST_GROUP}" 2>/dev/null 1>&2; then
|
||||
if pw groupadd ${INST_GROUP} -g ${INST_GID}; then
|
||||
echo "Added group \"${INST_GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${INST_GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! pw usershow "${INST_USER}" 2>/dev/null 1>&2; then
|
||||
if pw useradd ${INST_USER} -u ${INST_UID} -g ${INST_GROUP} -h - \
|
||||
-s "/sbin/nologin" -d "/nonexistent" \
|
||||
-c "MoinMoin User"; \
|
||||
then
|
||||
echo "Added user \"${INST_USER}\"."
|
||||
else
|
||||
echo "Adding user \"${INST_USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit 0
|
@ -1,7 +0,0 @@
|
||||
=============================================
|
||||
You can configure detail options at
|
||||
${PREFIX}/share/moin/cgi-bin/moin_config.py
|
||||
|
||||
And, you may need graphics/py-gdchart port
|
||||
to use chart extension.
|
||||
=============================================
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user