From owner-freebsd-java Wed Oct 3 6: 5:38 2001 Delivered-To: freebsd-java@freebsd.org Received: from zaphod.euronet.nl (zaphod.euronet.nl [194.134.128.241]) by hub.freebsd.org (Postfix) with ESMTP id 9C0AC37B403; Wed, 3 Oct 2001 06:05:07 -0700 (PDT) Received: (from ernst@localhost) by zaphod.euronet.nl (8.11.6/8.11.6) id f92HF5D31245; Tue, 2 Oct 2001 19:15:05 +0200 (CEST) (envelope-from ernst) Date: Tue, 2 Oct 2001 19:15:05 +0200 (CEST) Message-Id: <200110021715.f92HF5D31245@zaphod.euronet.nl> To: FreeBSD-gnats-submit@freebsd.org Subject: Maintainer update: www/orion (1.4.5_7) From: Ernst de Haan Reply-To: Ernst de Haan Cc: java@freebsd.org, sobomax@freebsd.org, jeh@freebsd.org X-send-pr-version: 3.113 X-GNATS-Notify: Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Submitter-Id: current-users >Originator: Ernst de Haan >Organization: Jollem Information Technology >Confidential: no >Synopsis: Maintainer update: www/orion (1.4.5_7) >Severity: non-critical >Priority: medium >Category: ports >Class: maintainer-update >Release: FreeBSD 4.4-STABLE i386 >Environment: System: FreeBSD zaphod.euronet.nl 4.4-STABLE FreeBSD 4.4-STABLE #2: Mon Sep 24 18:08:27 CEST 2001 root@zaphod.euronet.nl:/usr/obj/usr/src/sys/ZAPHOD i386 >Description: Update of the Orion J2EE Application Server port. Still based on Orion 1.4.5. Changes: * Bumped PORTREVISION to 7 * Creating a group 'orion' and a user 'orion' when installing, and removing these when deinstalling. Orion now runs as this user. * Orion now by default listens to port 7104 instead of 80, this can be configured using the LISTEN_PORT option * Now using the FreeBSD JDK 1.3.1 by default, instead of the Sun Linux JDK 1.3.1, this can be configured using the JAVA_HOME option * Now configuring Orion for use with Jikes by default. This can be disabled by using WITH_JIKES=NO * Now automatically starting Orion after installation, this can be disabled with the option AUTO_START=NO >How-To-Repeat: N/A >Fix: diff -ruN --exclude=work --exclude=CVS --exclude=README.html /usr/ports/www/orion/Makefile /home/ernst/freebsd-ports/www/orion/Makefile --- /usr/ports/www/orion/Makefile Wed Jun 27 03:51:26 2001 +++ /home/ernst/freebsd-ports/www/orion/Makefile Tue Oct 2 19:02:57 2001 @@ -7,7 +7,7 @@ PORTNAME= orion PORTVERSION= 1.4.5 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= www java MASTER_SITES= ftp://ftp.sunet.se/pub/database/utils/orionserver/ \ ${MASTER_SITE_LOCAL} \ @@ -18,7 +18,7 @@ MAINTAINER= ernst@jollem.com -RUN_DEPENDS= ${JAVA_HOME}/bin/java:${PORTSDIR}/java/linux-jdk13 +RUN_DEPENDS= ${JAVA_HOME}/bin/java:${PORTSDIR}/java/jdk13 USE_ZIP= YES NO_BUILD= YES @@ -30,36 +30,104 @@ ORIONCTL_NAME= orionctl ORIONCTL_DEST= ${PREFIX}/bin/${ORIONCTL_NAME} RC_SCRIPT= ${PREFIX}/etc/rc.d/${PORTNAME}.sh -JAVA_HOME?= ${LOCALBASE}/linux-jdk1.3.1 +JAVA_HOME?= ${LOCALBASE}/jdk1.3.1 +JIKES_LOCATION= ${LOCALBASE}/bin/jikes +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} +PW?= /usr/sbin/pw +LISTEN_PORT?= 8090 +AUTO_START?= YES .include +pre-install: + @${ECHO} "Installation settings:" + @${ECHO} " Destination directory: ${ORION_HOME}" + @${ECHO} " Control script location: ${ORIONCTL_DEST}" + @${ECHO} " Startup script location: ${RC_SCRIPT}" + @${ECHO} " Startup script location: ${RC_SCRIPT}" + @${ECHO} " Location of JDK: ${JAVA_HOME}" + @${ECHO} " Using Jikes: ${WITH_JIKES}" + @${ECHO} " Running as (user/group): ${USER_NAME}/${GROUP_NAME} (${USER_ID}:${GROUP_ID})" + @${ECHO} " Port to listen at: ${LISTEN_PORT}" + @${ECHO} " Starting after install: ${AUTO_START}" + 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 "Orion Server account" -d ${ORION_HOME} -s ${SH} -h - || true + + @# Create the destination directory for Orion ${MKDIR} ${ORION_HOME} + + @# Copy all files and make them rwxr-xr-x ${CP} -R ${WRKSRC}/* ${ORION_HOME} ${CHMOD} 755 `find ${ORION_HOME} -type d` + + @# Configure for use of Jikes, if necessary +.if ${WITH_JIKES} == "YES" + ${CAT} ${WRKSRC}/config/server.xml \ + | ${SED} "/\/s//\/" \ + > ${ORION_HOME}/config/server.xml +.endif + + @# Configure the port to listen to + ${CAT} ${WRKSRC}/config/default-web-site.xml \ + | ${SED} "/port=\"80\"/s//port=\"${LISTEN_PORT}\"/" \ + > ${ORION_HOME}/config/default-web-site.xml + + @# Install the 'orionctl' script ${CAT} ${FILESDIR}/${ORIONCTL_NAME} \ | ${SED} "/%%PORTNAME%%/s//${PORTNAME}/" \ | ${SED} "/%%PORTVERSION%%/s//${PORTVERSION}/" \ | ${SED} "/%%ORION_HOME%%/s//${ORION_HOME:S/\//\\\//g}/" \ | ${SED} "/%%RC_SCRIPT_NAME%%/s//${PORTNAME}.sh/" \ | ${SED} "/%%JAVA_HOME%%/s//${JAVA_HOME:S/\//\\\//g}/" \ + | ${SED} "/%%USER_NAME%%/s//${USER_NAME}/" \ > ${ORIONCTL_DEST} - ${CAT} ${FILESDIR}/${ORIONCTL_NAME}.1 \ - | ${SED} "/%%PREFIX%%/s//${PREFIX:S/\//\\\//g}/" \ - > ${WRKDIR}/${ORIONCTL_NAME}.1 ${CHMOD} 755 ${ORIONCTL_DEST} + + @# Fix a small typo in the index.html served as the root + ${CAT} ${WRKSRC}/default-web-app/index.html \ + | ${SED} "/1\.4\.0/s//${PORTVERSION}/" \ + > ${ORION_HOME}/default-web-app/index.html + + @# Install the startup script ${LN} -sf ${ORIONCTL_DEST} ${RC_SCRIPT} + + @# Create the 'application-deployments' directory, since Orion will + @# otherwise create it when it is first run ${MKDIR} ${ORION_HOME}/application-deployments + + @# Install the tools.jar file from the JDK, since it is needed by Orion ${LN} -sf ${JAVA_HOME}/lib/tools.jar ${ORION_HOME}/tools.jar + + @# Change ownership for the files + ${CHOWN} -R ${USER_NAME}:${GROUP_NAME} ${ORION_HOME} + + @# Install the man page .if !defined(NOPORTDOCS) - ${INSTALL_MAN} ${WRKDIR}/orionctl.1 ${MANPREFIX}/man/man1 + ${CAT} ${FILESDIR}/${ORIONCTL_NAME}.1 \ + | ${SED} "/%%PREFIX%%/s//${PREFIX:S/\//\\\//g}/" \ + > ${WRKDIR}/${ORIONCTL_NAME}.1 + ${INSTALL_MAN} ${WRKDIR}/${ORIONCTL_NAME}.1 ${MANPREFIX}/man/man1 .endif post-install: @${ECHO} "${PORTTITLE} ${PORTVERSION} has been installed in ${ORION_HOME}." .if !defined(NOPORTDOCS) @${ECHO} "Use 'man orionctl' for information about starting and stopping Orion." +.endif +.if ${AUTO_START} == "YES" + @${ECHO} -n "Starting..." + @${RC_SCRIPT} start + @${ECHO} "" .endif .include diff -ruN --exclude=work --exclude=CVS --exclude=README.html /usr/ports/www/orion/files/orionctl /home/ernst/freebsd-ports/www/orion/files/orionctl --- /usr/ports/www/orion/files/orionctl Tue Jun 12 12:20:48 2001 +++ /home/ernst/freebsd-ports/www/orion/files/orionctl Tue Oct 2 18:57:32 2001 @@ -1,9 +1,10 @@ #!/bin/sh -# Set some more variables +# Set some variables NAME=%%PORTNAME%% VERSION=%%PORTVERSION%% ORION_HOME=%%ORION_HOME%% +USER_NAME=%%USER_NAME%% LOG=${ORION_HOME}/log/${NAME}.log PID_FILE=/var/run/${NAME}.pid JAR_FILE=${ORION_HOME}/${NAME}.jar @@ -64,13 +65,16 @@ # Create the process ID file rm -f ${PID_FILE} touch ${PID_FILE} - chown root:wheel ${PID_FILE} + chown ${USER_NAME} ${PID_FILE} chmod 600 ${PID_FILE} if [ "${AS_RC_SCRIPT}" = "yes" ]; then echo -n " ${NAME}" fi - ( cd ${ORION_HOME} && ${JAVA_CMD} -jar orion.jar & echo $! > ${PID_FILE} ) > ${LOG} 2>&1 + touch ${PID_FILE} + chown ${USER_NAME} ${PID_FILE} + chmod 600 ${PID_FILE} + su - ${USER_NAME} -c "(cd ${ORION_HOME} && ${JAVA_CMD} -jar orion.jar & echo \$! > ${PID_FILE}) > ${LOG} 2>&1" ;; stop) if [ ! -e ${PID_FILE} ]; then diff -ruN --exclude=work --exclude=CVS --exclude=README.html /usr/ports/www/orion/pkg-plist /home/ernst/freebsd-ports/www/orion/pkg-plist --- /usr/ports/www/orion/pkg-plist Wed Jun 27 02:15:07 2001 +++ /home/ernst/freebsd-ports/www/orion/pkg-plist Tue Oct 2 14:29:19 2001 @@ -394,3 +394,5 @@ @dirrm %%T%%/persistence/ejb @dirrm %%T%%/persistence @dirrm %%T%% +@unexec pw groupdel orion || true +@unexec pw userdel orion || true To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message