diff options
author | drochner <drochner@pkgsrc.org> | 2003-07-28 09:27:29 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2003-07-28 09:27:29 +0000 |
commit | 64325cd1bcfb94c6da8b30f7dbbc52c1324868b1 (patch) | |
tree | a2f82e6e86cb84416bac4130df9238bbadeeef20 | |
parent | a33b0d84c5b94e097bc7637dca2f4d276dac48b5 (diff) | |
download | pkgsrc-64325cd1bcfb94c6da8b30f7dbbc52c1324868b1.tar.gz |
install a little shell script which eases the creation of a zope
instance
in response to
PR: pkg/18191 by Kent Polk
-rw-r--r-- | www/zope25/Makefile | 8 | ||||
-rw-r--r-- | www/zope25/PLIST | 3 | ||||
-rw-r--r-- | www/zope25/files/zope25-create | 47 |
3 files changed, 56 insertions, 2 deletions
diff --git a/www/zope25/Makefile b/www/zope25/Makefile index 71450e5e8f6..1d66afadd50 100644 --- a/www/zope25/Makefile +++ b/www/zope25/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2003/07/17 22:56:09 grant Exp $ +# $NetBSD: Makefile,v 1.10 2003/07/28 09:27:29 drochner Exp $ # DISTNAME= Zope-2.6.1-src @@ -21,6 +21,9 @@ ZOPEDIR= ${PREFIX}/lib/zope ZOPEPY= pcgi lib/python ZServer z2.py zpasswd.py ZOPEDATA= Extensions doc import var inst utilities +ZOPECREATE_SED= "-e s|@@PYTHONBIN@@|${PYTHONBIN}|" +ZOPECREATE_SED+= "-e s|@@ZOPE_HOME@@|${ZOPEDIR}|" + #do-build: # (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} w_pcgi.py) @@ -29,6 +32,8 @@ do-build: ${SETENV} ${MAKE_ENV} ${MAKE}) (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ ${PYTHONBIN} inst/build_extensions.py) + ${SED} ${ZOPECREATE_SED} <${FILESDIR}/zope25-create \ + >${WRKSRC}/zope25-create # # Install code and prototype data. A real INSTANCE_HOME must be created @@ -42,6 +47,7 @@ do-install: -print | ${PAX} -rw ${ZOPEDIR} cd ${ZOPEDIR} && ${PYTHONBIN} ${WRKSRC}/inst/compilezpy.py cd ${WRKSRC} && ${PAX} -rw ${ZOPEDATA} ${ZOPEDIR} + ${INSTALL_SCRIPT} ${WRKSRC}/zope25-create ${PREFIX}/bin .include "../../lang/python/application.mk" .include "../../mk/bsd.pkg.mk" diff --git a/www/zope25/PLIST b/www/zope25/PLIST index 850f754461c..a547fe08035 100644 --- a/www/zope25/PLIST +++ b/www/zope25/PLIST @@ -1,4 +1,5 @@ -@comment $NetBSD: PLIST,v 1.2 2003/04/17 19:06:14 drochner Exp $ +@comment $NetBSD: PLIST,v 1.3 2003/07/28 09:27:30 drochner Exp $ +bin/zope25-create lib/zope/Extensions/README.txt lib/zope/ZServer/DebugLogger.py lib/zope/ZServer/DebugLogger.pyc diff --git a/www/zope25/files/zope25-create b/www/zope25/files/zope25-create new file mode 100644 index 00000000000..690ab469449 --- /dev/null +++ b/www/zope25/files/zope25-create @@ -0,0 +1,47 @@ +#!/bin/sh +ID='$NetBSD: zope25-create,v 1.1 2003/07/28 09:27:31 drochner Exp $' + +PYTHONBIN=@@PYTHONBIN@@ +ZOPE_HOME=@@ZOPE_HOME@@ + +INSTANCE_HOME=/var/zope +if [ $# -gt 0 ]; then + INSTANCE_HOME=$1 +fi + +STARTSCRIPT=${INSTANCE_HOME}/zope-start + +echo "Creating Zope instance in ${INSTANCE_HOME}" + +mkdir -p ${INSTANCE_HOME} +mkdir -p ${INSTANCE_HOME}/var + +if [ ! -d ${INSTANCE_HOME} -o ! -w ${INSTANCE_HOME} ]; then + echo "Fatal error: cannot access instance home directory" + exit 1 +fi + +echo "Initial user authentication" +(cd ${INSTANCE_HOME} && ${PYTHONBIN} ${ZOPE_HOME}/zpasswd.py inituser) + +SCRIPT_FIX="" +for i in PYTHONBIN ZOPE_HOME INSTANCE_HOME;do + eval v=\${$i} + SCRIPT_FIX="${SCRIPT_FIX} -e s|@$i@|$v|" +done + +sed ${SCRIPT_FIX} >${STARTSCRIPT} <<SCRIPT_END +#!/bin/sh +# created automatically by ${ID} + +PYTHONBIN=@PYTHONBIN@ +ZOPE_HOME=@ZOPE_HOME@ +INSTANCE_HOME=@INSTANCE_HOME@ +export INSTANCE_HOME + +exec ${PYTHONBIN} ${ZOPE_HOME}/z2.py \$* +SCRIPT_END + +chmod +x ${STARTSCRIPT} + +echo "To start ZServer for this instance, run ${STARTSCRIPT}" |