diff options
author | alepulver <alepulver@FreeBSD.org> | 2007-02-09 12:05:45 +0800 |
---|---|---|
committer | alepulver <alepulver@FreeBSD.org> | 2007-02-09 12:05:45 +0800 |
commit | 82956e86573b1d71d02d7071496a1d42d2503585 (patch) | |
tree | 666cc024b929f56c35115412d6919ccd72be4e28 /www | |
parent | d708ac36a54752a508ddf2de8c0390c57b34ce42 (diff) | |
download | freebsd-ports-graphics-82956e86573b1d71d02d7071496a1d42d2503585.tar.gz freebsd-ports-graphics-82956e86573b1d71d02d7071496a1d42d2503585.tar.zst freebsd-ports-graphics-82956e86573b1d71d02d7071496a1d42d2503585.zip |
- Update openacs to 5.3.0 and dotlrn to 2.2.1.
- Make compatible with the new aolserver 4.5 port infrastructure.
- Take maintainership.
PR: ports/108737
Submitted by: Martin Matuska <martin@matuska.org>
Approved by: "Aldert nooitgedagt - net" <aldert@nooitgedagt.net> (maintainer)
Diffstat (limited to 'www')
-rw-r--r-- | www/openacs-dotlrn/Makefile | 16 | ||||
-rw-r--r-- | www/openacs-dotlrn/distinfo | 6 | ||||
-rw-r--r-- | www/openacs-dotlrn/pkg-descr | 3 | ||||
-rw-r--r-- | www/openacs/Makefile | 190 | ||||
-rw-r--r-- | www/openacs/distinfo | 6 | ||||
-rw-r--r-- | www/openacs/files/create_sampledb.sh.in | 45 | ||||
-rw-r--r-- | www/openacs/files/dotlrn.in | 46 | ||||
-rw-r--r-- | www/openacs/files/openacs.in | 46 | ||||
-rw-r--r-- | www/openacs/files/pkg-deinstall.in | 37 | ||||
-rw-r--r-- | www/openacs/files/pkg-install.in | 125 | ||||
-rw-r--r-- | www/openacs/files/pkg-message.in | 71 | ||||
-rw-r--r-- | www/openacs/files/post-config.in | 124 | ||||
-rw-r--r-- | www/openacs/files/svscan.sh | 62 | ||||
-rw-r--r-- | www/openacs/pkg-descr | 3 |
14 files changed, 295 insertions, 485 deletions
diff --git a/www/openacs-dotlrn/Makefile b/www/openacs-dotlrn/Makefile index 8bcbe6ff0c8..9e245661406 100644 --- a/www/openacs-dotlrn/Makefile +++ b/www/openacs-dotlrn/Makefile @@ -6,13 +6,21 @@ # PORTNAME= dotlrn -PORTVERSION= 2.1.3 +PORTVERSION= 2.2.1 MASTER_SITES= http://openacs.org/projects/dotlrn/download/download/ +EXTRACT_SUFX= .tgz?revision_id=559791 -MAINTAINER= aldert@nooitgedagt.net -COMMENT= Modular web application platform for high traffic elearning community +MAINTAINER= martin@matuska.org +COMMENT= OpenACS-based e-learning platform for high-traffic communities -OPENACS_USER= dotlrn0 +OPENACS_USER?= dotlrn +OPENACS_DB?= dotlrn +OPENACS_GROUP?= www + +OPENACSBASE= ${TARGETDIR}/dotlrn +OPENACSNAME= .LRN + +BASE_INSTALL= bin content-repository-content-files log packages tcl www install.xml DESCR= ${.CURDIR}/pkg-descr MD5_FILE= ${.CURDIR}/distinfo diff --git a/www/openacs-dotlrn/distinfo b/www/openacs-dotlrn/distinfo index a0060c30d20..9cd6cc09e94 100644 --- a/www/openacs-dotlrn/distinfo +++ b/www/openacs-dotlrn/distinfo @@ -1,3 +1,3 @@ -MD5 (dotlrn-2.1.3.tar.gz) = f8616313b779cfad679b6a2d82b9a065 -SHA256 (dotlrn-2.1.3.tar.gz) = b6edcd4d0fe3d59f313812c8fd56b4f4735651c2abc2ed045fa8bf5a636fdb8d -SIZE (dotlrn-2.1.3.tar.gz) = 8548486 +MD5 (dotlrn-2.2.1.tgz?revision_id=559791) = 1b769c66601de8ed99f46ffe74624267 +SHA256 (dotlrn-2.2.1.tgz?revision_id=559791) = e912424256dd178cce04a101b2c01e275e36eb36ea391f0e0c67acefc9f12183 +SIZE (dotlrn-2.2.1.tgz?revision_id=559791) = 21892161 diff --git a/www/openacs-dotlrn/pkg-descr b/www/openacs-dotlrn/pkg-descr index 055596ffa3b..80d23b24584 100644 --- a/www/openacs-dotlrn/pkg-descr +++ b/www/openacs-dotlrn/pkg-descr @@ -15,3 +15,6 @@ WWW: http://dotlrn.org - Aldert aldert@nooitgedagt.net + +- Martin Matuska +martin@matuska.org diff --git a/www/openacs/Makefile b/www/openacs/Makefile index ad768e7851d..17380c50d17 100644 --- a/www/openacs/Makefile +++ b/www/openacs/Makefile @@ -6,137 +6,97 @@ # PORTNAME?= openacs -PORTVERSION?= 5.1.5 -PORTREVISION?= 2 +PORTVERSION?= 5.3.0 CATEGORIES= www MASTER_SITES?= http://openacs.org/projects/openacs/download/download/ +EXTRACT_SUFX?= .tgz?revision_id=583060 -MAINTAINER?= aldert@nooitgedagt.net +MAINTAINER?= martin@matuska.org COMMENT?= A modular web application platform for high traffic communities -OPENACS_USER?= service0 -OPENACS_GROUP= web -PG_USER= pgsql - -DATADIR= ${PREFIX}/share/${OPENACS_USER} -EXAMPLESDIR= ${PREFIX}/share/examples/${OPENACS_USER} -OPENACSBASE= ${PREFIX}/share -VIRTUALBASE= /var/lib -AOLSERVERBASE= ${LOCALBASE}/aolserver -DTSERVICEBASE= /var/service -RCCONF= /etc/rc.conf - -IP_ADDRESS= 0.0.0.0 - -USE_RC_SUBR= YES +AOLSERVERBASE?= ${LOCALBASE}/aolserver +RUN_DEPENDS= ${AOLSERVERBASE}/bin/nscache.so:${PORTSDIR}/www/aolserver-nscache \ + ${AOLSERVERBASE}/bin/nsopenssl.so:${PORTSDIR}/security/aolserver-nsopenssl \ + ${AOLSERVERBASE}/bin/nssha1.so:${PORTSDIR}/security/aolserver-nssha1 \ + ${AOLSERVERBASE}/bin/nspostgres.so:${PORTSDIR}/databases/aolserver-nspostgres \ + ${LOCALBASE}/lib/tdomConfig.sh:${PORTSDIR}/www/tdom + +USE_RC_SUBR?= ${PORTNAME} +NO_BUILD= yes + +OPENACS_USER?= ${PORTNAME} +OPENACS_DB?= ${PORTNAME} +OPENACS_GROUP?= www +PGUSER?= pgsql +OPENACSBASE?= ${TARGETDIR}/openacs +OPENACSNAME?= OpenACS + +BASE_INSTALL?= bin content-repository-content-files log packages tcl www +PLIST= ${WRKDIR}/plist.tmp +SUB_LIST+= OPENACS_USER=${OPENACS_USER} OPENACS_GROUP=${OPENACS_GROUP} \ + OPENACSBASE=${OPENACSBASE} OPENACS_DB=${OPENACS_DB} \ + PGUSER=${PGUSER} AOLSERVERBASE=${AOLSERVERBASE} \ + PORTNAME=${PORTNAME} OPENACSNAME=${OPENACSNAME} + +SUB_FILES+= pkg-install pkg-deinstall pkg-message openacs dotlrn create_sampledb.sh PKGINSTALL= ${WRKDIR}/pkg-install PKGMESSAGE= ${WRKDIR}/pkg-message PKGDEINSTALL= ${WRKDIR}/pkg-deinstall -.if defined(WITH_POSTCONFIG) -POSTCONFIG= true -PKGNAMESUFFIX= -withconfig -.endif -.if defined(WITH_DT) -DT= true -RUN_DEPENDS+= ${LOCALBASE}/bin/supervise:${PORTSDIR}/sysutils/daemontools +.if !defined(NOPORTDOCS) +PORTDOCS= ChangeLog readme.txt license.txt .endif -SUB_FILES= pkg-install pkg-message pkg-deinstall post-config -SUB_LIST+= RCCONF=${RCCONF} POSTCONFIG=${POSTCONFIG} \ - OPENACSBASE=${OPENACSBASE} OPENACS_GROUP=${OPENACS_GROUP} \ - OPENACS_USER=${OPENACS_USER} DB=${DB} PGDATA=${PGDATA} \ - PG_USER=${PG_USER} PGBASE=${PGBASE} \ - DTSERVICEBASE=${DTSERVICEBASE} DT=${DT} \ - AOLSERVERBASE=${AOLSERVERBASE} VIRTUALBASE=${VIRTUALBASE} - -RUN_DEPENDS+= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \ - ${LOCALBASE}/lib/libtcl84.so.1:${PORTSDIR}/lang/tcl84-thread \ - ${LOCALBASE}/lib/libreadline.so:${PORTSDIR}/devel/readline \ - -.if defined(WITH_ORACLE) -BROKEN= "Oracle not supported yet" -DB= ORA -.else -DB= PG -PGBASE= ${LOCALBASE} -PGDATA= ${LOCALBASE}/pgsql/data -RUN_DEPENDS+= ${LOCALBASE}/lib/libpq.so:${PORTSDIR}/databases/postgresql74-server \ - ${LOCALBASE}/aolserver/bin/nsd:${PORTSDIR}/www/aolserver-openacs-pg -.endif - -RUN_DEPENDS+= ${LOCALBASE}/lib/tdom0.8.0/libtdom0.8.0.so:${PORTSDIR}/www/tdom \ - ${LOCALBASE}/tclwebtest-1.0/tclwebtest:${PORTSDIR}/www/tclwebtest - -USE_LINUX= YES - -NO_BUILD= YES - -REINPLACE_ARGS= -i "" -e +OPTIONS= EXAMPLES "Install various example files" on -PLIST_FILES= ${EXAMPLESDIR:S,^${PREFIX}/,,}/svscan.sh \ - ${EXAMPLESDIR:S,^${PREFIX}/,,}/restart-aolserver \ - ${EXAMPLESDIR:S,^${PREFIX}/,,}/svgroup \ - ${EXAMPLESDIR:S,^${PREFIX}/,,}/nsd-postgres \ - ${EXAMPLESDIR:S,^${PREFIX}/,,}/nsd-oracle \ - ${EXAMPLESDIR:S,^${PREFIX}/,,}/post-config.sh +.include <bsd.port.pre.mk> +post-patch: + @${SED} -e 's|service0|${OPENACS_USER}|' \ + -e 's|/var/lib/aolserver/$${server}|${OPENACSBASE}|' \ + -e 's|/usr/local/aolserver|${AOLSERVERBASE}|' \ + ${WRKSRC}/etc/config.tcl > ${WRKDIR}/openacs-config.tcl pre-install: - @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @ ${ECHO} "Generating plist" + @ ${FIND} ${WRKSRC} ! -type d ! -path '${WRKSRC}/etc*' \ + ! -path '${WRKSRC}/readme.txt' ! -path '${WRKSRC}/license.txt' \ + ! -path '${WRKSRC}/ChangeLog' | \ + ${SED} 's|${WRKSRC}|${OPENACSBASE:S/${TARGETDIR}\///}|' > ${PLIST} + @ ${ECHO} ${OPENACSBASE:S/${TARGETDIR}\///}/etc/${PORTNAME}-config.tcl >> ${PLIST} + @ ${ECHO} @dirrm ${OPENACSBASE:S/${TARGETDIR}\///}/etc >> ${PLIST} + @ ${FIND} ${WRKSRC} -type d ! -path '${WRKSRC}/etc*' | \ + ${SORT} -r | \ + ${SED} 's|${WRKSRC}|@dirrmtry ${OPENACSBASE:S/${TARGETDIR}\///}|' >> ${PLIST} +.if defined(WITH_EXAMPLES) + @ ${FIND} ${WRKSRC}/etc ! -type d | \ + ${SED} 's|${WRKSRC}/etc|%%EXAMPLESDIR%%|' >> ${PLIST} + @ ${ECHO} %%EXAMPLESDIR%%/create_sampledb.sh >> ${PLIST} + @ ${FIND} ${WRKSRC}/etc -type d | \ + ${SED} 's|${WRKSRC}/etc|@dirrm %%EXAMPLESDIR%%|' | \ + ${SORT} -r >> ${PLIST} +.endif do-install: - @${MKDIR} ${EXAMPLESDIR} - @${MKDIR} ${OPENACSBASE} - @${MKDIR} ${VIRTUALBASE} - - @${ECHO_CMD} "Installing files" - @${CP} -R ${WRKSRC} ${OPENACSBASE}/${OPENACS_USER} - - @${TEST} -e ${VIRTUALBASE}/aolserver || ${LN} -s ${OPENACSBASE} ${VIRTUALBASE}/aolserver - @${TEST} -L ${VIRTUALBASE}/aolserver || ${ECHO_MSG} "${VIRTUALBASE}/aolserver is no symbolic link" - - @${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/nsd-postgres.txt ${EXAMPLESDIR}/nsd-postgres - @${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/nsd-oracle.txt ${EXAMPLESDIR}/nsd-oracle - @${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/restart-aolserver.txt ${EXAMPLESDIR}/restart-aolserver - @${INSTALL_SCRIPT} ${FILESDIR}/svscan.sh ${EXAMPLESDIR}/svscan.sh - @${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/svgroup.txt ${EXAMPLESDIR}/svgroup - @${INSTALL_SCRIPT} ${WRKDIR}/post-config ${EXAMPLESDIR}/post-config.sh - -post-install: - @${REINPLACE_CMD} "\ - s|/usr/local/aolserver|${AOLSERVERBASE}|g; \ - s|/bin/bash|/bin/sh|g; \ - " ${EXAMPLESDIR}/nsd-postgres ${EXAMPLESDIR}/nsd-oracle - @${REINPLACE_CMD} "\ - s|service0|${OPENACS_USER}|g; \ - s|\[ns_info address\]|${IP_ADDRESS}|g; \ - s|/var/lib/aolserver|${OPENACSBASE}|g; \ - s|/usr/local/aolserver|${AOLSERVERBASE}|g; \ - " ${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl - @${REINPLACE_CMD} "\ - s|service0|${OPENACS_USER}|g; \ - s|/usr/local/aolserver/bin|${EXAMPLESDIR}|g; \ - " ${OPENACSBASE}/${OPENACS_USER}/etc/daemontools/run - - @${ECHO_CMD} "@unexec rm -f ${DATADIR}/log/${OPENACS_USER}* 2>&1 > /dev/null || true" >> ${TMPPLIST} - @${ECHO_CMD} "@unexec rm -f ${DATADIR}/log/error.log* 2>&1 > /dev/null || true" >> ${TMPPLIST} - @${ECHO_CMD} "@unexec rm -Rf ${DATADIR}/apm-workspace 2>&1 > /dev/null || true" >> ${TMPPLIST} - @${ECHO_CMD} "@unexec rm -Rf ${DATADIR}/etc/daemontools/supervise 2>&1 > /dev/null || true" >> ${TMPPLIST} - @${FIND} -s ${WRKSRC} -not -type d \ - | ${SED} -ne 's,^${WRKSRC},${DATADIR:S,^${PREFIX}/,,},p' >> ${TMPPLIST} - @${FIND} -s -d ${WRKSRC} -type d \ - | ${SED} -ne 's,^${WRKSRC},@dirrm ${DATADIR:S,^${PREFIX}/,,},p' >> ${TMPPLIST} - @${ECHO_CMD} "@dirrm ${EXAMPLESDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} - - @if [ ${DT} ] ; then \ - ${MKDIR} ${DTSERVICEBASE} ; \ - ${TEST} -L ${DTSERVICEBASE}/${OPENACS_USER} || ${LN} -s ${OPENACSBASE}/${OPENACS_USER}/etc/daemontools ${DTSERVICEBASE}/${OPENACS_USER} ; \ - ${ECHO_CMD} "@cd ${DTSERVICEBASE}" >> ${TMPPLIST} ; \ - ${ECHO_CMD} "${OPENACS_USER}" >> ${TMPPLIST} ; \ - ${ECHO_CMD} "@unexec rmdir ${DTSERVICEBASE} 2>&1 > /dev/null || true" >> ${TMPPLIST} ; \ - fi - + @ ${ECHO} "Installing base files" + @ ${MKDIR} ${OPENACSBASE}/etc + @ ${TAR} -c -C ${WRKSRC} -f - ${BASE_INSTALL} | \ + ${TAR} -x -C ${OPENACSBASE} -f - +.if defined(WITH_EXAMPLES) + @ ${ECHO} "Installing examples" + @ ${MKDIR} ${EXAMPLESDIR} + @ ${TAR} -c -C ${WRKSRC}/etc -f - . | ${TAR} -x -C ${EXAMPLESDIR} -f - + @ ${INSTALL_SCRIPT} ${WRKDIR}/create_sampledb.sh ${EXAMPLESDIR} +.endif + @ ${ECHO} "Installing sample configuration file" + @ ${INSTALL_DATA} ${WRKDIR}/openacs-config.tcl ${OPENACSBASE}/etc/${PORTNAME}-config.tcl +.if !defined(NOPORTDOCS) + @ ${ECHO} "Installing docs" + @ ${MKDIR} ${DOCSDIR} +.for FILE in ${PORTDOCS} + @ ${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR} +.endfor +.endif @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/www/openacs/distinfo b/www/openacs/distinfo index b814bde7960..f821027052d 100644 --- a/www/openacs/distinfo +++ b/www/openacs/distinfo @@ -1,3 +1,3 @@ -MD5 (openacs-5.1.5.tar.gz) = a86843cb5aaf62d7e1c54b0e69238079 -SHA256 (openacs-5.1.5.tar.gz) = 4bce2472ef30619911370428a828e1d192627dce745968cb8eb3c6b51102d85b -SIZE (openacs-5.1.5.tar.gz) = 5740656 +MD5 (openacs-5.3.0.tgz?revision_id=583060) = acad5851db90dfdc5319182b1c367cde +SHA256 (openacs-5.3.0.tgz?revision_id=583060) = ac99907db0aafb9748e9dbd598a62cb80cf7cfedbf30a0e5b52b9619e83a85c5 +SIZE (openacs-5.3.0.tgz?revision_id=583060) = 7667672 diff --git a/www/openacs/files/create_sampledb.sh.in b/www/openacs/files/create_sampledb.sh.in new file mode 100644 index 00000000000..6321527d5be --- /dev/null +++ b/www/openacs/files/create_sampledb.sh.in @@ -0,0 +1,45 @@ +#!/bin/sh +# $FreeBSD$ +# +# This script prepares a sample PostgreSQL database +# for use by OpenACS +# +PGUSER=%%PGUSER%% +OPENACS_USER=%%OPENACS_USER%% +OPENACS_DB=%%OPENACS_DB%% +LOCALBASE=%%LOCALBASE%% +# +PGREP=/usr/bin/pgrep +SU=/usr/bin/su +AWK=/usr/bin/awk + +CREATEUSERFLAGS="-A -d" + +# Check if PostgreSQL version is >= 8.1.0 +${LOCALBASE}/bin/postmaster -V | ${AWK} -F '[ .]' '{if ($3=8 && $4>=1) {exit 0} else {exit 1}}' && { +POSTGRESQL81=YES +CREATEUSERFLAGS="-S -R -d" +} + +${PGREP} -U ${PGUSER} postgres > /dev/null || { + echo "You need PostgreSQL server installed and running." + echo "After a fresh install, you need to initialize the database with:" + echo "su - ${PGUSER} -c initdb" + echo "Exiting ..." + exit 1 +} +echo "Creating PostgreSQL user ${OPENACS_USER} ..." +${SU} -l ${PGUSER} -c "${LOCALBASE}/bin/createuser ${CREATEUSERFLAGS} ${OPENACS_USER}" +echo "Creating PostgreSQL database ${OPENACS_DB} ..." +${SU} -l ${OPENACS_USER} -c "${LOCALBASE}/bin/createdb -E UNICODE ${OPENACS_DB}" +echo "Registering language plpgsql for database ${OPENACS_DB} ..." +${SU} -l ${PGUSER} -c "${LOCALBASE}/bin/createlang plpgsql ${OPENACS_DB}" +[ "x${POSTGRESQL81}" = "xYES" ] && { +echo "" +echo "**************************** NOTICE ****************************" +echo "You have PostgreSQL 8.1 or greater installed." +echo "Your may need to alter your PostgreSQL configuration." +echo "Please read the instructions under the following URL:" +echo "http://openacs.org/xowiki/en/How_to_install_in_Postgres_8.1.x" +echo "****************************************************************" +} diff --git a/www/openacs/files/dotlrn.in b/www/openacs/files/dotlrn.in new file mode 100644 index 00000000000..abc7139dc95 --- /dev/null +++ b/www/openacs/files/dotlrn.in @@ -0,0 +1,46 @@ +#! /bin/sh +# +# +# PROVIDE: dotlrn +# REQUIRE: DAEMON NETWORKING SERVERS +# +# Add the following line to /etc/rc.conf to enable dotlrn: +# +# dotlrn_enable="YES" +# +# Tweakable parameters for users to override in rc.conf + +. "%%RC_SUBR%%" + +name=dotlrn + +load_rc_config ${name} +: ${dotlrn_enable="NO"} +: ${dotlrn_user="%%OPENACS_USER%%"} +: ${dotlrn_group="%%OPENACS_GROUP%%"} +: ${dotlrn_conf=%%OPENACSBASE%%/etc/dotlrn-config.tcl} +: ${dotlrn_flags="-u ${dotlrn_user} -g ${dotlrn_group}"} +: ${dotlrn_prog=%%AOLSERVERBASE%%/bin/nsd} +: ${dotlrn_pidfile=/var/run/dotlrn.pid} + +rcvar=`set_rcvar` +pidfile=${dotlrn_pidfile} +start_postcmd="start_postcmd" +stop_postcmd="stop_postcmd" +required_files=${dotlrn_conf} +command=%%AOLSERVERBASE%%/bin/nsd +command_args="-t ${dotlrn_conf}" +procname=${dotlrn_prog} + +start_postcmd() +{ + PID=`pgrep -U ${dotlrn_user} -f ${dotlrn_conf}` + [ -n "${PID}" ] && echo ${PID} > ${pidfile} +} + +stop_postcmd() +{ + [ -f "${pidfile}" ] && rm ${pidfile} +} + +run_rc_command "$1" diff --git a/www/openacs/files/openacs.in b/www/openacs/files/openacs.in new file mode 100644 index 00000000000..55255ed9f0b --- /dev/null +++ b/www/openacs/files/openacs.in @@ -0,0 +1,46 @@ +#! /bin/sh +# +# +# PROVIDE: openacs +# REQUIRE: DAEMON NETWORKING SERVERS +# +# Add the following line to /etc/rc.conf to enable openacs: +# +# openacs_enable="YES" +# +# Tweakable parameters for users to override in rc.conf + +. "%%RC_SUBR%%" + +name=openacs + +load_rc_config ${name} +: ${openacs_enable="NO"} +: ${openacs_user="%%OPENACS_USER%%"} +: ${openacs_group="%%OPENACS_GROUP%%"} +: ${openacs_conf=%%OPENACSBASE%%/etc/openacs-config.tcl} +: ${openacs_flags="-u ${openacs_user} -g ${openacs_group}"} +: ${openacs_prog=%%AOLSERVERBASE%%/bin/nsd} +: ${openacs_pidfile=/var/run/openacs.pid} + +rcvar=`set_rcvar` +pidfile=${openacs_pidfile} +start_postcmd="start_postcmd" +stop_postcmd="stop_postcmd" +required_files=${openacs_conf} +command=%%AOLSERVERBASE%%/bin/nsd +command_args="-t ${openacs_conf}" +procname=${openacs_prog} + +start_postcmd() +{ + PID=`pgrep -U ${openacs_user} -f ${openacs_conf}` + [ -n "${PID}" ] && echo ${PID} > ${pidfile} +} + +stop_postcmd() +{ + [ -f "${pidfile}" ] && rm ${pidfile} +} + +run_rc_command "$1" diff --git a/www/openacs/files/pkg-deinstall.in b/www/openacs/files/pkg-deinstall.in index cbc6efe0bf0..f7fd9c5ca14 100644 --- a/www/openacs/files/pkg-deinstall.in +++ b/www/openacs/files/pkg-deinstall.in @@ -1,24 +1,21 @@ #! /bin/sh +# $FreeBSD$ -PATH=$PATH:/bin:/usr/bin:/usr/sbin +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi -case $2 in - -POST-DEINSTALL) - echo "You are deinstalling this port:" - echo " Remember to kill the associated Aolserver process in case" - echo " you've changed the standard." - echo " We will try to kill the standard now:" - pid=`ps -ax | grep %%OPENACS_USER%%/etc/config.tcl | grep -v grep| awk -F' ' '{print $1}'`; - if test "$pid" = "" ; then - echo " No %%OPENACS_USER%% process found." - else - echo " Killing %%OPENACS_USER%% proces. pid: $pid . " - kill $pid - fi - echo " If no other openACS/.LRN instance needs it, you may want to " - echo " delete %%VIRTUALBASE%%/aolserver and %%VIRTUALBASE%% manually, " - echo " and possibly the %%OPENACS_USER%% users and database. " - ;; -esac +OPENACS_USER=%%OPENACS_USER%% +OPENACS_GROUP=%%OPENACS_GROUP%% +OPENACSBASE=%%OPENACSBASE%% +if pw usershow "${OPENACS_USER}" 2>/dev/null 1>&2; then + echo "To delete ${OPENACS_USER} user permanently, use 'pw userdel \"${OPENACS_USER}\"'" +fi +if pw usershow "${OPENACS_GROUP}" 2>/dev/null 1>&2; then + echo "To delete ${OPENACS_GROUP} group permanently, use 'pw groupdel \"${OPENACS_GROUP}\"'" +fi +if test -d "${OPENACSBASE}"; then + echo "You may need to remove ${OPENACSBASE} manually." +fi +exit 0 diff --git a/www/openacs/files/pkg-install.in b/www/openacs/files/pkg-install.in index b95756f5a5b..30b08847943 100644 --- a/www/openacs/files/pkg-install.in +++ b/www/openacs/files/pkg-install.in @@ -1,107 +1,34 @@ #! /bin/sh +# $FreeBSD$ -PATH=/bin:/usr/sbin:/usr/bin -LOCALBASE=%%LOCALBASE%% -EXAMPLESDIR=%%EXAMPLESDIR%% -RCCONF=%%RCCONF%% -OPENACSBASE=%%OPENACSBASE%% -OPENACS_GROUP=%%OPENACS_GROUP%% -OPENACS_USER=%%OPENACS_USER%% -DB=%%DB%% -DT=%%DT%% -PGDATA=%%PGDATA%% -PG_USER=%%PG_USER%% -PGBASE=%%PGBASE%% -DTSERVICEBASE=%%DTSERVICEBASE%% -AOLSERVERBASE=%%AOLSERVERBASE%% -VIRTUALBASE=%%VIRTUALBASE%% -POSTCONFIG=%%POSTCONFIG%% - -pre-install() { echo " - - First, make sure that you either have - lang/tcl84-thread or no tcl84 installed - - =========== BACKUP YOUR DATA! ============= - As always, backup your data before - upgrading. This is *NOT* done by the port! - - IMPORTANT: You may loose data by an upgrade. - Press ctrl-C *NOW* if you need to - BACKUP YOUR DATA, - for example a pg_dump or custom openacs files. - - ========= FOR UPGRADE SEE: =============== - http://openacs.org/doc/current/upgrade.html - =========================================== - - To allow post-install configurations, use: - make install WITH_POSTCONFIG=yes - - Or after installation has completed, do: - sh ${EXAMPLESDIR}/post-config.sh XX POST-INSTALL - - Advice: - stop a running Aolserver and/or Postgresql - before post-install configuration starts. - - Press ctrl-C *NOW* if you need to. - =========================================== -" - -sleep 10 - -if [ -d ${OPENACSBASE}/${OPENACS_USER} ] ; then - echo "WARNING: ${OPENACSBASE}/${OPENACS_USER} already exists !" - echo "It may be a valid tree or the result of an aborted previous install" - echo "TO CONTINUE: Move it, Delete it or do:" - echo " make install OPENACS_USER=ChooseName < WITH_POSTCONFIG=yes >" - echo " " - exit 1 ; fi - -if pw group show ${OPENACS_GROUP} >/dev/null 2>&1; then - echo "You already have a group \"${OPENACS_GROUP}\", so I will use it." -else - pw groupadd -n ${OPENACS_GROUP} -fi - -if pw user show ${OPENACS_USER} >/dev/null 2>&1; then - echo "You already have a user \"${OPENACS_USER}\", so I will use it." -else - pw useradd -n ${OPENACS_USER} -G ${OPENACS_GROUP} -c "OpenACS instance pseudo-user" \ - -h - +if [ "$2" != "POST-INSTALL" ]; then + exit 0 fi -} +OPENACS_GROUP=%%OPENACS_GROUP%% +OPENACS_USER=%%OPENACS_USER%% +OPENACSBASE=%%OPENACSBASE%% -post-install() { - echo "Set permissions of files" - chmod -R 770 ${OPENACSBASE}/${OPENACS_USER} - chmod -R 770 ${EXAMPLESDIR} -if [ ${DT} ] ; then \ - chmod -R 755 ${DTSERVICEBASE}/${OPENACS_USER} ; \ - chmod 1755 ${DTSERVICEBASE} ; \ +if ! pw groupshow "${OPENACS_GROUP}" 2>/dev/null 1>&2; then + if pw groupadd ${OPENACS_GROUP}; then + echo "Added group \"${OPENACS_GROUP}\"." + else + echo "Adding group \"${OPENACS_GROUP}\" failed..." + exit 1 + fi fi - chown -R ${OPENACS_USER}:${OPENACS_GROUP} ${OPENACSBASE}/${OPENACS_USER} - chown root:${OPENACS_GROUP} ${EXAMPLESDIR}/nsd-postgres ${EXAMPLESDIR}/nsd-oracle -if test "${POSTCONFIG}" = "true" ; then - echo "Performing post-config changes" - sh ${EXAMPLESDIR}/post-config.sh XX POST-INSTALL -else - echo "No post-config changes performed" - echo "Run sh ${EXAMPLESDIR}/post-config.sh XX POST-INSTALL later" +if ! pw usershow "${OPENACS_USER}" 2>/dev/null 1>&2; then + if pw useradd ${OPENACS_USER} -g ${OPENACS_GROUP} -h - \ + -s "/bin/sh" -d "${OPENACSBASE}" \ + -c "OpenACS instance pseudo-user"; \ + then + echo "Added user \"${OPENACS_USER}\"." + else + echo "Adding user \"${OPENACS_USER}\" failed..." + exit 1 + fi fi - -} - -case $2 in - -PRE-INSTALL) - pre-install - ;; -POST-INSTALL) - post-install - ;; -esac - + echo "Seting permissions of files" + chmod -R 770 ${OPENACSBASE} + chown -R ${OPENACS_USER}:${OPENACS_GROUP} ${OPENACSBASE} diff --git a/www/openacs/files/pkg-message.in b/www/openacs/files/pkg-message.in index 7d8a52eba86..c1d0dfd8e1f 100644 --- a/www/openacs/files/pkg-message.in +++ b/www/openacs/files/pkg-message.in @@ -1,62 +1,23 @@ - ******** READ THIS ******* +Congratulations! You have just installed %%OPENACSNAME%% -Congratulations! You have just installed OpenACS/.LRN +To create a sample default database run the script: +%%EXAMPLESDIR%%/create_sampledb.sh -If you didn't do make install WITH_POSTCONFIG=yes, -inspect post-config.sh now and/or run: -sh %%EXAMPLESDIR%%/post-config.sh XX POST-INSTALL -If you can, stop Aolserver and Postgresql first -(killall -9 nsd ; %%PREFIX%%/etc/rc.d/010.pgsql.sh stop) -before post-install configuration starts. +You can start %%OPENACSNAME%% with the startup script: +%%LOCALBASE%%/etc/rc.d/%%PORTNAME%% -Then use your browser to view the welcome page (http://<your-ip>:8000) -and follow the instructions. (Find out your IP address by typing -"ifconfig" at the command line) - -If you want daemontools to restart aolserver, remember to: -Copy the example svscan.sh from %%EXAMPLESDIR%% -to %%LOCALBASE%%/etc/rc.d/svscan.sh -Make a copy of the original file first, if you like. -Then REBOOT (shutdown -r now)! - -Once the datamodel has been installed and aolserver restarts -it can take a few MINUTES before the server becomes available. -Be patient! - -Errors, if any, are in: -%%VIRTUALBASE%%/aolserver/%%OPENACS_USER%%/log/error.log +If you are using another AOLserver on the default port 8000, +please change the port number in the configuration file. +Default config: %%OPENACSBASE%%/etc/%%PORTNAME%%-config.tcl -Go to the docs at http://openacs.org/doc/ to find out more. -There are a few things different from the docs (!): For example, the -postgres user is pgsql not postgres, daemontools are in %%DTSERVICEBASE%%, -openACS/.LRN is in %%LOCALBASE%%/share/ (with symlink in %%VIRTUALBASE%%), -nsd-postgres and some other files are in %%EXAMPLESDIR%%, but everything -should work just fine. - -To view your pages at port 80 you will have to change: -%%RCCONF%%, daemontools/run and config.tcl in -%%VIRTUALBASE%%/aolserver/%%OPENACS_USER%%/etc. +Then use your browser to view the welcome page (http://<your-ip>:<port>) +- default port is 8000 and follow the instructions. -If you install .LRN as well as openACS the IP address in config.tcl -should be different or you should shut one down (svc -d %%DTSERVICEBASE%%/...) -before starting the other. Aolserver cannot listen on the same ip-address -twice! - -If you want to remove openacs, type "make deinstall" or use pkg_delete -(pkg_info). -However, users and database are not removed. - -We use bash as shell in openACS. We didn't change the shells of -current users like root and pgsql, yet. If you want, do: -chsh -s %%LOCALBASE%%/bin/bash USERNAME -and change its profile by copying the openACS entries from -/usr/share/skel/dot.profile to ~/.profile. -Then login/out or type ". .profile". - -Remember: THIS MESSAGE is in PORTSDIR/www/openacs/ -files/pkg-message.in or work/pkg-message +Errors, if any, are in: +%%OPENACSBASE%%/log/error.log --Aldert -aldert@nooitgedagt.net +If you want to use keepalive via cron, you might want to look here: +%%EXAMPLESDIR%%/keepalive/ - ******** READ THE INFORMATION ABOVE ******** +-Martin Matuska +martin@matuska.org diff --git a/www/openacs/files/post-config.in b/www/openacs/files/post-config.in deleted file mode 100644 index 2ae81117aab..00000000000 --- a/www/openacs/files/post-config.in +++ /dev/null @@ -1,124 +0,0 @@ -#! /bin/sh - -PATH=/bin:/usr/sbin:/usr/bin -LOCALBASE=%%LOCALBASE%% -EXAMPLESDIR=%%EXAMPLESDIR%% -RCCONF=%%RCCONF%% -OPENACSBASE=%%OPENACSBASE%% -OPENACS_GROUP=%%OPENACS_GROUP%% -OPENACS_USER=%%OPENACS_USER%% -DB=%%DB%% -PGDATA=%%PGDATA%% -PG_USER=%%PG_USER%% -PGBASE=%%PGBASE%% -DTSERVICEBASE=%%DTSERVICEBASE%% -AOLSERVERBASE=%%AOLSERVERBASE%% -VIRTUALBASE=%%VIRTUALBASE%% - -post-install() { - echo "Starting post-config changes on your request" - -for DIRS in /usr/share/skel/dot -do -if egrep 'OPENACS-entries in .profile' ${DIRS}.profile >/dev/null 2>&1; then - echo "Notice: there are OPENACS-entries in .profile (skeleton)" -else - echo "Notice: adding OPENACS-entries to ${DIRS}.profile" && \ - echo "# OPENACS-entries in .profile:" >> ${DIRS}.profile && \ - echo "export PATH=\$$PATH:${PGBASE}/bin" >> ${DIRS}.profile && \ - echo "export PGDATA=${PGDATA}" >> ${DIRS}.profile && \ - echo "export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:${PGBASE}/lib" >> ${DIRS}.profile && \ - echo "export PS1=\"<\u-\W>\"" >> ${DIRS}.profile && \ - echo "export PS2=\"continu>\"" >> ${DIRS}.profile && \ - echo "export CVSROOT=/cvsroot" >> ${DIRS}.profile && \ - echo "export EDITOR=emacs" >> ${DIRS}.profile && \ - echo "# end of OPENACS-entries." >> ${DIRS}.profile -fi -done - -if egrep 'OPENACS-entries in rc.conf' ${RCCONF} >/dev/null 2>&1; then - echo "Notice: there are OPENACS-entries in ${RCCONF}" -else - echo "Notice: adding OPENACS-entries to ${RCCONF}" && \ - echo "# OPENACS-entries in rc.conf:" >> ${RCCONF} && \ - echo "ldconfig_paths=\"/usr/lib/compat /usr/X11R6/lib ${LOCALBASE}/lib ${PGBASE}/lib ${AOLSERVERBASE}/lib\" " >> ${RCCONF} && \ - echo "postgresql_enable=\"YES\"" >> ${RCCONF} && \ - echo "postgresql_data=\"${PGDATA}\"" >> ${RCCONF} && \ - echo "postgresql_flags=\" -l ${PGDATA}/server.log\"" >> ${RCCONF} && \ - echo "aolserver_enable=\"YES\"" >> ${RCCONF} && \ - echo "aolserver_conf=\"${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl\"" >> ${RCCONF} && \ - echo "aolserver_flags=\"-u ${OPENACS_USER} -g ${OPENACS_GROUP} -b 0.0.0.0:8000\"" >> ${RCCONF} && \ - echo "aolserver_prog=\"${EXAMPLESDIR}/nsd-postgres\"" >> ${RCCONF} && \ - echo "# end of OPENACS-entries." >> ${RCCONF} -fi - - echo "adding root and ${PG_USER} to group ${OPENACS_GROUP}" - pw usermod ${PG_USER} -G ${OPENACS_GROUP} - pw usermod root -G ${OPENACS_GROUP} - - echo "Set permissions of files (post-config)" - chown -R :${OPENACS_GROUP} ${AOLSERVERBASE} - -if [ "${DB}" = "PG" ]; then - echo "Postgresql database is being configured." - if [ ! -d ${PGDATA} ]; then - su -l ${PG_USER} -c "${LOCALBASE}/bin/initdb -D ${PGDATA}"; - fi - if [ -e ${PGDATA}/postmaster.pid ]; then - echo "Postgres is running. We don't want to stop it, because we don't know why you have it running." - pid0=`ps -ax | grep ${PGDATA}/server.log | grep -v grep| awk -F' ' '{print $1}'`; - if test "$pid0" != "" ; then - echo "Since ${PGDATA}/server.log seems active you may be fine." - fi - echo "If you run into trouble: please stop Postgresql and Aolserver en restart them respectively, after this installation has completed." - else - echo "Start Postgresql" - su -l ${PG_USER} -c "${LOCALBASE}/bin/pg_ctl -D ${PGDATA} -l ${PGDATA}/server.log start" - fi - sleep 5 - su -l ${PG_USER} -c "${LOCALBASE}/bin/createlang plpgsql template1" > /dev/null 2>&1 - su -l ${PG_USER} -c "${LOCALBASE}/bin/createlang -l template1" > /dev/null 2>&1 - su -l ${PG_USER} -c "${LOCALBASE}/bin/createuser -A -d ${OPENACS_USER}" > /dev/null 2>&1 - su -l ${OPENACS_USER} -c "${LOCALBASE}/bin/createdb -E UNICODE ${OPENACS_USER}" > /dev/null 2>&1 - sleep 5 - echo "Checking Aolserver before (re)start. Is it running?" - pid1=`ps -ax | grep sample-config | grep -v grep| awk -F' ' '{print $1}'`; - if test "$pid1" = "" ; then - : - else - echo "Killing sample-config process. pid: $pid1 ." - kill $pid1 - fi - pid2=`ps -ax | grep ${OPENACS_USER}/etc/config.tcl | grep -v grep| awk -F' ' '{print $1}'`; - if test "$pid2" = "" ; then - : - else - echo "Killing ${OPENACS_USER} config.tcl process. pid: $pid2 ." - kill $pid2 - fi - - pid3=`ps -ax | grep nsd | grep -v grep| awk -F' ' '{print $1}'`; - if test "$pid3" = "" ; then - echo "Good. No running Aolserver process."; - else - echo "Warning: at least still one Aolserver process is running..." - echo "We will start Aolserver now, but it may not be able to listen on the same address:port" - echo "FYI: killall -9 nsd will stop all processes or change the IP-address in config.tcl, then start again." - fi - echo "Starting aolserver: ${EXAMPLESDIR}/nsd-postgres -t ${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl -u ${OPENACS_USER} -g ${OPENACS_GROUP}" - ${EXAMPLESDIR}/nsd-postgres -t ${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl -u ${OPENACS_USER} -g ${OPENACS_GROUP} - sleep 10 -fi - -} - -case $2 in - -POST-INSTALL) - post-install - ;; -esac - -# ${EXAMPLESDIR}/svgroup ${OPENACS_GROUP} ${DTSERVICEBASE}/${OPENACS_USER} -# KEEP ALIVE with DAEMONTOOLS + OPTION: see http://openacs.org/forums/message-view?message_id=291164 -# AOLSERVER RESTART SCRIPT: see http://openacs.org/doc/current/maintenance-web.html diff --git a/www/openacs/files/svscan.sh b/www/openacs/files/svscan.sh deleted file mode 100644 index f52db48fc7d..00000000000 --- a/www/openacs/files/svscan.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -# It would really, really be a Good Thing(tm) -# for you to enable some of the below -# control variables and the apropriate ulimit. -# These are only examples. -# Furthermore, you should think about additional -# limits you might need. -# Or, check login.conf(5) for a suitable -# alternative -# -# I really do suggest you use /var/service/ as your -# service spool directory. Check hier(7) for -# reasons. - -# 10 Mb -MINSEGMENT=10240 -# 20 Mb -#MAXSEGMENT=20480 -# 10 Mb -MAXFILESIZE=10240 -# 100 -MAXFD=100 -# 40 -MAXCHILD=40 - -# ulimits -#ulimit -d ${MINSEGMENT} -#ulimit -f ${MAXFILESIZE} -#ulimit -m ${MAXSEGMENT} -#ulimit -n ${MAXFD} -#ulimit -s ${MINSEGMENT} -#ulimit -u ${MAXCHILD} - -KILLALL=/usr/bin/killall -SVC=${PREFIX}/bin/svc -SVPROC=svscan -SVSCAN=$PREFIX/bin/svscan -READPROCTITLE=$PREFIX/bin/readproctitle -SVDIR=/var/service/ - -case "$1" in - start) - echo -n " svscan" - exec env PATH=$PREFIX/sbin:$PREFIX/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH /bin/csh -cf "$SVSCAN $SVDIR |& $READPROCTITLE service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &" > /dev/null - ;; - - stop) - echo -n " svscan: " - $KILLALL $SVPROC - $SVC -dx $SVDIR/* $SVDIR/*/log - ;; - - *) - echo "Usage: $0 start | stop" - ;; -esac diff --git a/www/openacs/pkg-descr b/www/openacs/pkg-descr index b8dd7483b36..1f9d85385b8 100644 --- a/www/openacs/pkg-descr +++ b/www/openacs/pkg-descr @@ -15,3 +15,6 @@ WWW: http://openacs.org - Aldert aldert@nooitgedagt.net + +- Martin Matuska +martin@matuska.org |