View | Details | Raw Unified | Return to bug 97023
Collapse All | Expand All

(-)./Makefile (-2 / +2 lines)
Lines 44-50 Link Here
44
		APP_HOME=${APP_HOME} \
44
		APP_HOME=${APP_HOME} \
45
		APP_NAME=${APP_NAME} \
45
		APP_NAME=${APP_NAME} \
46
		RC_SUBR=${RC_SUBR} \
46
		RC_SUBR=${RC_SUBR} \
47
		PREFIX=${PREFIX} \
48
		PORT=${PORT} \
47
		PORT=${PORT} \
49
		COCOON_LIB=${COCOON_LIB} \
48
		COCOON_LIB=${COCOON_LIB} \
50
		JAVA_HOME=${JAVA_HOME} \
49
		JAVA_HOME=${JAVA_HOME} \
Lines 62-67 Link Here
62
		pkg-deinstall \
61
		pkg-deinstall \
63
		${APP_NAME}ctl \
62
		${APP_NAME}ctl \
64
		${APP_NAME}.sh \
63
		${APP_NAME}.sh \
64
		upstreams-cocoon.sh \
65
		pkg-message
65
		pkg-message
66
66
67
# Load options (before including bsd.port.pre.mk)
67
# Load options (before including bsd.port.pre.mk)
Lines 126-134 Link Here
126
	@${ECHO_MSG} "===> Installing ${COPYDIRS}"
126
	@${ECHO_MSG} "===> Installing ${COPYDIRS}"
127
	@${MKDIR} ${APP_HOME}
127
	@${MKDIR} ${APP_HOME}
128
	@cd ${WRKSRC} && ${FIND} -H ${COPYDIRS} | ${CPIO} -pdmuL -R ${LIBOWN}:${LIBGRP} ${APP_HOME}
128
	@cd ${WRKSRC} && ${FIND} -H ${COPYDIRS} | ${CPIO} -pdmuL -R ${LIBOWN}:${LIBGRP} ${APP_HOME}
129
	@${INSTALL} ${WRKDIR}/upstreams-cocoon.sh ${APP_HOME}/cocoon.sh
129
130
130
	@${ECHO_MSG} "===> Installing into ${PREFIX}/sbin"
131
	@${ECHO_MSG} "===> Installing into ${PREFIX}/sbin"
131
	@${INSTALL_SCRIPT} ${WRKDIR}/${APP_NAME}.sh ${PREFIX}/sbin
132
	@${INSTALL_SCRIPT} ${WRKDIR}/${APP_NAME}ctl ${PREFIX}/sbin
132
	@${INSTALL_SCRIPT} ${WRKDIR}/${APP_NAME}ctl ${PREFIX}/sbin
133
133
134
	@${ECHO_MSG} "===> Installing ${PREFIX}/etc/rc.d/${APP_NAME}.sh"
134
	@${ECHO_MSG} "===> Installing ${PREFIX}/etc/rc.d/${APP_NAME}.sh"
(-)./files/cocoonctl.in (-1 / +1 lines)
Lines 140-146 Link Here
140
    APP_NAME = "%%APP_NAME%%"
140
    APP_NAME = "%%APP_NAME%%"
141
    APP_HOME = "%%APP_HOME%%"
141
    APP_HOME = "%%APP_HOME%%"
142
    PID_FILE = "%%PID_FILE%%"
142
    PID_FILE = "%%PID_FILE%%"
143
    COMMAND = "%%PREFIX%%/sbin/%%APP_NAME%%.sh"
143
    COMMAND = "%%APP_HOME%%/cocoon.sh"
144
    os.environ["JAVA_OPTIONS"] = " ".join(sys.argv[1:-1])
144
    os.environ["JAVA_OPTIONS"] = " ".join(sys.argv[1:-1])
145
    ARGS = [COMMAND, "servlet"]
145
    ARGS = [COMMAND, "servlet"]
146
146
(-)./files/patch-cocoon.sh (-32 lines)
Lines 1-32 Link Here
1
$FreeBSD: ports/www/cocoon/files/patch-cocoon.sh,v 1.2 2006/05/05 16:35:05 hq Exp $
2
3
--- cocoon.sh.orig	Thu Feb 12 09:48:55 2004
4
+++ cocoon.sh	Tue May  4 14:44:24 2004
5
@@ -57,8 +57,7 @@
6
 # ----- Verify and Set Required Environment Variables -------------------------
7
 
8
 if [ "$JAVA_HOME" = "" ] ; then
9
-  echo You must set JAVA_HOME to point at your Java Development Kit installation
10
-  exit 1
11
+  JAVA_HOME="%%JAVA_HOME%%"
12
 fi
13
 
14
 if [ "$JAVA_OPTIONS" = "" ] ; then
15
@@ -66,7 +65,7 @@
16
 fi
17
 
18
 if [ "$COCOON_HOME" = "" ] ; then
19
-  COCOON_HOME='.'
20
+  COCOON_HOME="%%APP_HOME%%"
21
 fi
