View | Details | Raw Unified | Return to bug 108737
Collapse All | Expand All

(-)www/openacs/Makefile (-114 / +74 lines)
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>
(-)www/openacs/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (openacs-5.1.5.tar.gz) = a86843cb5aaf62d7e1c54b0e69238079
1
MD5 (openacs-5.3.0.tgz?revision_id=583060) = acad5851db90dfdc5319182b1c367cde
2
SHA256 (openacs-5.1.5.tar.gz) = 4bce2472ef30619911370428a828e1d192627dce745968cb8eb3c6b51102d85b
2
SHA256 (openacs-5.3.0.tgz?revision_id=583060) = ac99907db0aafb9748e9dbd598a62cb80cf7cfedbf30a0e5b52b9619e83a85c5
3
SIZE (openacs-5.1.5.tar.gz) = 5740656
3
SIZE (openacs-5.3.0.tgz?revision_id=583060) = 7667672
(-)www/openacs/files/create_sampledb.sh.in (+45 lines)
Line 0 Link Here
1
#!/bin/sh
2
# $FreeBSD$
3
#
4
# This script prepares a sample PostgreSQL database 
5
# for use by OpenACS
6
#
7
PGUSER=%%PGUSER%%
8
OPENACS_USER=%%OPENACS_USER%%
9
OPENACS_DB=%%OPENACS_DB%%
10
LOCALBASE=%%LOCALBASE%%
11
#
12
PGREP=/usr/bin/pgrep
13
SU=/usr/bin/su
14
AWK=/usr/bin/awk
15
16
CREATEUSERFLAGS="-A -d"
17
18
# Check if PostgreSQL version is >= 8.1.0
19
${LOCALBASE}/bin/postmaster -V | ${AWK} -F '[ .]' '{if ($3=8 && $4>=1) {exit 0} else {exit 1}}' && {
20
POSTGRESQL81=YES
21
CREATEUSERFLAGS="-S -R -d"
22
}
23
24
${PGREP} -U ${PGUSER} postgres > /dev/null || {
25
	echo "You need PostgreSQL server installed and running."
26
	echo "After a fresh install, you need to initialize the database with:"
27
	echo "su - ${PGUSER} -c initdb"
28
	echo "Exiting ..."
29
	exit 1
30
}
31
echo "Creating PostgreSQL user ${OPENACS_USER} ..."
32
${SU} -l ${PGUSER} -c "${LOCALBASE}/bin/createuser ${CREATEUSERFLAGS} ${OPENACS_USER}" 
33
echo "Creating PostgreSQL database ${OPENACS_DB} ..."
34
${SU} -l ${OPENACS_USER} -c "${LOCALBASE}/bin/createdb -E UNICODE ${OPENACS_DB}"
35
echo "Registering language plpgsql for database ${OPENACS_DB} ..."
36
${SU} -l ${PGUSER} -c "${LOCALBASE}/bin/createlang plpgsql ${OPENACS_DB}"
37
[ "x${POSTGRESQL81}" = "xYES" ] && {
38
echo ""
39
echo "**************************** NOTICE ****************************"
40
echo "You have PostgreSQL 8.1 or greater installed."
41
echo "Your may need to alter your PostgreSQL configuration."
42
echo "Please read the instructions under the following URL:"
43
echo "http://openacs.org/xowiki/en/How_to_install_in_Postgres_8.1.x"
44
echo "****************************************************************"
45
}
(-)www/openacs/files/dotlrn.in (+46 lines)
Line 0 Link Here
1
#! /bin/sh
2
#
3
#
4
# PROVIDE: dotlrn
5
# REQUIRE: DAEMON NETWORKING SERVERS
6
#
7
# Add the following line to /etc/rc.conf to enable dotlrn:
8
#
9
# dotlrn_enable="YES"
10
#
11
# Tweakable parameters for users to override in rc.conf
12
13
. "%%RC_SUBR%%"
14
15
name=dotlrn
16
17
load_rc_config ${name}
18
: ${dotlrn_enable="NO"}
19
: ${dotlrn_user="%%OPENACS_USER%%"}
20
: ${dotlrn_group="%%OPENACS_GROUP%%"}
21
: ${dotlrn_conf=%%OPENACSBASE%%/etc/dotlrn-config.tcl}
22
: ${dotlrn_flags="-u ${dotlrn_user} -g ${dotlrn_group}"}
23
: ${dotlrn_prog=%%AOLSERVERBASE%%/bin/nsd}
24
: ${dotlrn_pidfile=/var/run/dotlrn.pid}
25
26
rcvar=`set_rcvar`
27
pidfile=${dotlrn_pidfile}
28
start_postcmd="start_postcmd"
29
stop_postcmd="stop_postcmd"
30
required_files=${dotlrn_conf}
31
command=%%AOLSERVERBASE%%/bin/nsd
32
command_args="-t ${dotlrn_conf}"
33
procname=${dotlrn_prog}
34
35
start_postcmd()
36
{
37
	PID=`pgrep -U ${dotlrn_user} -f ${dotlrn_conf}`
38
	[ -n "${PID}" ] && echo ${PID} > ${pidfile}
39
}
40
41
stop_postcmd()
42
{
43
	[ -f "${pidfile}" ] && rm ${pidfile}
44
}
45
46
run_rc_command "$1"
(-)www/openacs/files/openacs.in (+46 lines)
Line 0 Link Here
1
#! /bin/sh
2
#
3
#
4
# PROVIDE: openacs
5
# REQUIRE: DAEMON NETWORKING SERVERS
6
#
7
# Add the following line to /etc/rc.conf to enable openacs:
8
#
9
# openacs_enable="YES"
10
#
11
# Tweakable parameters for users to override in rc.conf
12
13
. "%%RC_SUBR%%"
14
15
name=openacs
16
17
load_rc_config ${name}
18
: ${openacs_enable="NO"}
19
: ${openacs_user="%%OPENACS_USER%%"}
20
: ${openacs_group="%%OPENACS_GROUP%%"}
21
: ${openacs_conf=%%OPENACSBASE%%/etc/openacs-config.tcl}
22
: ${openacs_flags="-u ${openacs_user} -g ${openacs_group}"}
23
: ${openacs_prog=%%AOLSERVERBASE%%/bin/nsd}
24
: ${openacs_pidfile=/var/run/openacs.pid}
25
26
rcvar=`set_rcvar`
27
pidfile=${openacs_pidfile}
28
start_postcmd="start_postcmd"
29
stop_postcmd="stop_postcmd"
30
required_files=${openacs_conf}
31
command=%%AOLSERVERBASE%%/bin/nsd
32
command_args="-t ${openacs_conf}"
33
procname=${openacs_prog}
34
35
start_postcmd()
36
{
37
	PID=`pgrep -U ${openacs_user} -f ${openacs_conf}`
38
	[ -n "${PID}" ] && echo ${PID} > ${pidfile}
39
}
40
41
stop_postcmd()
42
{
43
	[ -f "${pidfile}" ] && rm ${pidfile}
44
}
45
46
run_rc_command "$1"
(-)www/openacs/files/pkg-deinstall.in (-20 / +17 lines)
Lines 1-24 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# $FreeBSD$
2
3
3
PATH=$PATH:/bin:/usr/bin:/usr/sbin
4
if [ "$2" != "POST-DEINSTALL" ]; then
5
	exit 0
