ports/106793: Maintainer update: fix build on amd64 for www/resin2

Jean-Baptiste Quenot jb.quenot at caraldi.com
Fri Dec 15 22:00:38 UTC 2006


>Number:         106793
>Category:       ports
>Synopsis:       Maintainer update: fix build on amd64 for www/resin2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 15 22:00:27 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jean-Baptiste Quenot
>Release:        FreeBSD 6.1-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD zoupla.cottages 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:04:14 UTC 2006 root at bloom.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
This is an attempt to fix a build failure on amd64 reported by Kris:
------------------------------------------------------------------
ports-amd64 at FreeBSD.org: resin-2.1.17_1 failed on amd64 6

Build error:
...
cc -shared -o common.o stream.o registry.o config.o memory.o
/usr/bin/ld: stream.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
stream.o: could not read symbols: Bad value
*** Error code 1
------------------------------------------------------------------

The attached patch also keeps the port in sync with Resin 3:
* A new option can be set in rc.conf to specify Java version to be used:
  resin2_java_version
* Set REQUIRE and KEYWORD in rc(8) script
* Fix rc.d script when using "faststart"
* Update maintainer address from jb.quenot at caraldi.com to jbq at caraldi.com
>How-To-Repeat:
>Fix:
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.swp --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/resin2/Makefile ./Makefile
--- /usr/ports/www/resin2/Makefile	Sat Oct  7 13:25:58 2006
+++ ./Makefile	Fri Dec 15 22:54:55 2006
@@ -7,11 +7,11 @@
 
 PORTNAME=		resin
 PORTVERSION=		2.1.17
-PORTREVISION=		1
+PORTREVISION=		2
 CATEGORIES=		www java
 MASTER_SITES=		http://www.caucho.com/download/
 
-MAINTAINER=		jb.quenot at caraldi.com
+MAINTAINER=		jbq at caraldi.com
 COMMENT=		Resin, a Java-based Application Server, 2.x branch
 
 USE_JAVA=		yes
@@ -48,6 +48,7 @@
 			${FILESDIR}/pkg-deinstall \
 			${FILESDIR}/install.sh \
 			${FILESDIR}/pkg-message.in \
+			${FILESDIR}/pkg-message-advanced.in \
 			${WRKSRC}/conf/resin.conf \
 			${FILESDIR}/resinctl \
 			${FILESDIR}/resin.sh.in
@@ -101,6 +102,7 @@
 			-e "s|%%GROUP%%|${GROUP}|g" \
 			-e "s|%%JAVA%%|${JAVA}|g" \
 			-e "s|%%JAVA_HOME%%|${JAVA_HOME}|g" \
+			-e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
 			-e "s|%%LOG_FILE%%|${LOG_FILE}|g" \
 			-e "s|%%PID_FILE%%|${PID_FILE}|g" \
 			-e "s|%%PORT%%|${PORT}|g" \
@@ -112,12 +114,18 @@
 			-e "s|%%WRKDIR%%|${WRKDIR}|g" \
 			-e "s|%%WRKSRC%%|${WRKSRC}|g"
 
+# Avoid build error on 64-bit architectures
+.if (${ARCH} == "amd64") || (${ARCH} == "ia64") || (${ARCH} == "sparc64")
+CFLAGS+=        -fPIC
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} ${SUBSTITUTIONS} ${REINPLACE_FILES}
 	@for FILE in ${REPLACE_FILES} ; do \
 	    ${SED} ${SUBSTITUTIONS} $${FILE} > ${WRKDIR}/`basename $${FILE}` ; \
 	    done
 	@${FMT} -w 80 < ${WRKDIR}/pkg-message.in > ${PKGMESSAGE}