22
 
23
 if [ "$COCOON_WEBAPP_HOME" = "" ] ; then
24
@@ -76,7 +75,7 @@
25
     COCOON_WEBAPP_HOME=$STANDALONE_WEBAPP
26
   else
27
     # when in the build environment
28
-    COCOON_WEBAPP_HOME="$COCOON_HOME/build/webapp"
29
+    COCOON_WEBAPP_HOME="$COCOON_HOME/webapp"
30
   fi
31
 fi
32
 echo "$0: using $COCOON_WEBAPP_HOME as the webapp directory"
(-)./files/upstreams-cocoon.sh.in (+204 lines)
Line 0 Link Here
1
#!/bin/sh
2
#  Copyright 1999-2004 The Apache Software Foundation
3
#
4
#  Licensed under the Apache License, Version 2.0 (the "License");
5
#  you may not use this file except in compliance with the License.
6
#  You may obtain a copy of the License at
7
#
8
#      http://www.apache.org/licenses/LICENSE-2.0
9
#
10
#  Unless required by applicable law or agreed to in writing, software
11
#  distributed under the License is distributed on an "AS IS" BASIS,
12
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
#  See the License for the specific language governing permissions and
14
#  limitations under the License.
15
#
16
# -----------------------------------------------------------------------------
17
# Cocoon Unix Shell Script
18
#
19
# $Id: cocoon.sh 389028 2006-03-27 06:21:40Z rgoers $
20
# -----------------------------------------------------------------------------
21
22
# Configuration variables
23
#
24
# COCOON_HOME
25
#   The root of the Cocoon distribution
26
#
27
# COCOON_WEBAPP_HOME
28
#   The root of the Cocoon web application
29
#
30
# COCOON_LIB
31
#   Folder containing all the library files needed by the Cocoon CLI
32
#
33
# JAVA_HOME
34
#   Home of Java installation.
35
#
36
# JAVA_OPTIONS
37
#   Extra options to pass to the JVM
38
#
39
# JAVA_DEBUG_ARGS
40
#   The command line arguments for the internal JVM debugger
41
#
42
# JAVA_PROFILE_ARGS
43
#   The command line arguments for the internal JVM profiler
44
#
45
# JETTY_PORT
46
#   Override the default port for Jetty
47
#
48
# JETTY_ADMIN_PORT
49
#   The port where the jetty web administration should bind
50
#
51
# LOADER_LIB
52
#   The classpath where to lookup the Loader class, defaults to
53
#   ${COCOON_HOME}/tools/loader
54
#
55
# CLI_CLASSPATH
56
#   The additional classpath for cli and precompile, defaults to
57
#   lib/core/servlet_2_2.jar:$COCOON_WEBAPP_HOME/WEB-INF/classes
58
#
59
60
61
usage()
62
{
63
    echo "Usage: $0 (action)"
64
    echo "actions:"
65
    echo "  cli               Run Cocoon from the command line"
66
    echo "  precompile        Crawl your webapp to compile all XSP files (requires the xsp block)"
67
    echo "  servlet           Run Cocoon in a servlet container (default)"
68
    echo "  servlet-admin     Run Cocoon in a servlet container and turn on container web administration"
69
    echo "  servlet-debug     Run Cocoon in a servlet container and turn on JVM remote debug"
70
    echo "  servlet-profile   Run Cocoon in a servlet container and turn on JVM profiling"
71
    exit 1
72
}
73
74
# ----- Handle action parameter ------------------------------------------------
75
DEFAULT_ACTION="servlet"
76
ACTION="$1"
77
if [ -n "$ACTION" ]
78
then
79
  shift
80
else
81
  ACTION=$DEFAULT_ACTION
82
  echo "$0: executing default action '$ACTION', use -h to see other actions"
83
fi
84
ARGS="$*"
85
86
# ----- Verify and Set Required Environment Variables -------------------------
87
88
if [ "$JAVA_HOME" = "" ] ; then
89
  JAVA_HOME="%%JAVA_HOME%%"
90
fi
91
92
if [ "$JAVA_OPTIONS" = "" ] ; then
93
  JAVA_OPTIONS='-Xms32M -Xmx512M -Dorg.apache.cocoon.settings=cocoon.properties'
94
fi
95
96
if [ "$COCOON_HOME" = "" ] ; then
97
  COCOON_HOME="%%APP_HOME%%"
98
fi
99
100
if [ "$COCOON_WEBAPP_HOME" = "" ] ; then
101
  STANDALONE_WEBAPP=../webapp
102
  if [ -d $STANDALONE_WEBAPP ] ; then
103
    # for standalone-webapp setup
104
    COCOON_WEBAPP_HOME=$STANDALONE_WEBAPP
105
  else
106
    # when in the build environment
107
    COCOON_WEBAPP_HOME="$COCOON_HOME/webapp"
108
  fi