6
fi
4
7
5
case $2 in
8
OPENACS_USER=%%OPENACS_USER%%
6
9
OPENACS_GROUP=%%OPENACS_GROUP%%
7
POST-DEINSTALL)
10
OPENACSBASE=%%OPENACSBASE%%
8
	echo "You are deinstalling this port:"
9
	echo "  Remember to kill the associated Aolserver process in case"
10
	echo "	you've changed the standard."       
11
	echo "  We will try to kill the standard now:"
12
	pid=`ps -ax | grep %%OPENACS_USER%%/etc/config.tcl | grep -v grep| awk -F' ' '{print $1}'`;
13
	if test "$pid" = "" ; then
14
		echo "  No %%OPENACS_USER%% process found."
15
	else
16
		echo "  Killing %%OPENACS_USER%% proces. pid: $pid . "
17
		kill $pid
18
	fi
19
	echo " If no other openACS/.LRN instance needs it, you may want to "
20
	echo " delete %%VIRTUALBASE%%/aolserver and %%VIRTUALBASE%% manually, "
21
	echo " and possibly the %%OPENACS_USER%% users and database. "
22
	;;
23
esac
24
 
11
 
12
if pw usershow "${OPENACS_USER}" 2>/dev/null 1>&2; then
13
	echo "To delete ${OPENACS_USER} user permanently, use 'pw userdel \"${OPENACS_USER}\"'"
