From 4b972fc88040b49d3680b574cb3f714739475d48 Mon Sep 17 00:00:00 2001 From: Ernst de Haan Date: Mon, 4 Mar 2002 23:19:12 +0000 Subject: Changes: 0) Uses 'www' user and group instead of 'orion' user and group 1) Added pkg-install to add www user and group if necessary 2) Fixed STARTUP_ORDER at 020 because the pkg-plist supports no other value 3) Executing pkg-install from the pre-install target 4) Fixed the pkg-plist (it's different because Orion is not automatically started and it creates some files at first startup) 5) Bumped PORTREVISION to 3 --- www/orion-devel/Makefile | 18 +++++++----------- www/orion-devel/pkg-install | 46 +++++++++++++++++++++++++++++++++++++++++++++ www/orion-devel/pkg-plist | 13 +++---------- www/orion/Makefile | 18 +++++++----------- www/orion/pkg-install | 46 +++++++++++++++++++++++++++++++++++++++++++++ www/orion/pkg-plist | 13 +++---------- 6 files changed, 112 insertions(+), 42 deletions(-) create mode 100644 www/orion-devel/pkg-install create mode 100644 www/orion/pkg-install diff --git a/www/orion-devel/Makefile b/www/orion-devel/Makefile index 0be9a410715b..6f37a99ec6e1 100644 --- a/www/orion-devel/Makefile +++ b/www/orion-devel/Makefile @@ -7,7 +7,7 @@ PORTNAME= orion PORTVERSION= 1.5.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www java MASTER_SITES= http://www.orionserver.com/distributions/ \ http://www.atlassian.com/software/orion/downloads/ \ @@ -32,7 +32,7 @@ APP_TITLE= Orion Server APP_SHORTNAME= ${PORTNAME} APPCTL_NAME= ${APP_SHORTNAME}ctl CTL_SCRIPT= ${PREFIX}/bin/${APPCTL_NAME} -STARTUP_ORDER?= 020 +STARTUP_ORDER= 020 RC_SCRIPT= ${PREFIX}/etc/rc.d/${STARTUP_ORDER}.${PORTNAME}.sh JAVA_HOME?= ${LOCALBASE}/jdk1.3.1 JAVA_PORT?= ${PORTSDIR}/java/jdk13 @@ -41,10 +41,8 @@ WITH_JIKES?= YES .if ${WITH_JIKES} == "YES" RUN_DEPENDS+= ${JIKES_LOCATION}:${PORTSDIR}/java/jikes .endif -USER_NAME?= ${PORTNAME} -GROUP_NAME?= ${USER_NAME} -USER_ID?= 7104 -GROUP_ID?= ${USER_ID} +USER_NAME= www +GROUP_NAME= www PW?= /usr/sbin/pw HTTP_PORT?= 8090 RMI_PORT?= 23791 @@ -58,16 +56,14 @@ pre-install: @${ECHO} " Location of JDK: ${JAVA_HOME}" @${ECHO} " Location of Java port: ${JAVA_PORT}" @${ECHO} " Using Jikes: ${WITH_JIKES}" - @${ECHO} " Running as (user/group): ${USER_NAME}/${GROUP_NAME} (${USER_ID}:${GROUP_ID})" + @${ECHO} " Running as (user/group): ${USER_NAME}/${GROUP_NAME}" @${ECHO} " HTTP port: ${HTTP_PORT}" @${ECHO} " RMI port: ${RMI_PORT}" @${ECHO} " Starting after install: ${AUTO_START}" + PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL -do-install: - @# Add the group and the user if they do not exist - ${PW} groupadd -n ${GROUP_NAME} -g ${GROUP_ID} || true - ${PW} useradd -n ${USER_NAME} -u ${USER_ID} -g ${GROUP_NAME} -c "${APP_TITLE} account" -d ${APP_HOME} -s ${SH} -h - || true +do-install: @# Create the destination directory ${MKDIR} ${APP_HOME} diff --git a/www/orion-devel/pkg-install b/www/orion-devel/pkg-install new file mode 100644 index 000000000000..687ec3fc1f9e --- /dev/null +++ b/www/orion-devel/pkg-install @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Checks if the 'www' user and group exist. If they don't, then +# an attempt is made to create both. +# +# $FreeBSD$ +# + +# Make sure we're called during the 'make install' process +if [ "$2" != "PRE-INSTALL" ]; then + exit 0 +fi + +# Set some constants +USER=www +GROUP=${USER} +UID=80 +GID=${UID} + +# See if the group already exists +if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then + + # If not, try to create it + if pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi +fi + +# See if the user already exists +if ! pw usershow "${USER}" 2>/dev/null 1>&2; then + + # If not, try to create it + if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" \ + -c "World Wide Web Owner"; \ + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi +fi +exit 0 diff --git a/www/orion-devel/pkg-plist b/www/orion-devel/pkg-plist index 0441fb417a96..328df7018e36 100644 --- a/www/orion-devel/pkg-plist +++ b/www/orion-devel/pkg-plist @@ -1,9 +1,5 @@ -etc/rc.d/orion.sh +etc/rc.d/020.orion.sh bin/orionctl -%%T%%/application-deployments/default/defaultWebApp/ -%%T%%/application-deployments/default/defaultWebApp/orion-web.xml -%%T%%/application-deployments/default/defaultWebApp/persistence -%%T%%/application-deployments/default/defaultWebApp/persistence/state.ser %%T%%/config/database-schemas/hypersonic.xml %%T%%/config/database-schemas/ms-access.xml %%T%%/config/database-schemas/ms-sql.xml @@ -322,9 +318,8 @@ bin/orionctl %%T%%/orion.jar %%T%%/tools.jar %%T%%/mail.jar -@dirrm %%T%%/application-deployments/default/defaultWebApp/persistence -@dirrm %%T%%/application-deployments/default/defaultWebApp -@dirrm %%T%%/application-deployments/default +%%T%%/crimson.jar +%%T%%/jaas.jar @dirrm %%T%%/application-deployments @dirrm %%T%%/config/database-schemas @dirrm %%T%%/config @@ -402,5 +397,3 @@ bin/orionctl @dirrm %%T%%/persistence/ejb @dirrm %%T%%/persistence @dirrm %%T%% -@unexec pw groupdel orion || true -@unexec pw userdel orion || true diff --git a/www/orion/Makefile b/www/orion/Makefile index 0be9a410715b..6f37a99ec6e1 100644 --- a/www/orion/Makefile +++ b/www/orion/Makefile @@ -7,7 +7,7 @@ PORTNAME= orion PORTVERSION= 1.5.2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www java MASTER_SITES= http://www.orionserver.com/distributions/ \ http://www.atlassian.com/software/orion/downloads/ \ @@ -32,7 +32,7 @@ APP_TITLE= Orion Server APP_SHORTNAME= ${PORTNAME} APPCTL_NAME= ${APP_SHORTNAME}ctl CTL_SCRIPT= ${PREFIX}/bin/${APPCTL_NAME} -STARTUP_ORDER?= 020 +STARTUP_ORDER= 020 RC_SCRIPT= ${PREFIX}/etc/rc.d/${STARTUP_ORDER}.${PORTNAME}.sh JAVA_HOME?= ${LOCALBASE}/jdk1.3.1 JAVA_PORT?= ${PORTSDIR}/java/jdk13 @@ -41,10 +41,8 @@ WITH_JIKES?= YES .if ${WITH_JIKES} == "YES" RUN_DEPENDS+= ${JIKES_LOCATION}:${PORTSDIR}/java/jikes .endif -USER_NAME?= ${PORTNAME} -GROUP_NAME?= ${USER_NAME} -USER_ID?= 7104 -GROUP_ID?= ${USER_ID} +USER_NAME= www +GROUP_NAME= www PW?= /usr/sbin/pw HTTP_PORT?= 8090 RMI_PORT?= 23791 @@ -58,16 +56,14 @@ pre-install: @${ECHO} " Location of JDK: ${JAVA_HOME}" @${ECHO} " Location of Java port: ${JAVA_PORT}" @${ECHO} " Using Jikes: ${WITH_JIKES}" - @${ECHO} " Running as (user/group): ${USER_NAME}/${GROUP_NAME} (${USER_ID}:${GROUP_ID})" + @${ECHO} " Running as (user/group): ${USER_NAME}/${GROUP_NAME}" @${ECHO} " HTTP port: ${HTTP_PORT}" @${ECHO} " RMI port: ${RMI_PORT}" @${ECHO} " Starting after install: ${AUTO_START}" + PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL -do-install: - @# Add the group and the user if they do not exist - ${PW} groupadd -n ${GROUP_NAME} -g ${GROUP_ID} || true - ${PW} useradd -n ${USER_NAME} -u ${USER_ID} -g ${GROUP_NAME} -c "${APP_TITLE} account" -d ${APP_HOME} -s ${SH} -h - || true +do-install: @# Create the destination directory ${MKDIR} ${APP_HOME} diff --git a/www/orion/pkg-install b/www/orion/pkg-install new file mode 100644 index 000000000000..687ec3fc1f9e --- /dev/null +++ b/www/orion/pkg-install @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Checks if the 'www' user and group exist. If they don't, then +# an attempt is made to create both. +# +# $FreeBSD$ +# + +# Make sure we're called during the 'make install' process +if [ "$2" != "PRE-INSTALL" ]; then + exit 0 +fi + +# Set some constants +USER=www +GROUP=${USER} +UID=80 +GID=${UID} + +# See if the group already exists +if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then + + # If not, try to create it + if pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi +fi + +# See if the user already exists +if ! pw usershow "${USER}" 2>/dev/null 1>&2; then + + # If not, try to create it + if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "/nonexistent" \ + -c "World Wide Web Owner"; \ + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi +fi +exit 0 diff --git a/www/orion/pkg-plist b/www/orion/pkg-plist index 0441fb417a96..328df7018e36 100644 --- a/www/orion/pkg-plist +++ b/www/orion/pkg-plist @@ -1,9 +1,5 @@ -etc/rc.d/orion.sh +etc/rc.d/020.orion.sh bin/orionctl -%%T%%/application-deployments/default/defaultWebApp/ -%%T%%/application-deployments/default/defaultWebApp/orion-web.xml -%%T%%/application-deployments/default/defaultWebApp/persistence -%%T%%/application-deployments/default/defaultWebApp/persistence/state.ser %%T%%/config/database-schemas/hypersonic.xml %%T%%/config/database-schemas/ms-access.xml %%T%%/config/database-schemas/ms-sql.xml @@ -322,9 +318,8 @@ bin/orionctl %%T%%/orion.jar %%T%%/tools.jar %%T%%/mail.jar -@dirrm %%T%%/application-deployments/default/defaultWebApp/persistence -@dirrm %%T%%/application-deployments/default/defaultWebApp -@dirrm %%T%%/application-deployments/default +%%T%%/crimson.jar +%%T%%/jaas.jar @dirrm %%T%%/application-deployments @dirrm %%T%%/config/database-schemas @dirrm %%T%%/config @@ -402,5 +397,3 @@ bin/orionctl @dirrm %%T%%/persistence/ejb @dirrm %%T%%/persistence @dirrm %%T%% -@unexec pw groupdel orion || true -@unexec pw userdel orion || true -- cgit v1.2.3