From jbq@anyware-tech.com  Tue May  9 08:25:02 2006
Return-Path: <jbq@anyware-tech.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9828F16A40E;
	Tue,  9 May 2006 08:25:02 +0000 (UTC)
	(envelope-from jbq@anyware-tech.com)
Received: from caraldi.com (195-13-58-165.oxyd.net [195.13.58.165])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 08DAF43D45;
	Tue,  9 May 2006 08:25:01 +0000 (GMT)
	(envelope-from jbq@anyware-tech.com)
Received: from vision.anyware (10.21.96-84.rev.gaoland.net [84.96.21.10])
	by caraldi.com (Postfix) with ESMTP id 442426369;
	Tue,  9 May 2006 10:25:00 +0200 (CEST)
Received: by vision.anyware (Postfix, from userid 1021)
	id 76740648B; Tue,  9 May 2006 10:25:00 +0200 (CEST)
Message-Id: <20060509082500.76740648B@vision.anyware>
Date: Tue,  9 May 2006 10:25:00 +0200 (CEST)
From: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: hq@FreeBSD.org
Subject: Maintainer update: fix install problem with www/cocoon
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         97023
>Category:       ports
>Synopsis:       Maintainer update: fix install problem with www/cocoon
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    hq
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 09 08:30:13 GMT 2006
>Closed-Date:    Sun May 14 22:08:10 GMT 2006
>Last-Modified:  Sun May 14 22:08:10 GMT 2006
>Originator:     Jean-Baptiste Quenot
>Release:        FreeBSD 5.5-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD vision.anyware 5.5-PRERELEASE FreeBSD 5.5-PRERELEASE #1: Thu Mar 9 19:20:53 CET 2006 jbq@vision.anyware:/usr/obj/usr/src/sys/VISION i386
>Description:
Pointyhat reported that sbin/cocoon.sh was left after deinstall.  So I'm adding
a new file to SUB_FILES, sadly I also need to copy this file as it must be in
"files" whereas this file used to be in ${WRKSRC}.
>How-To-Repeat:
>Fix:
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/cocoon/Makefile ./Makefile
--- /usr/ports/www/cocoon/Makefile	Sun May  7 00:13:07 2006
+++ ./Makefile	Tue May  9 10:12:19 2006
@@ -44,7 +44,6 @@
 		APP_HOME=${APP_HOME} \
 		APP_NAME=${APP_NAME} \
 		RC_SUBR=${RC_SUBR} \
-		PREFIX=${PREFIX} \
 		PORT=${PORT} \
 		COCOON_LIB=${COCOON_LIB} \
 		JAVA_HOME=${JAVA_HOME} \
@@ -62,6 +61,7 @@
 		pkg-deinstall \
 		${APP_NAME}ctl \
 		${APP_NAME}.sh \
+		upstreams-cocoon.sh \
 		pkg-message
 
 # Load options (before including bsd.port.pre.mk)
@@ -126,9 +126,9 @@
 	@${ECHO_MSG} "===> Installing ${COPYDIRS}"
 	@${MKDIR} ${APP_HOME}
 	@cd ${WRKSRC} && ${FIND} -H ${COPYDIRS} | ${CPIO} -pdmuL -R ${LIBOWN}:${LIBGRP} ${APP_HOME}
+	@${INSTALL} ${WRKDIR}/upstreams-cocoon.sh ${APP_HOME}/cocoon.sh
 
 	@${ECHO_MSG} "===> Installing into ${PREFIX}/sbin"
-	@${INSTALL_SCRIPT} ${WRKDIR}/${APP_NAME}.sh ${PREFIX}/sbin
 	@${INSTALL_SCRIPT} ${WRKDIR}/${APP_NAME}ctl ${PREFIX}/sbin
 
 	@${ECHO_MSG} "===> Installing ${PREFIX}/etc/rc.d/${APP_NAME}.sh"
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/cocoon/files/cocoonctl.in ./files/cocoonctl.in
--- /usr/ports/www/cocoon/files/cocoonctl.in	Fri May  5 18:35:05 2006
+++ ./files/cocoonctl.in	Tue May  9 10:03:08 2006
@@ -140,7 +140,7 @@
     APP_NAME = "%%APP_NAME%%"
     APP_HOME = "%%APP_HOME%%"
     PID_FILE = "%%PID_FILE%%"