14
fi
15
if pw usershow "${OPENACS_GROUP}" 2>/dev/null 1>&2; then
16
	echo "To delete ${OPENACS_GROUP} group permanently, use 'pw groupdel \"${OPENACS_GROUP}\"'"
17
fi
18
if test -d "${OPENACSBASE}"; then
19
	echo "You may need to remove ${OPENACSBASE} manually."
20
fi
21
exit 0
(-)www/openacs/files/pkg-install.in (-99 / +26 lines)
Lines 1-107 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
# $FreeBSD$
2
3
3
PATH=/bin:/usr/sbin:/usr/bin
4
if [ "$2" != "POST-INSTALL" ]; then
4
LOCALBASE=%%LOCALBASE%%
5
        exit 0
5
EXAMPLESDIR=%%EXAMPLESDIR%%
6
RCCONF=%%RCCONF%%
7
OPENACSBASE=%%OPENACSBASE%%
8
OPENACS_GROUP=%%OPENACS_GROUP%%
9
OPENACS_USER=%%OPENACS_USER%%
10
DB=%%DB%%
11
DT=%%DT%%
12
PGDATA=%%PGDATA%%
13
PG_USER=%%PG_USER%%
14
PGBASE=%%PGBASE%%
15
DTSERVICEBASE=%%DTSERVICEBASE%%
16
AOLSERVERBASE=%%AOLSERVERBASE%%
17
VIRTUALBASE=%%VIRTUALBASE%%
18
POSTCONFIG=%%POSTCONFIG%%
19
20
pre-install() { echo "
21
22
  First, make sure that you either have         
23
  lang/tcl84-thread or no tcl84 installed
24
25
  =========== BACKUP YOUR DATA! =============
26
  As always, backup your data before
27
  upgrading. This is *NOT* done by the port!
28
29
  IMPORTANT: You may loose data by an upgrade.
30
   Press ctrl-C *NOW* if you need to 
31
           BACKUP YOUR DATA,
32
   for example a pg_dump or custom openacs files.
33
34
  =========  FOR UPGRADE SEE: ===============
35
  http://openacs.org/doc/current/upgrade.html
36
  ===========================================
37
38
  To allow post-install configurations, use:
39
     make install WITH_POSTCONFIG=yes
40
  
41
  Or after installation has completed, do: 
42
     sh ${EXAMPLESDIR}/post-config.sh XX POST-INSTALL 
43
44
  Advice: 
45
  stop a running Aolserver and/or Postgresql
46
  before post-install configuration starts.
47
48
  Press ctrl-C *NOW* if you need to. 
49
  ===========================================
50
"
51
52
sleep 10
53
54
if [ -d ${OPENACSBASE}/${OPENACS_USER} ] ; then 
55
	echo "WARNING: ${OPENACSBASE}/${OPENACS_USER} already exists !"
56
	echo "It may be a valid tree or the result of an aborted previous install"
57
	echo "TO CONTINUE: Move it, Delete it or do:"
58
	echo "   make install OPENACS_USER=ChooseName < WITH_POSTCONFIG=yes >"
59
	echo " "
60
	exit 1 ; fi
61
62
if pw group show ${OPENACS_GROUP} >/dev/null 2>&1; then
63
	echo "You already have a group \"${OPENACS_GROUP}\", so I will use it."
64
else
65
	pw groupadd -n ${OPENACS_GROUP} 
66
fi
6
fi
67
7
68
if pw user show ${OPENACS_USER} >/dev/null 2>&1; then
8
OPENACS_GROUP=%%OPENACS_GROUP%%
69
	echo "You already have a user \"${OPENACS_USER}\", so I will use it."
9
OPENACS_USER=%%OPENACS_USER%%
70
else
10
OPENACSBASE=%%OPENACSBASE%%
71
	pw useradd -n ${OPENACS_USER} -G ${OPENACS_GROUP} -c "OpenACS instance pseudo-user" \
72
	-h - 
73
fi
74
75
}
76
11
77
post-install() {
12
if ! pw groupshow "${OPENACS_GROUP}" 2>/dev/null 1>&2; then
78
	echo "Set permissions of files"
13
	if pw groupadd ${OPENACS_GROUP}; then
79
	chmod -R 770 ${OPENACSBASE}/${OPENACS_USER}
14
		echo "Added group \"${OPENACS_GROUP}\"."
80
	chmod -R 770 ${EXAMPLESDIR}
15
	else
81
if [ ${DT} ]  ; then \
16
		echo "Adding group \"${OPENACS_GROUP}\" failed..."
82
	chmod -R 755 ${DTSERVICEBASE}/${OPENACS_USER} ; \
17
		exit 1
83
     	chmod 1755 ${DTSERVICEBASE} ; \
18
	fi
84
fi
19
fi
85
	chown -R ${OPENACS_USER}:${OPENACS_GROUP} ${OPENACSBASE}/${OPENACS_USER}
86
	chown root:${OPENACS_GROUP} ${EXAMPLESDIR}/nsd-postgres ${EXAMPLESDIR}/nsd-oracle
87
20
88
if test "${POSTCONFIG}" = "true" ; then
21
if ! pw usershow "${OPENACS_USER}" 2>/dev/null 1>&2; then
89
	echo "Performing post-config changes"
22
	if pw useradd ${OPENACS_USER} -g ${OPENACS_GROUP} -h - \
90
	sh ${EXAMPLESDIR}/post-config.sh XX POST-INSTALL
23
		-s "/bin/sh" -d "${OPENACSBASE}" \
91
else
24
		-c "OpenACS instance pseudo-user"; \
92
	echo "No post-config changes performed"
25
	then
93
	echo "Run sh ${EXAMPLESDIR}/post-config.sh XX POST-INSTALL later"
26
		echo "Added user \"${OPENACS_USER}\"."
27
	else
28
		echo "Adding user \"${OPENACS_USER}\" failed..."
29
		exit 1
30
	fi
94
fi
31
fi
95
32
	echo "Seting permissions of files"
96
}
33
	chmod -R 770 ${OPENACSBASE}
