summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoryegorius2015-06-24 11:45:01 +0300
committeryegorius2015-06-24 11:45:01 +0300
commitecfd6d054675da97bec5d9264a36477963ec3210 (patch)
tree82cb24dec2054cc79ab896541468263e846a7b62
downloadaur-ecfd6d054675da97bec5d9264a36477963ec3210.tar.gz
Initial import
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD59
-rw-r--r--jetty.default17
-rw-r--r--jetty.install25
-rw-r--r--jetty.logrotate7
-rw-r--r--jetty.service19
-rw-r--r--rundir.patch24
7 files changed, 175 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..81002fc432b7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = jetty
+ pkgdesc = Jetty is a pure Java-based HTTP server and Java Servlet container
+ pkgver = 9.2.10
+ pkgrel = 1
+ url = http://www.eclipse.org/jetty/
+ install = jetty.install
+ arch = any
+ license = Apache
+ license = EPL
+ depends = java-environment
+ options = !strip
+ source = jetty-distribution-9.2.10.v20150310.tar.gz::http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.2.10.v20150310.tar.gz&r=1
+ source = jetty.default
+ source = jetty.logrotate
+ source = jetty.service
+ source = rundir.patch
+ sha256sums = 0034587a3dcfdab23fca28291e5e22ae7ff6e80f9f4c7a67f5b2b7777a84b40e
+ sha256sums = 51bc2d2931629eece6b70679d9e0a3d5695822c00dae02e67fd0216f482f040c
+ sha256sums = da0402440e0a3b66e55387700b2c178c294dc65cc4a7bd079c622343845adecb
+ sha256sums = 36266b7f4daf20871f4bf5636686e37fa5ffd173fd51303f2569fc8d453fa17a
+ sha256sums = 5e03019b1440aa342a1f2c85aeaab8aadc9ae0c737b9262e948b95da1f94dacf
+
+pkgname = jetty
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f5a502144614
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,59 @@
+
+# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# Maintainer: Yegorius <yegorius@domic.us>
+
+pkgname=jetty
+pkgver=9.2.10
+_timestamp=v20150310
+pkgrel=1
+pkgdesc="Jetty is a pure Java-based HTTP server and Java Servlet container"
+arch=('any')
+url="http://www.eclipse.org/jetty/"
+license=('Apache' 'EPL')
+depends=('java-environment')
+options=('!strip')
+_distname=jetty-distribution-$pkgver.$_timestamp
+_dluri="http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/$_distname.tar.gz&r=1"
+source=("$_distname.tar.gz::$_dluri"
+ jetty.default
+ jetty.logrotate
+ jetty.service
+ rundir.patch)
+sha256sums=('0034587a3dcfdab23fca28291e5e22ae7ff6e80f9f4c7a67f5b2b7777a84b40e'
+ '51bc2d2931629eece6b70679d9e0a3d5695822c00dae02e67fd0216f482f040c'
+ 'da0402440e0a3b66e55387700b2c178c294dc65cc4a7bd079c622343845adecb'
+ '36266b7f4daf20871f4bf5636686e37fa5ffd173fd51303f2569fc8d453fa17a'
+ '5e03019b1440aa342a1f2c85aeaab8aadc9ae0c737b9262e948b95da1f94dacf')
+install=$pkgname.install
+
+package() {
+ cd "$srcdir/$_distname"
+
+ install -dm755 "$pkgdir/etc/jetty"
+ install -dm755 "$pkgdir/usr/bin"
+ install -dm755 "$pkgdir/var/log/jetty"
+ install -dm755 "$pkgdir/var/lib/jetty/webapps"
+
+ install -Dm755 bin/jetty.sh "$pkgdir/usr/share/jetty/bin/jetty.sh"
+ cp -r etc/* "$pkgdir/etc/jetty"
+ cp -r {resources,start.ini} "$pkgdir/etc/jetty/"
+ cp -r {lib,modules,start.jar,README.TXT} "$pkgdir/usr/share/jetty/"
+ cp -r webapps/README.TXT "$pkgdir/var/lib/jetty/webapps"
+
+ ln -s /etc/jetty "$pkgdir/usr/share/jetty/etc"
+ ln -s etc/start.d "$pkgdir/usr/share/jetty/start.d"
+ ln -s etc/start.ini "$pkgdir/usr/share/jetty/start.ini"
+ ln -s etc/resources "$pkgdir/usr/share/jetty/resources"
+ ln -s /usr/share/jetty/bin/jetty.sh "$pkgdir/usr/bin/jetty"
+ ln -s /var/lib/jetty/webapps "$pkgdir/usr/share/jetty/webapps"
+
+ install -Dm644 "$srcdir/jetty.default" "$pkgdir/etc/default/jetty"
+ install -Dm644 "$srcdir/jetty.logrotate" "$pkgdir/etc/logrotate.d/jetty"
+ install -Dm644 "$srcdir/jetty.service" "$pkgdir/usr/lib/systemd/system/jetty.service"
+
+ patch -Np1 -i "$srcdir/rundir.patch" "$pkgdir/usr/share/jetty/bin/jetty.sh"
+ sed -i 's|su - |su -s /bin/sh - |' "$pkgdir/usr/share/jetty/bin/jetty.sh"
+
+ rm "$pkgdir/usr/share/jetty/lib/setuid/libsetuid-osx.so"
+}
+
diff --git a/jetty.default b/jetty.default
new file mode 100644
index 000000000000..3e585d84371c
--- /dev/null
+++ b/jetty.default
@@ -0,0 +1,17 @@
+#JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk/jre}
+#JAVA=$JAVA_HOME/bin/java
+#JAVA_OPTIONS=
+
+#JETTY_ARGS=
+JETTY_PORT=8080
+JETTY_USER=jetty
+JETTY_HOME=/usr/share/jetty
+JETTY_RUN=/run/jetty
+JETTY_LOGS=/var/log/jetty
+JETTY_CONSOLE=$JETTY_LOGS/console.log
+
+# Autodetected variables:
+#JETTY_BASE=$JETTY_HOME
+#JETTY_PID=$JETTY_RUN/jetty.pid
+#JETTY_STATE=$JETTY_RUN/jetty.state
+#JETTY_CONF=$JETTY_BASE/etc/jetty.conf
diff --git a/jetty.install b/jetty.install
new file mode 100644
index 000000000000..19aac207d6cb
--- /dev/null
+++ b/jetty.install
@@ -0,0 +1,25 @@
+post_install() {
+ groupadd jetty &> /dev/null
+ useradd -g jetty -d /usr/share/jetty -s /bin/false jetty &> /dev/null
+ chown -R jetty:jetty /usr/share/jetty
+ chown -R jetty:jetty /var/log/jetty
+ chown -R jetty:jetty /var/lib/jetty/webapps
+}
+
+post_upgrade(){
+ getent group jetty > /dev/null 2>&1 || groupadd jetty &> /dev/null
+ getent passwd jetty > /dev/null 2>&1 || useradd -g jetty -d /usr/share/jetty -s /bin/false jetty &> /dev/null
+ chown -R jetty:jetty /usr/share/jetty
+ chown -R jetty:jetty /var/log/jetty
+ chown -R jetty:jetty /var/lib/jetty/webapps
+}
+
+post_remove() {
+ if getent passwd jetty > /dev/null 2>&1; then
+ userdel jetty
+ fi
+ if getent group jetty > /dev/null 2>&1; then
+ groupdel jetty
+ fi
+}
+
diff --git a/jetty.logrotate b/jetty.logrotate
new file mode 100644
index 000000000000..3d24a262c717
--- /dev/null
+++ b/jetty.logrotate
@@ -0,0 +1,7 @@
+/var/log/jetty/*.log {
+ copytruncate
+ weekly
+ rotate 52
+ compress
+ missingok
+}
diff --git a/jetty.service b/jetty.service
new file mode 100644
index 000000000000..ca96eecec5d7
--- /dev/null
+++ b/jetty.service
@@ -0,0 +1,19 @@
+# Systemd unit file for jetty
+#
+# Multiple copies of this service (i.e. multiple concurrently running
+# jetty servers) are not supported right now. Expect this to come with
+# future updates
+
+[Unit]
+Description=Jetty Web Application Server
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/jetty start
+ExecStop=/usr/bin/jetty stop
+ExecReload=/usr/bin/jetty restart
+PIDFile=/run/jetty/jetty.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/rundir.patch b/rundir.patch
new file mode 100644
index 000000000000..1f230cad8d7a
--- /dev/null
+++ b/rundir.patch
@@ -0,0 +1,24 @@
+--- a/jetty.sh 2014-05-26 20:37:30.000000000 +0300
++++ b/jetty.sh 2014-06-06 23:47:41.000000000 +0300
+@@ -261,10 +261,8 @@
+ #####################################################
+ # Find a location for the pid file
+ #####################################################
+-if [ -z "$JETTY_RUN" ]
+-then
+- JETTY_RUN=$(findDirectory -w /var/run /usr/var/run $JETTY_BASE /tmp)
+-fi
++mkdir -p "$JETTY_RUN"
++chown -R "$JETTY_USER":"$JETTY_USER" "$JETTY_RUN"
+
+ #####################################################
+ # Find a pid and state file
+@@ -276,7 +274,7 @@
+
+ if [ -z "$JETTY_STATE" ]
+ then
+- JETTY_STATE=$JETTY_BASE/${NAME}.state
++ JETTY_STATE=$JETTY_RUN/${NAME}.state
+ fi
+ JETTY_ARGS+=("jetty.state=$JETTY_STATE")
+ rm -f $JETTY_STATE