-    COMMAND = "%%PREFIX%%/sbin/%%APP_NAME%%.sh"
+    COMMAND = "%%APP_HOME%%/cocoon.sh"
     os.environ["JAVA_OPTIONS"] = " ".join(sys.argv[1:-1])
     ARGS = [COMMAND, "servlet"]
 
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/cocoon/files/patch-cocoon.sh ./files/patch-cocoon.sh
--- /usr/ports/www/cocoon/files/patch-cocoon.sh	Sun May  7 00:13:07 2006
+++ ./files/patch-cocoon.sh	Thu Jan  1 01:00:00 1970
@@ -1,32 +0,0 @@
-$FreeBSD: ports/www/cocoon/files/patch-cocoon.sh,v 1.2 2006/05/05 16:35:05 hq Exp $
-
---- cocoon.sh.orig	Thu Feb 12 09:48:55 2004
-+++ cocoon.sh	Tue May  4 14:44:24 2004
-@@ -57,8 +57,7 @@
- # ----- Verify and Set Required Environment Variables -------------------------
- 
- if [ "$JAVA_HOME" = "" ] ; then
--  echo You must set JAVA_HOME to point at your Java Development Kit installation
--  exit 1
-+  JAVA_HOME="%%JAVA_HOME%%"
- fi
- 
- if [ "$JAVA_OPTIONS" = "" ] ; then
-@@ -66,7 +65,7 @@
- fi
- 
- if [ "$COCOON_HOME" = "" ] ; then
--  COCOON_HOME='.'
-+  COCOON_HOME="%%APP_HOME%%"
- fi
- 
- if [ "$COCOON_WEBAPP_HOME" = "" ] ; then
-@@ -76,7 +75,7 @@
-     COCOON_WEBAPP_HOME=$STANDALONE_WEBAPP
-   else
-     # when in the build environment
--    COCOON_WEBAPP_HOME="$COCOON_HOME/build/webapp"
-+    COCOON_WEBAPP_HOME="$COCOON_HOME/webapp"
-   fi
- fi
- echo "$0: using $COCOON_WEBAPP_HOME as the webapp directory"
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/cocoon/files/upstreams-cocoon.sh.in ./files/upstreams-cocoon.sh.in
--- /usr/ports/www/cocoon/files/upstreams-cocoon.sh.in	Thu Jan  1 01:00:00 1970
+++ ./files/upstreams-cocoon.sh.in	Tue May  9 10:01:42 2006
@@ -0,0 +1,204 @@
+#!/bin/sh
+#  Copyright 1999-2004 The Apache Software Foundation
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+# -----------------------------------------------------------------------------
+# Cocoon Unix Shell Script
+#
+# $Id: cocoon.sh 389028 2006-03-27 06:21:40Z rgoers $
+# -----------------------------------------------------------------------------
+
+# Configuration variables
+#
+# COCOON_HOME
+#   The root of the Cocoon distribution
+#
+# COCOON_WEBAPP_HOME
+#   The root of the Cocoon web application
+#
+# COCOON_LIB
+#   Folder containing all the library files needed by the Cocoon CLI
+#
+# JAVA_HOME
+#   Home of Java installation.
+#
+# JAVA_OPTIONS
+#   Extra options to pass to the JVM
+#
+# JAVA_DEBUG_ARGS
+#   The command line arguments for the internal JVM debugger
+#
+# JAVA_PROFILE_ARGS
+#   The command line arguments for the internal JVM profiler
+#
+# JETTY_PORT
+#   Override the default port for Jetty
+#
+# JETTY_ADMIN_PORT
+#   The port where the jetty web administration should bind
+#
+# LOADER_LIB
+#   The classpath where to lookup the Loader class, defaults to
+#   ${COCOON_HOME}/tools/loader
+#
+# CLI_CLASSPATH
+#   The additional classpath for cli and precompile, defaults to
+#   lib/core/servlet_2_2.jar:$COCOON_WEBAPP_HOME/WEB-INF/classes
+#
+
+
+usage()
+{
+    echo "Usage: $0 (action)"
+    echo "actions:"
+    echo "  cli               Run Cocoon from the command line"
+    echo "  precompile        Crawl your webapp to compile all XSP files (requires the xsp block)"
+    echo "  servlet           Run Cocoon in a servlet container (default)"
+    echo "  servlet-admin     Run Cocoon in a servlet container and turn on container web administration"
+    echo "  servlet-debug     Run Cocoon in a servlet container and turn on JVM remote debug"
+    echo "  servlet-profile   Run Cocoon in a servlet container and turn on JVM profiling"
+    exit 1
+}
+
+# ----- Handle action parameter ------------------------------------------------
+DEFAULT_ACTION="servlet"
+ACTION="$1"
+if [ -n "$ACTION" ]
+then
+  shift
+else
+  ACTION=$DEFAULT_ACTION
+  echo "$0: executing default action '$ACTION', use -h to see other actions"
+fi
+ARGS="$*"
+
+# ----- Verify and Set Required Environment Variables -------------------------
+
+if [ "$JAVA_HOME" = "" ] ; then
+  JAVA_HOME="%%JAVA_HOME%%"
+fi
+
+if [ "$JAVA_OPTIONS" = "" ] ; then
+  JAVA_OPTIONS='-Xms32M -Xmx512M -Dorg.apache.cocoon.settings=cocoon.properties'
+fi
+
+if [ "$COCOON_HOME" = "" ] ; then
+  COCOON_HOME="%%APP_HOME%%"
+fi
+
+if [ "$COCOON_WEBAPP_HOME" = "" ] ; then
+  STANDALONE_WEBAPP=../webapp
+  if [ -d $STANDALONE_WEBAPP ] ; then
+    # for standalone-webapp setup
+    COCOON_WEBAPP_HOME=$STANDALONE_WEBAPP
+  else
+    # when in the build environment
+    COCOON_WEBAPP_HOME="$COCOON_HOME/webapp"
+  fi
+fi
+echo "$0: using $COCOON_WEBAPP_HOME as the webapp directory"
+
+if [ "$COCOON_LIB" = "" ] ; then
+  COCOON_LIB="$COCOON_WEBAPP_HOME/WEB-INF/lib"
+fi
+
+if [ "$JETTY_PORT" = "" ] ; then
+  JETTY_PORT='8888'
+fi
+
+if [ "$JETTY_ADMIN_PORT" = "" ] ; then
+  JETTY_ADMIN_PORT='8889'
+fi
+
+if [ "$JAVA_DEBUG_ARGS" = "" ] ; then
+  JAVA_DEBUG_ARGS='-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n'
+fi
+
+if [ "$JAVA_PROFILE_ARGS" = "" ] ; then
+  JAVA_PROFILE_ARGS='-Xrunhprof:heap=all,cpu=samples,thread=y,depth=3'
+fi
+
+
+# ----- Set platform specific variables
+
+PATHSEP=":";
+case "`uname`" in
+   CYGWIN*) PATHSEP=";"
+            JAVA_HOME=`cygpath --unix "$JAVA_HOME"`;;
+esac
+
+# ----- Set Local Variables ( used to minimize cut/paste) ---------------------
+
+JAVA="exec $JAVA_HOME/bin/java"
+ENDORSED_LIBS="$COCOON_HOME/lib/endorsed"
+ENDORSED="-Djava.endorsed.dirs=$ENDORSED_LIBS"
+PARSER=-Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser
+LOADER=Loader
+if [ "$LOADER_LIB" = "" ] ; then
+	LOADER_LIB="${COCOON_HOME}/tools/loader"
+fi
+
+CLI="-Dloader.main.class=org.apache.cocoon.Main"
+CLI_LIBRARIES="-Dloader.jar.repositories=$COCOON_LIB"
+if [ "$CLI_CLASSPATH" = "" ] ; then
+	CLI_CLASSPATH="lib/core/servlet_2_2.jar:$COCOON_WEBAPP_HOME/WEB-INF/classes"
+fi
+CLI_VERBOSE="-Dloader.verbose=false"
+CLI_PROPERTIES="$CLI_LIBRARIES -Dloader.class.path=$CLI_CLASSPATH $CLI_VERBOSE"
+
+PRECOMPILE=-Dloader.main.class=org.apache.cocoon.bean.XSPPrecompileWrapper
+
+JETTY=-Dloader.main.class=org.mortbay.jetty.Server
+JETTY_CONF="$COCOON_HOME/tools/jetty/conf"
+JETTY_MAIN="$JETTY_CONF/main.xml"
+JETTY_ADMIN="$JETTY_CONF/admin.xml"
+JETTY_WEBAPP="-Dwebapp=$COCOON_WEBAPP_HOME"
+JETTY_HOME="-Dhome=$COCOON_HOME"
+JETTY_PORT_ARGS="-Djetty.port=$JETTY_PORT"
+JETTY_ADMIN_ARGS="-Djetty.admin.port=$JETTY_ADMIN_PORT"
+JETTY_LIBRARIES="-Dloader.jar.repositories=$COCOON_HOME/tools/jetty/lib${PATHSEP}${ENDORSED_LIBS}"
+
+# ----- Do the action ----------------------------------------------------------
+
+case "$ACTION" in
+  cli)
+        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $CLI_PROPERTIES $CLI $LOADER $ARGS
+        ;;
+
+  precompile)
+        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $CLI_PROPERTIES $PRECOMPILE $LOADER $ARGS
+        ;;
+
+  servlet)
+        $JAVA $JAVA_OPTIONS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_PORT_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN
+        ;;
+
+  servlet-admin)
+        $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
+        ;;
+
+  servlet-debug)
+        $JAVA $JAVA_OPTIONS $JAVA_DEBUG_ARGS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_PORT_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN
+        ;;
+
+  servlet-profile)
+        $JAVA $JAVA_OPTIONS $JAVA_PROFILE_ARGS -cp $LOADER_LIB $ENDORSED $PARSER $JETTY_ARGS $JETTY_LIBRARIES $JETTY_WEBAPP $JETTY_HOME $JETTY $LOADER $JETTY_MAIN
+        ;;
+
+  *)
+        usage
+        ;;
+esac
+
+exit 0
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/cocoon/pkg-plist ./pkg-plist
--- /usr/ports/www/cocoon/pkg-plist	Sun May  7 00:13:10 2006
+++ ./pkg-plist	Tue May  9 10:22:41 2006
@@ -1,5 +1,6 @@
 @comment $FreeBSD: ports/www/cocoon/pkg-plist,v 1.13 2006/05/05 16:35:04 hq Exp $
 sbin/cocoonctl
 etc/rc.d/cocoon.sh