97
34
	chown -R ${OPENACS_USER}:${OPENACS_GROUP} ${OPENACSBASE}
98
case $2 in
99
100
PRE-INSTALL)
101
	pre-install
102
	;;
103
POST-INSTALL)
104
	post-install
105
	;;
106
esac
107
(-)www/openacs/files/pkg-message.in (-55 / +16 lines)
Lines 1-62 Link Here
1
     ******** READ THIS *******
1
Congratulations! You have just installed %%OPENACSNAME%%
2
2
3
Congratulations! You have just installed OpenACS/.LRN
3
To create a sample default database run the script:
4
%%EXAMPLESDIR%%/create_sampledb.sh
4
5
5
If you didn't do make install WITH_POSTCONFIG=yes,
6
You can start %%OPENACSNAME%% with the startup script:
6
inspect post-config.sh now and/or run:
7
%%LOCALBASE%%/etc/rc.d/%%PORTNAME%%
7
sh %%EXAMPLESDIR%%/post-config.sh XX POST-INSTALL
8
If you can, stop Aolserver and Postgresql first
9
(killall -9 nsd ; %%PREFIX%%/etc/rc.d/010.pgsql.sh stop) 
10
before post-install configuration starts.
11
12
Then use your browser to view the welcome page (http://<your-ip>:8000)
13
and follow the instructions. (Find out your IP address by typing 
14
"ifconfig" at the command line)
15
16
If you want daemontools to restart aolserver, remember to:
17
Copy the example svscan.sh from %%EXAMPLESDIR%%
18
to %%LOCALBASE%%/etc/rc.d/svscan.sh
19
Make a copy of the original file first, if you like.
20
Then REBOOT (shutdown -r now)!
21
22
Once the datamodel has been installed and aolserver restarts
23
it can take a few MINUTES before the server becomes available. 
24
Be patient! 
25
8
26
Errors, if any, are in:
9
If you are using another AOLserver on the default port 8000, 
27
%%VIRTUALBASE%%/aolserver/%%OPENACS_USER%%/log/error.log
10
please change the port number in the configuration file.
11
Default config: %%OPENACSBASE%%/etc/%%PORTNAME%%-config.tcl
28
 
12
 
29
Go to the docs at http://openacs.org/doc/ to find out more.
13
Then use your browser to view the welcome page (http://<your-ip>:<port>)
30
There are a few things different from the docs (!): For example, the 
14
- default port is 8000 and follow the instructions.
31
postgres user is pgsql not postgres, daemontools are in %%DTSERVICEBASE%%,
32
openACS/.LRN is in %%LOCALBASE%%/share/ (with symlink in %%VIRTUALBASE%%), 
33
nsd-postgres and some other files are in %%EXAMPLESDIR%%, but everything
34
should work just fine.
35
36
To view your pages at port 80 you will have to change:
37
%%RCCONF%%, daemontools/run and config.tcl in
38
%%VIRTUALBASE%%/aolserver/%%OPENACS_USER%%/etc.
39
40
If you install .LRN as well as openACS the IP address in config.tcl
41
should be different or you should shut one down (svc -d %%DTSERVICEBASE%%/...)
42
before starting the other. Aolserver cannot listen on the same ip-address
43
twice!
44
45
If you want to remove openacs, type "make deinstall" or use pkg_delete
46
(pkg_info).
47
However, users and database are not removed.
48
49
We use bash as shell in openACS. We didn't change the shells of
50
current users like root and pgsql, yet. If you want, do:
51
chsh -s %%LOCALBASE%%/bin/bash USERNAME 
52
and change its profile by copying the openACS entries from
53
/usr/share/skel/dot.profile to  ~/.profile. 
54
Then login/out or type ". .profile".
55
15
56
Remember: THIS MESSAGE is in PORTSDIR/www/openacs/
16
Errors, if any, are in:
57
files/pkg-message.in or work/pkg-message
17
%%OPENACSBASE%%/log/error.log
58
18
59
-Aldert
19
If you want to use keepalive via cron, you might want to look here:
60
aldert@nooitgedagt.net
20
%%EXAMPLESDIR%%/keepalive/
61
21
62
     ******** READ THE INFORMATION ABOVE ******** 
22
-Martin Matuska
23
martin@matuska.org
(-)www/openacs/files/post-config.in (-124 lines)
Lines 1-124 Link Here
1
#! /bin/sh
2
3
PATH=/bin:/usr/sbin:/usr/bin
4
LOCALBASE=%%LOCALBASE%%
5
EXAMPLESDIR=%%EXAMPLESDIR%%
6
RCCONF=%%RCCONF%%
7
OPENACSBASE=%%OPENACSBASE%%
8
OPENACS_GROUP=%%OPENACS_GROUP%%
9
OPENACS_USER=%%OPENACS_USER%%
10
DB=%%DB%%
11
PGDATA=%%PGDATA%%
12
PG_USER=%%PG_USER%%
13
PGBASE=%%PGBASE%%
14
DTSERVICEBASE=%%DTSERVICEBASE%%
15
AOLSERVERBASE=%%AOLSERVERBASE%%
16
VIRTUALBASE=%%VIRTUALBASE%%
17
18
post-install() {
19
	echo "Starting post-config changes on your request"
20
21
for DIRS in /usr/share/skel/dot
22
do
23
if egrep 'OPENACS-entries in .profile' ${DIRS}.profile >/dev/null 2>&1; then
24
	echo "Notice: there are OPENACS-entries in .profile (skeleton)"
25
else
26
	echo "Notice: adding OPENACS-entries to ${DIRS}.profile" && \
27
	echo "# OPENACS-entries in .profile:" >> ${DIRS}.profile && \
28
	echo "export PATH=\$$PATH:${PGBASE}/bin" >> ${DIRS}.profile && \
29
	echo "export PGDATA=${PGDATA}" >> ${DIRS}.profile && \
30
	echo "export LD_LIBRARY_PATH=\$$LD_LIBRARY_PATH:${PGBASE}/lib" >> ${DIRS}.profile && \
31
	echo "export PS1=\"<\u-\W>\"" >> ${DIRS}.profile && \
32
	echo "export PS2=\"continu>\"" >> ${DIRS}.profile && \
33
	echo "export CVSROOT=/cvsroot" >> ${DIRS}.profile && \
34
	echo "export EDITOR=emacs" >> ${DIRS}.profile && \
35
	echo "# end of OPENACS-entries." >> ${DIRS}.profile
36
fi
37
done
38
39
if egrep 'OPENACS-entries in rc.conf' ${RCCONF} >/dev/null 2>&1; then
40
	echo "Notice: there are OPENACS-entries in ${RCCONF}"
41
else
42
	echo "Notice: adding OPENACS-entries to ${RCCONF}" && \
43
	echo "# OPENACS-entries in rc.conf:" >> ${RCCONF} && \
44
	echo "ldconfig_paths=\"/usr/lib/compat /usr/X11R6/lib ${LOCALBASE}/lib ${PGBASE}/lib ${AOLSERVERBASE}/lib\" " >> ${RCCONF} && \
45
	echo "postgresql_enable=\"YES\"" >> ${RCCONF} && \
46
	echo "postgresql_data=\"${PGDATA}\"" >> ${RCCONF} && \
47
	echo "postgresql_flags=\" -l ${PGDATA}/server.log\"" >> ${RCCONF} && \
48
	echo "aolserver_enable=\"YES\"" >> ${RCCONF} && \
49
	echo "aolserver_conf=\"${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl\"" >> ${RCCONF} && \
50
	echo "aolserver_flags=\"-u ${OPENACS_USER} -g ${OPENACS_GROUP} -b 0.0.0.0:8000\"" >> ${RCCONF} && \
51
	echo "aolserver_prog=\"${EXAMPLESDIR}/nsd-postgres\"" >> ${RCCONF} && \
52
	echo "# end of OPENACS-entries." >> ${RCCONF}
53
fi
54
55
	echo "adding root and ${PG_USER} to group ${OPENACS_GROUP}"
56
	pw usermod ${PG_USER} -G ${OPENACS_GROUP}
57
	pw usermod root -G ${OPENACS_GROUP}
58
59
	echo "Set permissions of files (post-config)"
60
	chown -R :${OPENACS_GROUP} ${AOLSERVERBASE}
61
62
if [ "${DB}" = "PG" ]; then
63
	echo "Postgresql database is being configured."
64
	if [ ! -d ${PGDATA} ]; then 
65
		su -l ${PG_USER} -c "${LOCALBASE}/bin/initdb -D ${PGDATA}"; 
66
	fi
67
	if [ -e ${PGDATA}/postmaster.pid ]; then
68
        	echo "Postgres is running. We don't want to stop it, because we don't know why you have it running."
69
		pid0=`ps -ax | grep ${PGDATA}/server.log | grep -v grep| awk -F' ' '{print $1}'`;
70
		if test "$pid0" != "" ; then
71
			echo  "Since ${PGDATA}/server.log seems active you may be fine."
72
		fi
73
		echo "If you run into trouble: please stop Postgresql and Aolserver en restart them respectively, after this installation has completed."
74
	else
75
        	echo "Start Postgresql"
76
		su -l ${PG_USER} -c "${LOCALBASE}/bin/pg_ctl -D ${PGDATA} -l ${PGDATA}/server.log start" 
77
	fi	
78
	sleep 5
79
	su  -l ${PG_USER} -c "${LOCALBASE}/bin/createlang plpgsql template1"  > /dev/null 2>&1
80
	su  -l ${PG_USER} -c "${LOCALBASE}/bin/createlang -l template1"  > /dev/null 2>&1
81
	su  -l ${PG_USER} -c "${LOCALBASE}/bin/createuser -A -d ${OPENACS_USER}"  > /dev/null 2>&1
82
	su  -l ${OPENACS_USER} -c "${LOCALBASE}/bin/createdb -E UNICODE ${OPENACS_USER}"  > /dev/null 2>&1
83
	sleep 5
84
	echo "Checking Aolserver before (re)start. Is it running?"
85
	pid1=`ps -ax | grep sample-config | grep -v grep| awk -F' ' '{print $1}'`;
86
	if test "$pid1" = "" ; then
87
		:
88
	else
89
		echo "Killing sample-config process. pid: $pid1 ."
90
		kill $pid1
91
	fi	
92
	pid2=`ps -ax | grep ${OPENACS_USER}/etc/config.tcl | grep -v grep| awk -F' ' '{print $1}'`;
93
	if test "$pid2" = "" ; then
94
		:
95
	else
96
		echo "Killing ${OPENACS_USER} config.tcl process. pid: $pid2 ."
97
		kill $pid2
98
	fi
99
100
	pid3=`ps -ax | grep nsd | grep -v grep| awk -F' ' '{print $1}'`;
101
	if test "$pid3" = "" ; then
102
		echo "Good. No running Aolserver process.";
103
	else
104
		echo "Warning: at least still one Aolserver process is running..."
105
		echo "We will start Aolserver now, but it may not be able to listen on the same address:port"
106
		echo "FYI: killall -9 nsd  will stop all processes or change the IP-address in config.tcl, then start again."
107
	fi
108
	echo "Starting aolserver: ${EXAMPLESDIR}/nsd-postgres -t ${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl -u ${OPENACS_USER} -g ${OPENACS_GROUP}"
109
	${EXAMPLESDIR}/nsd-postgres -t ${OPENACSBASE}/${OPENACS_USER}/etc/config.tcl -u ${OPENACS_USER} -g ${OPENACS_GROUP}
110
	sleep 10
111
fi
112
113
}
114
115
case $2 in
116
117
POST-INSTALL)
118
	post-install
119
	;;
120
esac
121
122
# ${EXAMPLESDIR}/svgroup ${OPENACS_GROUP} ${DTSERVICEBASE}/${OPENACS_USER}
123
# KEEP ALIVE with DAEMONTOOLS + OPTION: see http://openacs.org/forums/message-view?message_id=291164
124
# AOLSERVER RESTART SCRIPT: see http://openacs.org/doc/current/maintenance-web.html
(-)www/openacs/files/svscan.sh (-62 lines)
Lines 1-62 Link Here
1
#!/bin/sh
2
3
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
4
    echo "$0: Cannot determine the PREFIX" >&2
5
    exit 1
6
fi
7
8
# It would really, really be a Good Thing(tm)
9
# for you to enable some of the below
10
# control variables and the apropriate ulimit.
11
# These are only examples.
12
# Furthermore, you should think about additional
13
# limits you might need.
14
# Or, check login.conf(5) for a suitable
15
# alternative
16
#
17
# I really do suggest you use /var/service/ as your
18
# service spool directory. Check hier(7) for
19
# reasons.
20
21
# 10 Mb
22
MINSEGMENT=10240
23
# 20 Mb
24
#MAXSEGMENT=20480
25
# 10 Mb
26
MAXFILESIZE=10240
27
# 100
28
MAXFD=100
29
# 40
30
MAXCHILD=40
31
32
# ulimits
33
#ulimit -d ${MINSEGMENT}
34
#ulimit -f ${MAXFILESIZE}
35
#ulimit -m ${MAXSEGMENT}
36
#ulimit -n ${MAXFD}
37
#ulimit -s ${MINSEGMENT}
38
#ulimit -u ${MAXCHILD}
39
40
KILLALL=/usr/bin/killall
41
SVC=${PREFIX}/bin/svc
42
SVPROC=svscan
43
SVSCAN=$PREFIX/bin/svscan
44
READPROCTITLE=$PREFIX/bin/readproctitle
45
SVDIR=/var/service/
46
47
case "$1" in
48
  start)
