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
This commit is contained in:
Ernst de Haan 2002-03-04 23:19:12 +00:00
parent 55acf188d0
commit 4b972fc880
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=55540
6 changed files with 112 additions and 42 deletions

View File

@ -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
@# Create the destination directory
${MKDIR} ${APP_HOME}

View File

@ -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

View File

@ -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

View File

@ -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
@# Create the destination directory
${MKDIR} ${APP_HOME}

46
www/orion/pkg-install Normal file
View File

@ -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

View File

@ -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