+cocoon/cocoon.sh
 @dirrm cocoon/tools
 @dirrm cocoon
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->hq 
Responsible-Changed-By: hq 
Responsible-Changed-When: Tue May 9 08:35:10 UTC 2006 
Responsible-Changed-Why:  
I'll handle this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97023 

From: Jean-Baptiste Quenot <jbq@caraldi.com>
To: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
Cc: freebsd-ports-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/97023: Maintainer update: fix install problem with www/cocoon
Date: Wed, 10 May 2006 10:27:29 +0200

 * Herve Quiroz:
 
 > I'm afraid I don't really understand the relation between a file
 > installed but not listed in pkg-plist and SUB_FILES...
 
 Because I  was previously  using manual  sed substitutions  that I
 could apply to  a file in any location.  Now  with SUB_FILES I can
 only substitute files in FILESDIR.
 -- 
      Jean-Baptiste Quenot
 aka  John Banana Qwerty
 http://caraldi.com/jbq/
State-Changed-From-To: open->closed 
State-Changed-By: hq 
State-Changed-When: Sun May 14 22:07:26 UTC 2006 
State-Changed-Why:  
Patch commited. 

I had to add a statement to the imported shell script to comply with the Apache 
License 2.0. 

Thanks for your contribution! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=97023 
>Unformatted:
