[dev-util/jenkins-bin] sync with tree, dropped logrotate

This commit is contained in:
Robert Förster 2014-10-21 00:38:05 +02:00
parent da8b5cbb8f
commit 69ffb4cfd7
5 changed files with 96 additions and 93 deletions

View File

@ -1,59 +0,0 @@
#!/sbin/runscript
depend() {
need net
use dns logger mysql postgresql
}
JENKINS_PIDFILE=/run/jenkins/jenkins.pid
JENKINS_WAR=/usr/lib/jenkins/jenkins.war
RUN_AS=jenkins
checkconfig() {
if [ ! -n "$JENKINS_HOME" ] ; then
eerror "JENKINS_HOME not configured"
return 1
fi
if [ ! -d "$JENKINS_HOME" ] ; then
eerror "JENKINS_HOME directory does not exist: $JENKINS_HOME"
return 1
fi
return 0
}
start() {
checkconfig || return 1
[ -d /var/run/jenkins ] || mkdir /var/run/jenkins
JAVA_HOME=`java-config --jre-home`
COMMAND=$JAVA_HOME/bin/java
JAVA_PARAMS="$JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
# Don't use --daemon here, because in this case stop will not work
PARAMS="--logfile=/var/log/jenkins/jenkins.log"
[ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT"
[ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL"
[ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP"
[ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX"
[ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE"
[ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS"
if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then
PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log"
fi
ebegin "Starting ${SVCNAME}"
start-stop-daemon --start --quiet --background \
--make-pidfile --pidfile $JENKINS_PIDFILE \
--user $RUN_AS \
--exec "${COMMAND}" -- $JAVA_PARAMS $PARAMS
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --quiet --pidfile $JENKINS_PIDFILE
eend $?
}

View File

@ -43,3 +43,20 @@ JENKINS_HANDLER_IDLE="20"
# Full option list: java -jar jenkins.war --help
#
JENKINS_ARGS=""
#
# User
#
JENKINS_USER=jenkins
#
# Pid File
#
JENKINS_PIDFILE="/var/run/jenkins.pid"
#
# War File
#
JENKINS_WAR="/opt/jenkins/jenkins.war"

View File

@ -0,0 +1,53 @@
#!/sbin/runscript
depend() {
need net
use dns logger mysql postgresql
}
checkconfig() {
if [ ! -n "$JENKINS_HOME" ] ; then
eerror "JENKINS_HOME not configured"
return 1
fi
if [ ! -d "$JENKINS_HOME" ] ; then
eerror "JENKINS_HOME directory does not exist: $JENKINS_HOME"
return 1
fi
return 0
}
start() {
checkconfig || return 1
JAVA_HOME=`java-config --jre-home`
COMMAND=$JAVA_HOME/bin/java
JAVA_PARAMS="$JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR"
# Don't use --daemon here, because in this case stop will not work
PARAMS="--logfile=/var/log/jenkins/jenkins.log"
[ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT"
[ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL"
[ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP"
[ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX"
[ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE"
[ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS"
if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then
PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log"
fi
ebegin "Starting ${SVCNAME}"
start-stop-daemon --start --quiet --background \
--make-pidfile --pidfile $JENKINS_PIDFILE \
--user ${JENKINS_USER} \
--exec "${COMMAND}" -- $JAVA_PARAMS $PARAMS
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --quiet --pidfile $JENKINS_PIDFILE
eend $?
}

View File

@ -1,24 +1,23 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# $Header: /var/cvsroot/gentoo-x86/dev-util/jenkins-bin/jenkins-bin-1.584.ebuild,v 1.1 2014/10/20 21:24:10 mrueg Exp $
EAPI="5"
EAPI=5
inherit java-pkg-2 unpacker user
inherit user
DESCRIPTION="Extensible continuous integration server"
HOMEPAGE="http://jenkins-ci.org/"
SRC_URI="http://pkg.jenkins-ci.org/debian-stable/binary/jenkins_${PV}_all.deb"
RESTRICT="mirror"
LICENSE="MIT"
SRC_URI="http://mirrors.jenkins-ci.org/war/${PV}/${PN/-bin/}.war -> ${P}.war"
RESTRICT="mirror"
SLOT="0"
KEYWORDS="x86 amd64"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="media-fonts/dejavu"
RDEPEND="${DEPEND}
>=virtual/jdk-1.6"
>=virtual/jdk-1.5"
S=${WORKDIR}
@ -28,17 +27,14 @@ pkg_setup() {
}
src_install() {
keepdir /var/log/jenkins
keepdir /var/run/jenkins /var/log/jenkins
keepdir /var/lib/jenkins/home /var/lib/jenkins/backup
insinto /usr/lib/jenkins
doins usr/share/jenkins/jenkins.war
insinto /opt/jenkins
newins "${DISTDIR}"/${P}.war ${PN/-bin/}.war
newinitd "${FILESDIR}/init.sh" jenkins
newconfd "${FILESDIR}/conf" jenkins
newinitd "${FILESDIR}"${PN}.init jenkins
newconfd "${FILESDIR}"${PN}.confd jenkins
insinto /etc/logrotate.d
doins etc/logrotate.d/jenkins
fowners jenkins:jenkins /var/log/jenkins /var/lib/jenkins /var/lib/jenkins/home /var/lib/jenkins/backup
fowners jenkins:jenkins /var/run/jenkins /var/log/jenkins /var/lib/jenkins /var/lib/jenkins/home /var/lib/jenkins/backup
}

View File

@ -1,24 +1,23 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# $Header: /var/cvsroot/gentoo-x86/dev-util/jenkins-bin/jenkins-bin-1.584.ebuild,v 1.1 2014/10/20 21:24:10 mrueg Exp $
EAPI="5"
EAPI=5
inherit java-pkg-2 unpacker user
inherit user
DESCRIPTION="Extensible continuous integration server"
HOMEPAGE="http://jenkins-ci.org/"
SRC_URI="http://pkg.jenkins-ci.org/debian/binary/jenkins_${PV}_all.deb"
RESTRICT="mirror"
LICENSE="MIT"
SRC_URI="http://mirrors.jenkins-ci.org/war/${PV}/${PN/-bin/}.war -> ${P}.war"
RESTRICT="mirror"
SLOT="0"
KEYWORDS="~x86 ~amd64"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="media-fonts/dejavu"
RDEPEND="${DEPEND}
>=virtual/jdk-1.6"
>=virtual/jdk-1.5"
S=${WORKDIR}
@ -28,17 +27,14 @@ pkg_setup() {
}
src_install() {
keepdir /var/log/jenkins
keepdir /var/run/jenkins /var/log/jenkins
keepdir /var/lib/jenkins/home /var/lib/jenkins/backup
insinto /usr/lib/jenkins
doins usr/share/jenkins/jenkins.war
insinto /opt/jenkins
newins "${DISTDIR}"/${P}.war ${PN/-bin/}.war
newinitd "${FILESDIR}/init.sh" jenkins
newconfd "${FILESDIR}/conf" jenkins
newinitd "${FILESDIR}"${PN}.init jenkins
newconfd "${FILESDIR}"${PN}.confd jenkins
insinto /etc/logrotate.d
doins etc/logrotate.d/jenkins
fowners jenkins:jenkins /var/log/jenkins /var/lib/jenkins /var/lib/jenkins/home /var/lib/jenkins/backup
fowners jenkins:jenkins /var/run/jenkins /var/log/jenkins /var/lib/jenkins /var/lib/jenkins/home /var/lib/jenkins/backup
}