diff options
author | mm <mm@FreeBSD.org> | 2008-04-03 20:17:25 +0800 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2008-04-03 20:17:25 +0800 |
commit | 6199dc26a7a1c3511fb4c8577eca51ed53b19d3f (patch) | |
tree | cfa744e1b3c032d672a9c8387749c32af6c3b516 | |
parent | 72eec95a682f813816f1b04d1edef468c5698f4e (diff) | |
download | freebsd-ports-gnome-6199dc26a7a1c3511fb4c8577eca51ed53b19d3f.tar.gz freebsd-ports-gnome-6199dc26a7a1c3511fb4c8577eca51ed53b19d3f.tar.zst freebsd-ports-gnome-6199dc26a7a1c3511fb4c8577eca51ed53b19d3f.zip |
- Update to 5.4.1b1
- Use own uid and gid
- Fix sample config install and install messages
-rw-r--r-- | www/openacs/Makefile | 49 | ||||
-rw-r--r-- | www/openacs/distinfo | 6 | ||||
-rw-r--r-- | www/openacs/files/pkg-deinstall.in | 12 | ||||
-rw-r--r-- | www/openacs/files/pkg-install.in | 104 |
4 files changed, 129 insertions, 42 deletions
diff --git a/www/openacs/Makefile b/www/openacs/Makefile index 04b3f0ab7e60..26683aa355f7 100644 --- a/www/openacs/Makefile +++ b/www/openacs/Makefile @@ -6,14 +6,16 @@ # PORTNAME?= openacs -DISTVERSION?= 5-3-2 +DISTVERSION?= 5.4.1b1 CATEGORIES= www MASTER_SITES?= http://openacs.org/projects/openacs/download/download/ -EXTRACT_SUFX?= .tgz?revision_id=1098887 +EXTRACT_SUFX= .tgz?revision_id=${DIST_REV_ID} MAINTAINER?= mm@FreeBSD.org COMMENT?= A modular web application platform for communities +DIST_REV_ID?= 1474805 + AOLSERVERBASE?= ${LOCALBASE}/aolserver RUN_DEPENDS+= ${AOLSERVERBASE}/bin/nscache.so:${PORTSDIR}/www/aolserver-nscache \ ${AOLSERVERBASE}/bin/nsopenssl.so:${PORTSDIR}/security/aolserver-nsopenssl \ @@ -27,9 +29,9 @@ USE_RC_SUBR?= ${PORTNAME} NO_BUILD= yes OPENACS_USER?= ${PORTNAME} -OPENACS_DB?= ${PORTNAME} -OPENACS_GROUP?= www +OPENACS_GROUP?= ${PORTNAME} PGUSER?= pgsql +OPENACS_DB?= ${PORTNAME} OPENACSBASE?= ${PREFIX}/openacs OPENACSNAME?= OpenACS SU?= /usr/bin/su @@ -53,7 +55,27 @@ OPTIONS= EXAMPLES "Install various example files" on \ .include <bsd.port.pre.mk> -SUB_LIST+= OPENACS_USER=${OPENACS_USER} OPENACS_GROUP=${OPENACS_GROUP} \ +# Parse ${PORTSDIR}/UIDs and GIDs for the defaults +USER!= ${GREP} -E '^${OPENACS_USER}:' ${PORTSDIR}/UIDs | \ + ${SED} -Ee 's/^([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)$$/USER="\1" UID="\3" GECOS="\5" HOME="\6" SHELL="\7"/' +GROUP!= ${GREP} -E '^${OPENACS_GROUP}:' ${PORTSDIR}/GIDs | \ + ${SED} -Ee 's/^([^:]*):([^:]*):([^:]*):$$/GROUP="\1" GID="\3"/' + +# Apply the defaults where necessary +OPENACS_USER?= ${USER:MUSER*:C/^[^=]*=\"([^\"]*)\"$/\1/} +OPENACS_UID?= ${USER:MUID*:C/^[^=]*=\"([^\"]*)\"$/\1/} +OPENACS_GECOS?= ${USER:MGECOS*:C/^[^=]*=\"([^\"]*)\"$/\1/} +OPENACS_HOME?= ${USER:MHOME*:C/^[^=]*=\"([^\"]*)\"$/\1/} +OPENACS_SHELL?= ${USER:MSHELL*:C/^[^=]*=\"([^\"]*)\"$/\1/} +OPENACS_GROUP?= ${GROUP:MGROUP*:C/^[^=]*=\"([^\"]*)\"$/\1/} +OPENACS_GID?= ${GROUP:MGID*:C/^[^=]*=\"([^\"]*)\"$/\1/} + +SUB_LIST+= OPENACS_USER=${OPENACS_USER} OPENACS_UID=${OPENACS_UID} \ + OPENACS_GECOS="${OPENACS_GECOS}" \ + OPENACS_HOME="${OPENACS_HOME}" \ + OPENACS_SHELL="${OPENACS_SHELL}" \ + OPENACS_GROUP=${OPENACS_GROUP} \ + OPENACS_GID=${OPENACS_GID} \ OPENACSBASE=${OPENACSBASE} OPENACS_DB=${OPENACS_DB} \ PGUSER=${PGUSER} AOLSERVERBASE=${AOLSERVERBASE} \ PORTNAME=${PORTNAME} OPENACSNAME=${OPENACSNAME} \ @@ -71,17 +93,19 @@ RUN_DEPENDS+= ${LOCALBASE}/bin/tclwebtest:${PORTSDIR}/www/tclwebtest 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 + -e 's|/var/www/$${server}|${OPENACSBASE}|' \ + -e 's|/usr/lib/aolserver4|${AOLSERVERBASE}|' \ + -e 's|127.0.0.1|0.0.0.0|' \ + ${WRKSRC}/etc/config.tcl > ${WRKDIR}/${PORTNAME}-config.tcl 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/${PREFIX}\///}|' > ${PLIST} - @ ${ECHO} ${OPENACSBASE:S/${PREFIX}\///}/etc/${PORTNAME}-config.tcl >> ${PLIST} - @ ${ECHO} @dirrm ${OPENACSBASE:S/${PREFIX}\///}/etc >> ${PLIST} + @ ${ECHO} @exec if ! [ -f ${OPENACSBASE:S/%D\///}/etc/${PORTNAME}-config.tcl ] \; then ${CP} %D/%%EXAMPLESDIR%%/config.tcl %D/${OPENACSBASE:S/${PREFIX}\///}/etc/${PORTNAME}-config.tcl \; fi >> ${PLIST} + @ ${ECHO} @unexec if cmp -hsz %D/%%EXAMPLESDIR%%/config.tcl %D/${OPENACSBASE:S/${PREFIX}\///}/etc/${PORTNAME}-config.tcl \; then ${RM} %D/${OPENACSBASE:S/${PREFIX}\///}/etc/${PORTNAME}-config.tcl \; fi >> ${PLIST} + @ ${ECHO} @dirrmtry ${OPENACSBASE:S/${PREFIX}\///}/etc >> ${PLIST} @ ${FIND} ${WRKSRC} -type d ! -path '${WRKSRC}/etc*' | \ ${SORT} -r | \ ${SED} 's|${WRKSRC}|@dirrmtry ${OPENACSBASE:S/${PREFIX}\///}|' >> ${PLIST} @@ -104,7 +128,10 @@ do-install: @ ${TAR} -c -C ${WRKSRC}/etc -f - . | ${TAR} -x -C ${EXAMPLESDIR} -f - .endif @ ${ECHO} "Installing sample configuration file" - @ ${INSTALL_DATA} ${WRKDIR}/openacs-config.tcl ${OPENACSBASE}/etc/${PORTNAME}-config.tcl + @ ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}-config.tcl ${EXAMPLESDIR}/config.tcl + @ if ! [ -f ${OPENACSBASE}/etc/${PORTNAME}-config.tcl ]; then \ + ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}-config.tcl ${OPENACSBASE}/etc/${PORTNAME}-config.tcl ; \ + fi .if !defined(NOPORTDOCS) @ ${ECHO} "Installing docs" @ ${MKDIR} ${DOCSDIR} diff --git a/www/openacs/distinfo b/www/openacs/distinfo index cd98bec1390a..a4a81574e528 100644 --- a/www/openacs/distinfo +++ b/www/openacs/distinfo @@ -1,3 +1,3 @@ -MD5 (openacs-5-3-2.tgz?revision_id=1098887) = 5f83e9c5b2d9e83c84f78675dd690239 -SHA256 (openacs-5-3-2.tgz?revision_id=1098887) = a59e6aafb92596901f1738b64c461e1091f8e08ffa59a304d29676ac2233de29 -SIZE (openacs-5-3-2.tgz?revision_id=1098887) = 7327073 +MD5 (openacs-5.4.1b1.tgz?revision_id=1474805) = d8e2395aec35353a15a6e271a853863d +SHA256 (openacs-5.4.1b1.tgz?revision_id=1474805) = d9f686d5436f7e5f151e4666d0953bf35e4a0b6e44be9cf9a44dcf5c8523d4bc +SIZE (openacs-5.4.1b1.tgz?revision_id=1474805) = 8730080 diff --git a/www/openacs/files/pkg-deinstall.in b/www/openacs/files/pkg-deinstall.in index 45d415d2b888..1d464d82ef75 100644 --- a/www/openacs/files/pkg-deinstall.in +++ b/www/openacs/files/pkg-deinstall.in @@ -12,12 +12,18 @@ OPENACSBASE=%%OPENACSBASE%% PW=%%PW%% if ${PW} usershow "${OPENACS_USER}" 2>/dev/null 1>&2; then - echo "To delete ${OPENACS_USER} user permanently, use '${PW} userdel \"${OPENACS_USER}\"'" + echo "" + echo "To delete ${OPENACS_USER} user permanently, use the following command:" + echo "${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}\"'" + echo "" + echo "To delete ${OPENACS_GROUP} group permanently, use the following command:" + echo "${PW} groupdel \"${OPENACS_GROUP}\"" fi if test -d "${OPENACSBASE}"; then - echo "You may need to remove ${OPENACSBASE} manually." + echo "" + echo "Directory ${OPENACSBASE} is not empty, you may want to check its contents" + echo "and remove it manually." fi exit 0 diff --git a/www/openacs/files/pkg-install.in b/www/openacs/files/pkg-install.in index b75f60a97365..1cce0bc9d8a7 100644 --- a/www/openacs/files/pkg-install.in +++ b/www/openacs/files/pkg-install.in @@ -5,34 +5,88 @@ if [ "$2" != "POST-INSTALL" ]; then exit 0 fi -OPENACS_GROUP=%%OPENACS_GROUP%% -OPENACS_USER=%%OPENACS_USER%% -OPENACSBASE=%%OPENACSBASE%% +OPENACSBASE="%%OPENACSBASE%%" + +openacs_user="%%OPENACS_USER%%" +openacs_uid="%%OPENACS_UID%%" +openacs_group="%%OPENACS_GROUP%%" +openacs_gid="%%OPENACS_GID%%" +openacs_gecos="%%OPENACS_GECOS%%" +openacs_home="%%OPENACS_HOME%%" +openacs_shell="%%OPENACS_SHELL%%" CHMOD=%%CHMOD%% CHOWN=%%CHOWN%% PW=%%PW%% -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 +create_group() { + local group gid -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 - echo "Seting permissions of files" - ${CHMOD} -R 770 ${OPENACSBASE} - ${CHOWN} -R ${OPENACS_USER}:${OPENACS_GROUP} ${OPENACSBASE} + group=$1 + gid=$2 + + + if ${PW} group show -n $group >/dev/null 2>&1 ; then + echo "===> Using existing group $group" + else + if ${PW} groupadd -n $group -g $gid ; then + echo "===> Created group $group" + else + cat <<-EOERRORMSG +*** Failed to create group $group. + +Please add user $user and group $group +manually with the following commands: + + ${PW} groupadd -n $group -g $gid + ${PW} useradd -n $user -u $uid -g $group -c "$gecos" \\ + -d $home -s $shell -h - + +and retry installing this package. +EOERRORMSG + exit 1 + fi + fi + +} + + +create_user() { + local user uid group gecos home shell + + user=$1 + uid=$2 + group=$3 + gecos=$4 + home=$5 + shell=$6 + + if ${PW} user show -n $user >/dev/null 2>&1 ; then + echo "===> Using existing user $user" + else + if ${PW} useradd -n $user -u $uid -g $group -c "$gecos" \ + -d "$home" -s "$shell" -h - ; then + echo "===> Created user $user" + else + cat <<-EOERRORMSG +*** Failed to create user $user. + +Please add user $user manually with the following command: + + ${PW} useradd -n $user -u $uid -g $group -c "$gecos" \\ + -d $home -s $shell -h - + +and retry installing this package. +EOERRORMSG + exit 1 + fi + fi +} + +create_group $openacs_group $openacs_gid +create_user $openacs_user $openacs_uid $openacs_group \ + "$openacs_gecos" "$openacs_home" "$openacs_shell" +echo "===> Changing ownership of ${OPENACSBASE}" +${CHOWN} -R ${openacs_user}:${openacs_group} ${OPENACSBASE} +echo "===> Changing permissions of ${OPENACSBASE}" +${CHMOD} -R 770 ${OPENACSBASE} |