+	@${CAT} < ${WRKDIR}/pkg-message-advanced.in >> ${PKGMESSAGE}
 .if (defined(WITH_APACHE2) && (${WITH_APACHE2} == yes || ${WITH_APACHE2} == YES) || \
 defined(WITH_APACHE) && (${WITH_APACHE} == yes || ${WITH_APACHE} == YES))
 	@${ECHO_CMD} >> ${PKGMESSAGE}
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.swp --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/resin2/files/pkg-message-advanced.in ./files/pkg-message-advanced.in
--- /usr/ports/www/resin2/files/pkg-message-advanced.in	Thu Jan  1 01:00:00 1970
+++ ./files/pkg-message-advanced.in	Fri Oct 13 20:37:24 2006
@@ -0,0 +1,23 @@
+
+--------------------------------------------------------------------------------
+ADVANCED USAGE
+
+If you need to pass special options to Java, please set the
+%%APP_NAME%%_flags option in /etc/rc.conf, see examples below:
+
+  # Prevent Java from opening an X11 display
+
+  %%APP_NAME%%_flags="-Djava.awt.headless=true"
+
+  # Increase memory limit of the Java virtual machine
+
+  %%APP_NAME%%_flags="-Xms32m -Xmx256m"
+
+  # Run Java with remote debugging turned on on port 8000
+
+  %%APP_NAME%%_flags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
+
+To specify the java version to use, please use %%APP_NAME%%_java_version:
+
+  %%APP_NAME%%_java_version="1.4"
+
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.swp --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/resin2/files/pkg-message.in ./files/pkg-message.in
--- /usr/ports/www/resin2/files/pkg-message.in	Tue Apr  4 18:20:47 2006
+++ ./files/pkg-message.in	Fri Oct 13 20:37:24 2006
@@ -30,18 +30,3 @@
 
 
 Enjoy!
-
---------------------------------------------------------------------------------
-ADVANCED USAGE
-
-If you need to pass special options to Java, please set the
-%%APP_NAME%%_flags option in /etc/rc.conf, see examples below:
-
-  # Prevent Java from opening an X11 display
-  %%APP_NAME%%_flags="-Djava.awt.headless=true"
-
-  # Increase memory limit of the Java virtual machine
-  %%APP_NAME%%_flags="-Xms32m -Xmx256m"
-
-  # Run Java with remote debugging turned on on port 8000
-  %%APP_NAME%%_flags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.swp --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/resin2/files/resin.sh.in ./files/resin.sh.in
--- /usr/ports/www/resin2/files/resin.sh.in	Thu Feb 24 23:27:53 2005
+++ ./files/resin.sh.in	Fri Oct 13 20:37:24 2006
@@ -4,6 +4,8 @@
 #
 
 # PROVIDE: %%APP_NAME%%
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
 
 #
 # Add the following line to /etc/rc.conf to enable %%APP_NAME%%:
@@ -16,10 +18,9 @@
 name=%%APP_NAME%%
 rcvar=`set_rcvar`
 
-command=%%PREFIX%%/sbin/%%APP_NAME%%ctl
-command_args="$1"
+command="%%PREFIX%%/sbin/%%APP_NAME%%ctl"
+command_args="start"
 pidfile=%%PID_FILE%%
-procname=%%JAVA%%
 
 # set defaults
 
@@ -28,4 +29,15 @@
 %%APP_NAME%%_group=${%%APP_NAME%%_group:-"www"}
 
 load_rc_config ${name}
+
+if test -n "${%%APP_NAME%%_java_version}" ; then
+    JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2)
+    procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2)
+else
+    JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2)
+    procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2)
+fi
+
+export JAVA_HOME
+
 run_rc_command "$1"
diff --ignore-matching-lines=\$FreeBSD.*\$ --exclude=.swp --exclude=.*.sw* --exclude=.svn --exclude=work --exclude=admin -ruN /usr/ports/www/resin2/files/resinctl ./files/resinctl
--- /usr/ports/www/resin2/files/resinctl	Wed Dec 21 21:55:50 2005
+++ ./files/resinctl	Fri Oct 13 20:37:24 2006
@@ -154,7 +154,7 @@
     APP_NAME = "%%APP_NAME%%"
     APP_HOME = "%%APP_HOME%%"
     PID_FILE = "%%PID_FILE%%"
-    COMMAND = "%%JAVA%%"
+    COMMAND = "%%PREFIX%%/bin/java"
     ARGS = [COMMAND]
 
     ARGS += sys.argv[1:-1]
@@ -165,8 +165,8 @@
         "-conf", "%%PREFIX%%/etc/%%APP_NAME%%.xml"
         ]
 
-    os.environ['JAVA_HOME'] = "%%JAVA_HOME%%"
     os.environ['CLASSPATH'] = classpath()
+    os.environ['PATH'] = "%%LOCALBASE%%/bin:/usr/bin:/bin"
 
     if len(sys.argv) < 2:
         usage()
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list