Lines 6-142
Link Here
|
6 |
# |
6 |
# |
7 |
|
7 |
|
8 |
PORTNAME?= openacs |
8 |
PORTNAME?= openacs |
9 |
PORTVERSION?= 5.1.5 |
9 |
PORTVERSION?= 5.3.0 |
10 |
PORTREVISION?= 2 |
|
|
11 |
CATEGORIES= www |
10 |
CATEGORIES= www |
12 |
MASTER_SITES?= http://openacs.org/projects/openacs/download/download/ |
11 |
MASTER_SITES?= http://openacs.org/projects/openacs/download/download/ |
|
|
12 |
EXTRACT_SUFX?= .tgz?revision_id=583060 |
13 |
|
13 |
|
14 |
MAINTAINER?= aldert@nooitgedagt.net |
14 |
MAINTAINER?= martin@matuska.org |
15 |
COMMENT?= A modular web application platform for high traffic communities |
15 |
COMMENT?= A modular web application platform for high traffic communities |
16 |
|
16 |
|
17 |
OPENACS_USER?= service0 |
17 |
AOLSERVERBASE?= ${LOCALBASE}/aolserver |
18 |
OPENACS_GROUP= web |
18 |
RUN_DEPENDS= ${AOLSERVERBASE}/bin/nscache.so:${PORTSDIR}/www/aolserver-nscache \ |
19 |
PG_USER= pgsql |
19 |
${AOLSERVERBASE}/bin/nsopenssl.so:${PORTSDIR}/security/aolserver-nsopenssl \ |
20 |
|
20 |
${AOLSERVERBASE}/bin/nssha1.so:${PORTSDIR}/security/aolserver-nssha1 \ |
21 |
DATADIR= ${PREFIX}/share/${OPENACS_USER} |
21 |
${AOLSERVERBASE}/bin/nspostgres.so:${PORTSDIR}/databases/aolserver-nspostgres \ |
22 |
EXAMPLESDIR= ${PREFIX}/share/examples/${OPENACS_USER} |
22 |
${LOCALBASE}/lib/tdomConfig.sh:${PORTSDIR}/www/tdom |
23 |
OPENACSBASE= ${PREFIX}/share |
23 |
|
24 |
VIRTUALBASE= /var/lib |
24 |
USE_RC_SUBR?= ${PORTNAME} |
25 |
AOLSERVERBASE= ${LOCALBASE}/aolserver |
25 |
NO_BUILD= yes |
26 |
DTSERVICEBASE= /var/service |
26 |
|
27 |
RCCONF= /etc/rc.conf |
27 |
OPENACS_USER?= ${PORTNAME} |
|
|
28 |
OPENACS_DB?= ${PORTNAME} |
29 |
OPENACS_GROUP?= www |
30 |
PGUSER?= pgsql |
31 |
OPENACSBASE?= ${TARGETDIR}/openacs |
32 |
OPENACSNAME?= OpenACS |
33 |
|
34 |
BASE_INSTALL?= bin content-repository-content-files log packages tcl www |
35 |
PLIST= ${WRKDIR}/plist.tmp |
36 |
SUB_LIST+= OPENACS_USER=${OPENACS_USER} OPENACS_GROUP=${OPENACS_GROUP} \ |
37 |
OPENACSBASE=${OPENACSBASE} OPENACS_DB=${OPENACS_DB} \ |
38 |
PGUSER=${PGUSER} AOLSERVERBASE=${AOLSERVERBASE} \ |
39 |
PORTNAME=${PORTNAME} OPENACSNAME=${OPENACSNAME} |
28 |
|
40 |
|
29 |
IP_ADDRESS= 0.0.0.0 |
41 |
SUB_FILES+= pkg-install pkg-deinstall pkg-message openacs dotlrn create_sampledb.sh |
30 |
|
|
|
31 |
USE_RC_SUBR= YES |
32 |
PKGINSTALL= ${WRKDIR}/pkg-install |
42 |
PKGINSTALL= ${WRKDIR}/pkg-install |
33 |
PKGMESSAGE= ${WRKDIR}/pkg-message |
43 |
PKGMESSAGE= ${WRKDIR}/pkg-message |
34 |
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall |
44 |
PKGDEINSTALL= ${WRKDIR}/pkg-deinstall |
35 |
.if defined(WITH_POSTCONFIG) |
|
|
36 |
POSTCONFIG= true |
37 |
PKGNAMESUFFIX= -withconfig |
38 |
.endif |
39 |
|
40 |
.if defined(WITH_DT) |
41 |
DT= true |
42 |
RUN_DEPENDS+= ${LOCALBASE}/bin/supervise:${PORTSDIR}/sysutils/daemontools |
43 |
.endif |
44 |
|
45 |
|
45 |
SUB_FILES= pkg-install pkg-message pkg-deinstall post-config |
46 |
.if !defined(NOPORTDOCS) |
46 |
SUB_LIST+= RCCONF=${RCCONF} POSTCONFIG=${POSTCONFIG} \ |
47 |
PORTDOCS= ChangeLog readme.txt license.txt |
47 |
OPENACSBASE=${OPENACSBASE} OPENACS_GROUP=${OPENACS_GROUP} \ |
|
|
48 |
OPENACS_USER=${OPENACS_USER} DB=${DB} PGDATA=${PGDATA} \ |
49 |
PG_USER=${PG_USER} PGBASE=${PGBASE} \ |
50 |
DTSERVICEBASE=${DTSERVICEBASE} DT=${DT} \ |
51 |
AOLSERVERBASE=${AOLSERVERBASE} VIRTUALBASE=${VIRTUALBASE} |
52 |
|
53 |
RUN_DEPENDS+= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash \ |
54 |
${LOCALBASE}/lib/libtcl84.so.1:${PORTSDIR}/lang/tcl84-thread \ |
55 |
${LOCALBASE}/lib/libreadline.so:${PORTSDIR}/devel/readline \ |
56 |
|
57 |
.if defined(WITH_ORACLE) |
58 |
BROKEN= "Oracle not supported yet" |
59 |
DB= ORA |
60 |
.else |
61 |
DB= PG |
62 |
PGBASE= ${LOCALBASE} |
63 |
PGDATA= ${LOCALBASE}/pgsql/data |
64 |
RUN_DEPENDS+= ${LOCALBASE}/lib/libpq.so:${PORTSDIR}/databases/postgresql74-server \ |
65 |
${LOCALBASE}/aolserver/bin/nsd:${PORTSDIR}/www/aolserver-openacs-pg |
66 |
.endif |
48 |
.endif |
67 |
|
49 |
|
68 |
RUN_DEPENDS+= ${LOCALBASE}/lib/tdom0.8.0/libtdom0.8.0.so:${PORTSDIR}/www/tdom \ |
50 |
OPTIONS= EXAMPLES "Install various example files" on |
69 |
${LOCALBASE}/tclwebtest-1.0/tclwebtest:${PORTSDIR}/www/tclwebtest |
|
|
70 |
|
71 |
USE_LINUX= YES |
72 |
|
73 |
NO_BUILD= YES |
74 |
|
51 |
|
75 |
REINPLACE_ARGS= -i "" -e |
52 |
.include <bsd.port.pre.mk> |
76 |
|
|
|
77 |
PLIST_FILES= ${EXAMPLESDIR:S,^${PREFIX}/,,}/svscan.sh \ |
78 |
${EXAMPLESDIR:S,^${PREFIX}/,,}/restart-aolserver \ |
79 |
${EXAMPLESDIR:S,^${PREFIX}/,,}/svgroup \ |
80 |
${EXAMPLESDIR:S,^${PREFIX}/,,}/nsd-postgres \ |
81 |
${EXAMPLESDIR:S,^${PREFIX}/,,}/nsd-oracle \ |
82 |
${EXAMPLESDIR:S,^${PREFIX}/,,}/post-config.sh |
83 |
|
53 |
|
|
|
54 |
post-patch: |
55 |
@${SED} -e 's|service0|${OPENACS_USER}|' \ |
56 |
-e 's|/var/lib/aolserver/$${server}|${OPENACSBASE}|' \ |
57 |
-e 's|/usr/local/aolserver|${AOLSERVERBASE}|' \ |
58 |
${WRKSRC}/etc/config.tcl > ${WRKDIR}/openacs-config.tcl |
84 |
pre-install: |
59 |
pre-install: |
85 |
@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL |
60 |
@ ${ECHO} "Generating plist" |
|
|
61 |
@ ${FIND} ${WRKSRC} ! -type d ! -path '${WRKSRC}/etc*' \ |
62 |
! -path '${WRKSRC}/readme.txt' ! -path '${WRKSRC}/license.txt' \ |
63 |
! -path '${WRKSRC}/ChangeLog' | \ |
64 |
${SED} 's|${WRKSRC}|${OPENACSBASE:S/${TARGETDIR}\///}|' > ${PLIST} |
65 |
@ ${ECHO} ${OPENACSBASE:S/${TARGETDIR}\///}/etc/${PORTNAME}-config.tcl >> ${PLIST} |
66 |
@ ${ECHO} @dirrm ${OPENACSBASE:S/${TARGETDIR}\///}/etc >> ${PLIST} |
67 |
@ ${FIND} ${WRKSRC} -type d ! -path '${WRKSRC}/etc*' | \ |
68 |
${SORT} -r | \ |
69 |
${SED} 's|${WRKSRC}|@dirrmtry ${OPENACSBASE:S/${TARGETDIR}\///}|' >> ${PLIST} |
70 |
.if defined(WITH_EXAMPLES) |
71 |
@ ${FIND} ${WRKSRC}/etc ! -type d | \ |
72 |
${SED} 's|${WRKSRC}/etc|%%EXAMPLESDIR%%|' >> ${PLIST} |
73 |
@ ${ECHO} %%EXAMPLESDIR%%/create_sampledb.sh >> ${PLIST} |
74 |
@ ${FIND} ${WRKSRC}/etc -type d | \ |
75 |
${SED} 's|${WRKSRC}/etc|@dirrm %%EXAMPLESDIR%%|' | \ |
76 |
${SORT} -r >> ${PLIST} |
77 |
.endif |
86 |
|
78 |
|
87 |
do-install: |
79 |
do-install: |
88 |
@${MKDIR} ${EXAMPLESDIR} |
80 |
@ ${ECHO} "Installing base files" |
89 |
@${MKDIR} ${OPENACSBASE} |
81 |
@ ${MKDIR} ${OPENACSBASE}/etc |
90 |
@${MKDIR} ${VIRTUALBASE} |
82 |
@ ${TAR} -c -C ${WRKSRC} -f - ${BASE_INSTALL} | \ |
91 |
|
83 |
${TAR} -x -C ${OPENACSBASE} -f - |
92 |
@${ECHO_CMD} "Installing files" |
84 |
.if defined(WITH_EXAMPLES) |
93 |
@${CP} -R ${WRKSRC} ${OPENACSBASE}/${OPENACS_USER} |
85 |
@ ${ECHO} "Installing examples" |
94 |
|
86 |
@ ${MKDIR} ${EXAMPLESDIR} |
95 |
@${TEST} -e ${VIRTUALBASE}/aolserver || ${LN} -s ${OPENACSBASE} ${VIRTUALBASE}/aolserver |
87 |
@ ${TAR} -c -C ${WRKSRC}/etc -f - . | ${TAR} -x -C ${EXAMPLESDIR} -f - |
96 |
@${TEST} -L ${VIRTUALBASE}/aolserver || ${ECHO_MSG} "${VIRTUALBASE}/aolserver is no symbolic link" |
88 |
@ ${INSTALL_SCRIPT} ${WRKDIR}/create_sampledb.sh ${EXAMPLESDIR} |
97 |
|
89 |
.endif |
98 |
@${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/nsd-postgres.txt ${EXAMPLESDIR}/nsd-postgres |
90 |
@ ${ECHO} "Installing sample configuration file" |
99 |
@${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/nsd-oracle.txt ${EXAMPLESDIR}/nsd-oracle |
91 |
@ ${INSTALL_DATA} ${WRKDIR}/openacs-config.tcl ${OPENACSBASE}/etc/${PORTNAME}-config.tcl |
100 |
@${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/restart-aolserver.txt ${EXAMPLESDIR}/restart-aolserver |
92 |
.if !defined(NOPORTDOCS) |
101 |
@${INSTALL_SCRIPT} ${FILESDIR}/svscan.sh ${EXAMPLESDIR}/svscan.sh |
93 |
@ ${ECHO} "Installing docs" |
102 |
@${INSTALL_SCRIPT} ${OPENACSBASE}/${OPENACS_USER}/packages/acs-core-docs/www/files/svgroup.txt ${EXAMPLESDIR}/svgroup |
94 |
@ ${MKDIR} ${DOCSDIR} |
103 |
@${INSTALL_SCRIPT} ${WRKDIR}/post-config ${EXAMPLESDIR}/post-config.sh |
95 |
.for FILE in ${PORTDOCS} |
104 |
|
96 |
@ ${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR} |
105 |
post-install: |
97 |
.endfor |
106 |
@${REINPLACE_CMD} "\ |
98 |
.endif |
107 |
s|/usr/local/aolserver|${AOLSERVERBASE}|g; \ |
|
|
108 |
s|/bin/bash|/bin/sh|g; \ |
109 |
" ${EXAMPLESDIR}/nsd-postgres ${EXAMPLESDIR}/nsd-oracle |
110 |
@${REINPLACE_CMD} "\ |
111 |
s|service0|${OPENACS_USER}|g; \ |
112 |
s|\[ns_info address\]|${IP_ADDRESS}|g; \ |
113 |
s|/var/lib/aolserver|${OPENACSBASE}|g; \ |
114 |
s|/usr/local/aolserver|${AOLSERVERBASE}|g; \ |
115 |
" ${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl |
116 |
@${REINPLACE_CMD} "\ |
117 |
s|service0|${OPENACS_USER}|g; \ |
118 |
s|/usr/local/aolserver/bin|${EXAMPLESDIR}|g; \ |
119 |
" ${OPENACSBASE}/${OPENACS_USER}/etc/daemontools/run |
120 |
|
121 |
@${ECHO_CMD} "@unexec rm -f ${DATADIR}/log/${OPENACS_USER}* 2>&1 > /dev/null || true" >> ${TMPPLIST} |
122 |
@${ECHO_CMD} "@unexec rm -f ${DATADIR}/log/error.log* 2>&1 > /dev/null || true" >> ${TMPPLIST} |
123 |
@${ECHO_CMD} "@unexec rm -Rf ${DATADIR}/apm-workspace 2>&1 > /dev/null || true" >> ${TMPPLIST} |
124 |
@${ECHO_CMD} "@unexec rm -Rf ${DATADIR}/etc/daemontools/supervise 2>&1 > /dev/null || true" >> ${TMPPLIST} |
125 |
@${FIND} -s ${WRKSRC} -not -type d \ |
126 |
| ${SED} -ne 's,^${WRKSRC},${DATADIR:S,^${PREFIX}/,,},p' >> ${TMPPLIST} |
127 |
@${FIND} -s -d ${WRKSRC} -type d \ |
128 |
| ${SED} -ne 's,^${WRKSRC},@dirrm ${DATADIR:S,^${PREFIX}/,,},p' >> ${TMPPLIST} |
129 |
@${ECHO_CMD} "@dirrm ${EXAMPLESDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} |
130 |
|
131 |
@if [ ${DT} ] ; then \ |
132 |
${MKDIR} ${DTSERVICEBASE} ; \ |
133 |
${TEST} -L ${DTSERVICEBASE}/${OPENACS_USER} || ${LN} -s ${OPENACSBASE}/${OPENACS_USER}/etc/daemontools ${DTSERVICEBASE}/${OPENACS_USER} ; \ |
134 |
${ECHO_CMD} "@cd ${DTSERVICEBASE}" >> ${TMPPLIST} ; \ |
135 |
${ECHO_CMD} "${OPENACS_USER}" >> ${TMPPLIST} ; \ |
136 |
${ECHO_CMD} "@unexec rmdir ${DTSERVICEBASE} 2>&1 > /dev/null || true" >> ${TMPPLIST} ; \ |
137 |
fi |
138 |
|
139 |
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL |
99 |
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL |
140 |
@${CAT} ${PKGMESSAGE} |
100 |
@${CAT} ${PKGMESSAGE} |
141 |
|
101 |
|
142 |
.include <bsd.port.mk> |
102 |
.include <bsd.port.post.mk> |