aboutsummaryrefslogtreecommitdiff
path: root/www/resin2/files
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2003-11-20 21:25:09 +0000
committerGreg Lewis <glewis@FreeBSD.org>2003-11-20 21:25:09 +0000
commit5dce3730a4e662e410e2e6f34b852f3a1006362f (patch)
treeab08231cf6ee1289189f71303cfd80a8d9700f5c /www/resin2/files
parentf26d6afd7ed3498e67df145b94418c6792794655 (diff)
downloadports-5dce3730a4e662e410e2e6f34b852f3a1006362f.tar.gz
ports-5dce3730a4e662e410e2e6f34b852f3a1006362f.zip
Notes
Diffstat (limited to 'www/resin2/files')
-rw-r--r--www/resin2/files/install.sh48
-rw-r--r--www/resin2/files/patch-apache-Makefile.in12
-rw-r--r--www/resin2/files/patch-apache2-Makefile.in12
-rw-r--r--www/resin2/files/patch-wrapper8
-rw-r--r--www/resin2/files/pkg-deinstall52
-rw-r--r--www/resin2/files/pkg-install50
-rw-r--r--www/resin2/files/pkg-message.in4
-rw-r--r--www/resin2/files/resin.sh.in53
8 files changed, 239 insertions, 0 deletions
diff --git a/www/resin2/files/install.sh b/www/resin2/files/install.sh
new file mode 100644
index 000000000000..36e53c1e9bac
--- /dev/null
+++ b/www/resin2/files/install.sh
@@ -0,0 +1,48 @@
+#! /bin/sh
+
+set -e
+
+warning() {
+ echo "Kept %%PREFIX%%/etc/%%APP_NAME%%.xml intact from previous installation, please diff"
+ echo "against %%APP_NAME%%.xml-dist"
+}
+
+# Install config file only if none is already there
+if test -e %%PREFIX%%/etc/%%APP_NAME%%.xml && \
+ ! cmp -s %%WRKDIR%%/resin.conf %%PREFIX%%/etc/%%APP_NAME%%.xml ; then
+ echo
+ echo "********************************************************************************"
+ warning | fmt -w 80
+ echo "********************************************************************************"
+ echo
+else
+ install %%WRKDIR%%/resin.conf %%PREFIX%%/etc/%%APP_NAME%%.xml
+ echo Installed %%PREFIX%%/etc/%%APP_NAME%%.xml
+fi
+
+# Install new config file with '-dist' appended
+install %%WRKDIR%%/resin.conf %%PREFIX%%/etc/%%APP_NAME%%.xml-dist
+echo Installed %%PREFIX%%/etc/%%APP_NAME%%.xml-dist
+
+install %%WRKDIR%%/resin.sh.in %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh
+chmod 755 %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh
+echo Installed %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh
+
+install %%WRKSRC%%/bin/wrapper.pl %%PREFIX%%/sbin/%%APP_NAME%%ctl
+echo Installed %%PREFIX%%/sbin/%%APP_NAME%%ctl
+
+test -d %%APP_HOME%% || mkdir %%APP_HOME%%
+echo Created installation directory %%APP_HOME%%
+
+list()
+{
+ for dir in doc lib xsl ; do
+ ( cd %%WRKSRC%% ; find $dir )
+ done
+}
+
+# Remove all empty dirs
+( cd %%WRKSRC%% ; find doc -type d -empty -delete )
+
+echo Installing in %%APP_HOME%%
+list | xargs tar -C %%WRKSRC%% -cf- | tar -C %%APP_HOME%% -xpf-
diff --git a/www/resin2/files/patch-apache-Makefile.in b/www/resin2/files/patch-apache-Makefile.in
new file mode 100644
index 000000000000..4b10a88f34b5
--- /dev/null
+++ b/www/resin2/files/patch-apache-Makefile.in
@@ -0,0 +1,12 @@
+--- src/c/plugin/apache/Makefile.in.orig Thu Nov 13 09:27:52 2003
++++ src/c/plugin/apache/Makefile.in Thu Nov 13 09:28:36 2003
+@@ -28,8 +28,7 @@
+ $(CC) -c $(INCLUDES) $(CFLAGS) $<
+
+ install :
+- sh install.sh -conf $(apache_conf) -libexec $(apache_libexec) \
+- -resin_home $(resin_home)
++ %%APXS%% -i -a -n caucho mod_caucho.so
+
+ clean :
+ - rm *.o *.lo *.la *.so
diff --git a/www/resin2/files/patch-apache2-Makefile.in b/www/resin2/files/patch-apache2-Makefile.in
new file mode 100644
index 000000000000..18707a7a3f77
--- /dev/null
+++ b/www/resin2/files/patch-apache2-Makefile.in
@@ -0,0 +1,12 @@
+--- src/c/plugin/apache2/Makefile.in.orig Thu Nov 13 09:28:46 2003
++++ src/c/plugin/apache2/Makefile.in Thu Nov 13 09:28:52 2003
+@@ -27,8 +27,7 @@
+ $(CC) -c $(INCLUDES) $(CFLAGS) $<
+
+ install :
+- sh install.sh -conf $(apache_conf) -libexec $(apache_libexec) \
+- -resin_home $(resin_home)
++ %%APXS%% -i -a -n caucho mod_caucho.so
+
+ clean :
+ - rm *.o *.lo *.so
diff --git a/www/resin2/files/patch-wrapper b/www/resin2/files/patch-wrapper
new file mode 100644
index 000000000000..7d3f9aadfb18
--- /dev/null
+++ b/www/resin2/files/patch-wrapper
@@ -0,0 +1,8 @@
+--- bin/wrapper.pl.in.orig Sat Oct 4 09:45:23 2003
++++ bin/wrapper.pl.in Sat Oct 4 09:45:43 2003
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! %%PERL%%
+ #
+ # Copyright(c) 1998-2002 Caucho Technology
+ #
diff --git a/www/resin2/files/pkg-deinstall b/www/resin2/files/pkg-deinstall
new file mode 100644
index 000000000000..4b26efbd1c37
--- /dev/null
+++ b/www/resin2/files/pkg-deinstall
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# This script does the following.
+#
+# * Checks if the PID file exists. If it does, it kills the
+# process and removes the PID file.
+#
+# * Checks if the 'www' user exists. If it does, then it displays
+# a message.
+#
+# $FreeBSD: /tmp/pcvs/ports/www/resin2/files/Attic/pkg-deinstall,v 1.1 2003-11-20 21:25:09 glewis Exp $
+#
+# Borrowed from the jakarta-tomcat port
+#
+
+set -e
+
+PID_FILE=%%PID_FILE%%
+RUNASUSER=%%RUNASUSER%%
+
+# Make sure we're in the right stage of the process
+if [ "$2" = "DEINSTALL" ]; then
+
+ # Kill the process if it is still running
+ if [ -s ${PID_FILE} ]; then
+ PID=`cat ${PID_FILE}`
+ echo -n ">> Killing %%APP_NAME%% process (${PID})..."
+
+ if /bin/kill ${PID} > /dev/null 2> /dev/null ; then
+ echo " [ DONE ]"
+ else
+ echo " [ FAILED ]"
+ fi
+
+ echo -n ">> Removing PID file (${PID_FILE})..."
+
+ if rm ${PID_FILE} > /dev/null 2> /dev/null ; then
+ echo " [ DONE ]"
+ else
+ echo " [ FAILED ]"
+ fi
+ fi
+fi
+
+if [ "$2" = "POST-DEINSTALL" ]; then
+ # If the user exists, then display a message
+ if pw usershow "$RUNASUSER" 2>/dev/null 1>&2; then
+ echo "To delete the $RUNASUSER user permanently, use 'pw userdel $RUNASUSER'"
+ fi
+fi
+
+exit 0
diff --git a/www/resin2/files/pkg-install b/www/resin2/files/pkg-install
new file mode 100644
index 000000000000..99cf5f46910a
--- /dev/null
+++ b/www/resin2/files/pkg-install
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Checks if the requested user and group exist. If they don't, then
+# an attempt is made to create both.
+#
+# $FreeBSD: /tmp/pcvs/ports/www/resin2/files/Attic/pkg-install,v 1.1 2003-11-20 21:25:09 glewis Exp $
+#
+# Borrowed from the jakarta-tomcat port
+#
+
+set -e
+
+RUNASUSER=%%RUNASUSER%%
+RUNASUID=%%RUNASUID%%
+GROUP=%%GROUP%%
+GID=%%GID%%
+
+if [ "$2" = "POST-INSTALL" ]; then
+ # We're called after the 'make install' process
+ # 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 "${RUNASUSER}" 2>/dev/null 1>&2; then
+
+ # If not, try to create it
+ if pw useradd ${RUNASUSER} -u ${RUNASUID} -g ${GROUP} -h - \
+ -s "/sbin/nologin" -d "/nonexistent" \
+ -c "World Wide Web Owner"; \
+ then
+ echo "Added user \"${RUNASUSER}\"."
+ else
+ echo "Adding user \"${RUNASUSER}\" failed..."
+ exit 1
+ fi
+ fi
+
+ chown -R %%RUNASUSER%%:%%GROUP%% $PKG_PREFIX/%%APP_NAME%%
+fi
+
+exit 0
diff --git a/www/resin2/files/pkg-message.in b/www/resin2/files/pkg-message.in
new file mode 100644
index 000000000000..820698b9dda9
--- /dev/null
+++ b/www/resin2/files/pkg-message.in
@@ -0,0 +1,4 @@
+Resin is now installed in %%APP_HOME%%. You may want to start it using the
+startup script installed as %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh, and then point
+your web browser to the default home page at http://localhost:%%PORT%%/ to read
+the doc. Resin can be configured using %%PREFIX%%/etc/%%APP_NAME%%.xml.
diff --git a/www/resin2/files/resin.sh.in b/www/resin2/files/resin.sh.in
new file mode 100644
index 000000000000..3c44d001684c
--- /dev/null
+++ b/www/resin2/files/resin.sh.in
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Resin startup script.
+#
+# Borrowed from jakarta-tomcat41
+#
+# $FreeBSD$
+#
+
+# Determine PREFIX
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+# Set some variables
+MYSELF=`basename $0`
+ARGS="-conf $PREFIX/etc/%%APP_NAME%%.xml \
+-chdir \
+-name %%APP_NAME%% \
+-class com.caucho.server.http.HttpServer \
+-pid %%PID_FILE%%"
+PATH=/usr/sbin:/usr/bin:/bin
+
+export JAVA_HOME=%%JAVA_HOME%%
+export RESIN_HOME=$PREFIX/%%APP_NAME%%
+
+set -e
+
+case "$1" in
+ start)
+ echo -n ' '
+ truncate -s 0 %%PID_FILE%%
+ chown %%RUNASUSER%%:%%GROUP%% %%PID_FILE%%
+ chmod 600 %%PID_FILE%%
+ su -f -m %%RUNASUSER%% -c "exec $PREFIX/sbin/%%APP_NAME%%ctl $ARGS start" \
+ >/dev/null && echo -n '%%APP_NAME%%'
+ ;;
+
+ stop)
+ echo -n ' '
+ chown %%RUNASUSER%%:%%GROUP%% %%PID_FILE%%
+ chmod 600 %%PID_FILE%%
+ su -f -m %%RUNASUSER%% -c "exec $PREFIX/sbin/%%APP_NAME%%ctl $ARGS stop" \
+ >/dev/null 2>&1 ; echo -n '%%APP_NAME%%'
+ ;;
+ *)
+ echo ""
+ echo "Usage: ${MYSELF} { start | stop }"
+ echo ""
+ exit 64
+ ;;
+esac