2005-08-01 13:16:47 +00:00
|
|
|
# New ports collection makefile for: openACS
|
|
|
|
# Date created: July 2005
|
|
|
|
# Whom: Aldert Nooitgedagt <aldert@nooitgedagt.net>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME?= openacs
|
|
|
|
PORTVERSION?= 5.1.5
|
2005-10-08 12:53:26 +00:00
|
|
|
PORTREVISION?= 2
|
2005-08-01 13:16:47 +00:00
|
|
|
CATEGORIES= www
|
|
|
|
MASTER_SITES?= http://openacs.org/projects/openacs/download/download/
|
|
|
|
|
|
|
|
MAINTAINER?= aldert@nooitgedagt.net
|
|
|
|
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
|
|
|
|
PKGINSTALL= ${WRKDIR}/pkg-install
|
|
|
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
|
|
|
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
|
|
|
|
.if defined(WITH_POSTCONFIG)
|
2005-09-09 04:44:38 +00:00
|
|
|
POSTCONFIG= true
|
2005-10-02 20:36:38 +00:00
|
|
|
PKGNAMESUFFIX= -withconfig
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_DT)
|
|
|
|
DT= true
|
|
|
|
RUN_DEPENDS+= ${LOCALBASE}/bin/supervise:${PORTSDIR}/sysutils/daemontools
|
2005-08-01 13:16:47 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
SUB_FILES= pkg-install pkg-message pkg-deinstall post-config
|
2005-09-09 04:44:38 +00:00
|
|
|
SUB_LIST+= RCCONF=${RCCONF} POSTCONFIG=${POSTCONFIG} \
|
2005-08-01 13:16:47 +00:00
|
|
|
OPENACSBASE=${OPENACSBASE} OPENACS_GROUP=${OPENACS_GROUP} \
|
|
|
|
OPENACS_USER=${OPENACS_USER} DB=${DB} PGDATA=${PGDATA} \
|
|
|
|
PG_USER=${PG_USER} PGBASE=${PGBASE} \
|
2005-10-02 20:36:38 +00:00
|
|
|
DTSERVICEBASE=${DTSERVICEBASE} DT=${DT} \
|
2005-08-01 13:16:47 +00:00
|
|
|
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 \
|
2005-10-02 20:36:38 +00:00
|
|
|
${LOCALBASE}/tclwebtest-1.0/tclwebtest:${PORTSDIR}/www/tclwebtest
|
|
|
|
|
2005-08-01 13:16:47 +00:00
|
|
|
USE_LINUX= YES
|
|
|
|
|
|
|
|
NO_BUILD= YES
|
|
|
|
|
|
|
|
USE_REINPLACE= YES
|
|
|
|
REINPLACE_ARGS= -i "" -e
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
pre-install:
|
|
|
|
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
|
|
|
|
|
|
|
|
do-install:
|
|
|
|
@${MKDIR} ${EXAMPLESDIR}
|
|
|
|
@${MKDIR} ${OPENACSBASE}
|
|
|
|
@${MKDIR} ${VIRTUALBASE}
|
|
|
|
|
|
|
|
@${ECHO_CMD} "Installing files"
|
2005-09-09 04:44:38 +00:00
|
|
|
@${CP} -R ${WRKSRC} ${OPENACSBASE}/${OPENACS_USER}
|
2005-08-01 13:16:47 +00:00
|
|
|
|
|
|
|
@${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}
|
2005-10-02 20:36:38 +00:00
|
|
|
@${ECHO_CMD} "@unexec rm -f ${DATADIR}/log/error.log* 2>&1 > /dev/null || true" >> ${TMPPLIST}
|
2005-08-01 13:16:47 +00:00
|
|
|
@${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}
|
2005-10-02 20:36:38 +00:00
|
|
|
|
2005-10-08 12:53:26 +00:00
|
|
|
@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} ; \
|
2005-10-02 20:36:38 +00:00
|
|
|
fi
|
2005-08-01 13:16:47 +00:00
|
|
|
|
|
|
|
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
|
|
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|