109
fi
110
echo "$0: using $COCOON_WEBAPP_HOME as the webapp directory"
111
112
if [ "$COCOON_LIB" = "" ] ; then
113
  COCOON_LIB="$COCOON_WEBAPP_HOME/WEB-INF/lib"
114
fi
115
116
if [ "$JETTY_PORT" = "" ] ; then
117
  JETTY_PORT='8888'
118
fi
119
120
if [ "$JETTY_ADMIN_PORT" = "" ] ; then
121
  JETTY_ADMIN_PORT='8889'
122
fi
123
124
if [ "$JAVA_DEBUG_ARGS" = "" ] ; then
125
  JAVA_DEBUG_ARGS='-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n'
126
fi
127
128
if [ "$JAVA_PROFILE_ARGS" = "" ] ; then
129
  JAVA_PROFILE_ARGS='-Xrunhprof:heap=all,cpu=samples,thread=y,depth=3'
130
fi
131
132
133
# ----- Set platform specific variables
134
135
PATHSEP=":";
136
case "`uname`" in
137
   CYGWIN*) PATHSEP=";"
138
            JAVA_HOME=`cygpath --unix "$JAVA_HOME"`;;
139
esac
140
141
# ----- Set Local Variables ( used to minimize cut/paste) ---------------------
142
143
JAVA="exec $JAVA_HOME/bin/java"
144
ENDORSED_LIBS="$COCOON_HOME/lib/endorsed"
145
ENDORSED="-Djava.endorsed.dirs=$ENDORSED_LIBS"
146
PARSER=-Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser
147
LOADER=Loader
148
if [ "$LOADER_LIB" = "" ] ; then
149
	LOADER_LIB="${COCOON_HOME}/tools/loader"
150
fi
151
152
CLI="-Dloader.main.class=org.apache.cocoon.Main"
153
CLI_LIBRARIES="-Dloader.jar.repositories=$COCOON_LIB"
154
if [ "$CLI_CLASSPATH" = "" ] ; then
155
	CLI_CLASSPATH="lib/core/servlet_2_2.jar:$COCOON_WEBAPP_HOME/WEB-INF/classes"
156
fi
157
CLI_VERBOSE="-Dloader.verbose=false"
158
CLI_PROPERTIES="$CLI_LIBRARIES -Dloader.class.path=$CLI_CLASSPATH $CLI_VERBOSE"
159
160
PRECOMPILE=-Dloader.main.class=org.apache.cocoon.bean.XSPPrecompileWrapper
161
162
JETTY=-Dloader.main.class=org.mortbay.jetty.Server
163
JETTY_CONF="$COCOON_HOME/tools/jetty/conf"
164
JETTY_MAIN="$JETTY_CONF/main.xml"
165
JETTY_ADMIN="$JETTY_CONF/admin.xml"
166
JETTY_WEBAPP="-Dwebapp=$COCOON_WEBAPP_HOME"
167
JETTY_HOME="-Dhome=$COCOON_HOME"
168
JETTY_PORT_ARGS="-Djetty.port=$JETTY_PORT"
169
JETTY_ADMIN_ARGS="-Djetty.admin.port=$JETTY_ADMIN_PORT"
170
JETTY_LIBRARIES="-Dloader.jar.repositories=$COCOON_HOME/tools/jetty/lib${PATHSEP}${ENDORSED_LIBS}"
171
172
# ----- Do the action ----------------------------------------------------------
173
174
case "$ACTION" in
175
  cli)
176
        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $CLI_PROPERTIES $CLI $LOADER $ARGS
177
        ;;
178
179
  precompile)
180
        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $CLI_PROPERTIES $PRECOMPILE $LOADER $ARGS
181
        ;;
182
183
  servlet)
184
        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_PORT_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN
185
        ;;
186
187
  servlet-admin)
188
        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_PORT_ARGS $JETTY_ADMIN_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN $JETTY_ADMIN
189
        ;;
190
191
  servlet-debug)
192
        $JAVA $JAVA_OPTIONS $JAVA_DEBUG_ARGS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_PORT_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN
193
        ;;
194
195
  servlet-profile)
196
        $JAVA $JAVA_OPTIONS $JAVA_PROFILE_ARGS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN
197
        ;;
198
199
  *)
200
        usage
201
        ;;
202
esac
203
204
exit 0
(-)./pkg-plist (+1 lines)
Lines 1-5 Link Here
1
@comment $FreeBSD: ports/www/cocoon/pkg-plist,v 1.13 2006/05/05 16:35:04 hq Exp $
1
@comment $FreeBSD: ports/www/cocoon/pkg-plist,v 1.13 2006/05/05 16:35:04 hq Exp $
2
sbin/cocoonctl
2
sbin/cocoonctl
3
etc/rc.d/cocoon.sh
3
etc/rc.d/cocoon.sh
4
cocoon/cocoon.sh
4
@dirrm cocoon/tools
5
@dirrm cocoon/tools
5
@dirrm cocoon
6
@dirrm cocoon

Return to bug 97023