aboutsummaryrefslogtreecommitdiffstats
path: root/www/hudson
diff options
context:
space:
mode:
authorhq <hq@FreeBSD.org>2009-06-14 06:39:04 +0800
committerhq <hq@FreeBSD.org>2009-06-14 06:39:04 +0800
commitf6a398649cc527ac69555b827f33bf4dc0f055bc (patch)
tree9b58b3a8cbf9a4b17e8fa8f79666a706d40aed52 /www/hudson
parentd8b81b584e51f10147a0700d6d14b05ee0b2ae56 (diff)
downloadfreebsd-ports-gnome-f6a398649cc527ac69555b827f33bf4dc0f055bc.tar.gz
freebsd-ports-gnome-f6a398649cc527ac69555b827f33bf4dc0f055bc.tar.zst
freebsd-ports-gnome-f6a398649cc527ac69555b827f33bf4dc0f055bc.zip
Hudson is now running as a standalone process and no longer relies on
www/tomcat6 See UPDATING for further details
Diffstat (limited to 'www/hudson')
-rw-r--r--www/hudson/Makefile19
-rw-r--r--www/hudson/files/hudson.sh.in76
-rw-r--r--www/hudson/pkg-message7
3 files changed, 89 insertions, 13 deletions
diff --git a/www/hudson/Makefile b/www/hudson/Makefile
index e26f8df3a070..0ec922a9401f 100644
--- a/www/hudson/Makefile
+++ b/www/hudson/Makefile
@@ -7,6 +7,7 @@
PORTNAME= hudson
PORTVERSION= 1.308
+PORTREVISION= 1
CATEGORIES= www java devel
MASTER_SITES= https://hudson.dev.java.net/files/documents/2402/135704/
DISTNAME= hudson
@@ -17,16 +18,22 @@ EXTRACT_ONLY=
MAINTAINER= hq@FreeBSD.org
COMMENT= An extensible continuous integration engine
-RUN_DEPENDS= ${LOCALBASE}/apache-tomcat6.0/bin/catalina.sh:${PORTSDIR}/www/tomcat6
-
+USE_JAVA= yes
+JAVA_VERSION= 1.5+
NO_BUILD= yes
-WEBAPP_SUBDIR= apache-tomcat6.0/webapps
-WEBAPP_DIR= ${PREFIX}/${WEBAPP_SUBDIR}
+USE_RC_SUBR= hudson.sh
+
+HUDSON_HOME?= /var/lib/hudson
+HUDSON_USER?= www
+HUDSON_GROUP?= www
-PLIST_FILES= ${WEBAPP_SUBDIR}/${DISTNAME}${EXTRACT_SUFX}
+PLIST_FILES= %%DATADIR%%/${DISTNAME}${EXTRACT_SUFX}
+PLIST_DIRS= %%DATADIR%%
+SUB_LIST+= HUDSON_HOME=${HUDSON_HOME} HUDSON_USER=${HUDSON_USER} HUDSON_GROUP=${HUDSON_GROUP} JAVA_HOME=${JAVA_HOME}
do-install:
- ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} ${WEBAPP_DIR}/
+ ${MKDIR} "${DATADIR}"
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME}${EXTRACT_SUFX} ${DATADIR}/
.include <bsd.port.mk>
diff --git a/www/hudson/files/hudson.sh.in b/www/hudson/files/hudson.sh.in
new file mode 100644
index 000000000000..a0b57803f909
--- /dev/null
+++ b/www/hudson/files/hudson.sh.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: hudson
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Configuration settings for hudson in /etc/rc.conf:
+#
+# hudson_enable (bool):
+# Set to "NO" by default.
+# Set it to "YES" to enable hudson
+#
+# hudson_args (str):
+# Extra arguments passed to start command
+#
+# hudson_home (str)
+# Set to "%%HUDSON_HOME%%" by default.
+# Set the HUDSON_HOME variable for hudson process
+#
+# hudson_java_home (str):
+# Set to "%%JAVA_HOME%%" by default.
+# Set the Java virtual machine to run hudson
+#
+# hudson_java_opts (str):
+# Set to "" by default.
+# Java VM args to use.
+#
+# hudson_user (str):
+# Set to "%%HUDSON_USER%%" by default.
+# User to run hudson as.
+#
+# hudson_group (str):
+# Set to "%%HUDSON_GROUP%%" by default.
+# Group for data file ownership.
+#
+
+hudson_log_file=/var/log/hudson.log
+
+. %%RC_SUBR%%
+
+name="hudson"
+rcvar=`set_rcvar`
+
+load_rc_config "${name}"
+
+: ${hudson_enable="NO"}
+: ${hudson_home="%%HUDSON_HOME%%"}
+: ${hudson_args="--webroot=${hudson_home}/war --httpListenAddress=127.0.0.1 --httpPort=8180 --ajp13ListenAddress=127.0.0.1 --ajp13Port=8009 --prefix=/hudson"}
+: ${hudson_java_home="%%JAVA_HOME%%"}
+: ${hudson_java_opts=""}
+: ${hudson_user="%%HUDSON_USER%%"}
+: ${hudson_group="%%HUDSON_GROUP%%"}
+
+pidfile="/var/run/hudson.pid"
+command="/usr/sbin/daemon"
+java_cmd="${hudson_java_home}/bin/java"
+procname="${java_cmd}"
+command_args="-p ${pidfile} ${java_cmd} -DHUDSON_HOME=${hudson_home} ${hudson_java_opts} -jar %%DATADIR%%/hudson.war --logfile=${hudson_log_file} ${hudson_args}"
+required_dirs="${hudson_home}"
+required_files="${hudson_log_file} ${java_cmd}"
+
+start_precmd="setup_files"
+
+setup_files() {
+ touch "${hudson_log_file}" "${pidfile}"
+ chown "${hudson_user}:${hudson_group}" "${hudson_log_file}" "${pidfile}"
+ chmod 640 "${hudson_log_file}"
+ install -d -o "${hudson_user}" -g "${hudson_group}" -m 750 "${hudson_home}"
+}
+
+run_rc_command "$1"
diff --git a/www/hudson/pkg-message b/www/hudson/pkg-message
deleted file mode 100644
index 55c77f8a73f2..000000000000
--- a/www/hudson/pkg-message
+++ /dev/null
@@ -1,7 +0,0 @@
-In order to save configuration and builds, Hudson needs HUDSON_HOME to be
-defined.
-
-For example, to use /home/hudson/ and provided this directory already exists,
-you may add the following to /etc/rc.conf:
-
-tomcat60_java_opts="-DHUDSON_HOME=/home/hudson"