49
	echo -n " svscan"
50
	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
51
	;;
52
53
  stop)
54
	echo -n " svscan: "
55
	$KILLALL $SVPROC
56
	$SVC -dx $SVDIR/* $SVDIR/*/log
57
	;;
58
59
  *)
60
  	echo "Usage: $0 start | stop"
61
	;;
62
esac
(-)www/openacs/pkg-descr (+3 lines)
Lines 15-17 Link Here
15
15
16
- Aldert
16
- Aldert
17
aldert@nooitgedagt.net
17
aldert@nooitgedagt.net
18
19
- Martin Matuska
20
martin@matuska.org
(-)www/openacs-dotlrn/Makefile (-4 / +12 lines)
Lines 6-18 Link Here
6
#
6
#
7
7
8
PORTNAME=	dotlrn
8
PORTNAME=	dotlrn
9
PORTVERSION=	2.1.3
9
PORTVERSION=	2.2.1
10
MASTER_SITES=	http://openacs.org/projects/dotlrn/download/download/
10
MASTER_SITES=	http://openacs.org/projects/dotlrn/download/download/
11
EXTRACT_SUFX=	.tgz?revision_id=559791
11
12
12
MAINTAINER=	aldert@nooitgedagt.net
13
MAINTAINER=	martin@matuska.org
13
COMMENT=	Modular web application platform for high traffic elearning community
14
COMMENT=	OpenACS-based e-learning platform for high-traffic communities
14
15
15
OPENACS_USER=	dotlrn0
16
OPENACS_USER?=  dotlrn
17
OPENACS_DB?=	dotlrn
18
OPENACS_GROUP?= www
19
20
OPENACSBASE=	${TARGETDIR}/dotlrn
21
OPENACSNAME=	.LRN
22
23
BASE_INSTALL=	bin content-repository-content-files log packages tcl www install.xml
16
24
17
DESCR=		${.CURDIR}/pkg-descr
25
DESCR=		${.CURDIR}/pkg-descr
18
MD5_FILE=	${.CURDIR}/distinfo
26
MD5_FILE=	${.CURDIR}/distinfo
(-)www/openacs-dotlrn/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (dotlrn-2.1.3.tar.gz) = f8616313b779cfad679b6a2d82b9a065
1
MD5 (dotlrn-2.2.1.tgz?revision_id=559791) = 1b769c66601de8ed99f46ffe74624267
2
SHA256 (dotlrn-2.1.3.tar.gz) = b6edcd4d0fe3d59f313812c8fd56b4f4735651c2abc2ed045fa8bf5a636fdb8d
2
SHA256 (dotlrn-2.2.1.tgz?revision_id=559791) = e912424256dd178cce04a101b2c01e275e36eb36ea391f0e0c67acefc9f12183
3
SIZE (dotlrn-2.1.3.tar.gz) = 8548486
3
SIZE (dotlrn-2.2.1.tgz?revision_id=559791) = 21892161
(-)www/openacs-dotlrn/pkg-descr (+3 lines)
Lines 15-17 Link Here
15
15
16
- Aldert
16
- Aldert
17
aldert@nooitgedagt.net
17
aldert@nooitgedagt.net
18
19
- Martin Matuska
20
martin@matuska.org

Return to bug 108737