From 64a99a719f23ef69193eb8e0027c040e5c74d3ee Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sun, 1 May 2016 23:10:52 +0200 Subject: testing/jetty-runner: move to the community repo --- community/jetty-runner/APKBUILD | 45 ++++++++++++++++++ community/jetty-runner/jetty-runner | 5 ++ community/jetty-runner/jetty-runner.confd | 50 +++++++++++++++++++ community/jetty-runner/jetty-runner.initd | 79 +++++++++++++++++++++++++++++++ 4 files changed, 179 insertions(+) create mode 100644 community/jetty-runner/APKBUILD create mode 100644 community/jetty-runner/jetty-runner create mode 100644 community/jetty-runner/jetty-runner.confd create mode 100644 community/jetty-runner/jetty-runner.initd (limited to 'community/jetty-runner') diff --git a/community/jetty-runner/APKBUILD b/community/jetty-runner/APKBUILD new file mode 100644 index 0000000000..304ebd2ba5 --- /dev/null +++ b/community/jetty-runner/APKBUILD @@ -0,0 +1,45 @@ +# Contributor: Jakub Jirutka +# Maintainer: Jakub Jirutka +pkgname="jetty-runner" +pkgver="9.2.16.20160414" +_pkgver="${pkgver%.*}.v${pkgver##*.}" +pkgrel=0 +pkgdesc="Fast and easy way to run Java web application from the command line." +url="https://www.eclipse.org/jetty" +# JDK is not build for armhf (nmeum) +arch="x86_64 x86" +license="ASL-2.0" +depends="openjdk8-jre-base" +makedepends="" +source="https://repo.maven.apache.org/maven2/org/eclipse/jetty/$pkgname/$_pkgver/$pkgname-$_pkgver.jar + $pkgname + $pkgname.initd + $pkgname.confd" + +build() { + return 0 +} + +package() { + cd "$srcdir" + + install -m644 -D "$pkgname-$_pkgver.jar" \ + "$pkgdir/usr/share/java/$pkgname.jar" || return 1 + install -m755 -D $pkgname "$pkgdir/usr/bin/$pkgname" || return 1 + + install -m755 -D $pkgname.initd "$pkgdir/etc/init.d/$pkgname" || return 1 + install -m644 -D $pkgname.confd "$pkgdir/etc/conf.d/$pkgname" +} + +md5sums="0e0fea0905281611852344f788aacccf jetty-runner-9.2.16.v20160414.jar +1cb6fdbfb741c751b58702d11ffa7dde jetty-runner +8e7e5c9d03374a9ea5cbe3e2f9b7a123 jetty-runner.initd +9361eabb2dfce897bee701c470c77da1 jetty-runner.confd" +sha256sums="57e74fbce07c7b30c0524f25f98d294fcd55034dbd65f7a41030a85a63176a20 jetty-runner-9.2.16.v20160414.jar +d4d0b3b13df6291e8df6427beccc1a2694af46c6f5e9a94da5b4e8291437d569 jetty-runner +dd04eef7ee4f6a9a3fce398bea09ebbbd6a0b686e6408a44bbdd954eb37dfa7f jetty-runner.initd +995d203b95c1b311537d1d58b7de3bb83cc8ef554033c235a5917b8964f4eb12 jetty-runner.confd" +sha512sums="3e58424c3eb418bc6cb0752d03851bb9b40bc2be4c63c5a4d2038261f4e42a23fc615bf5a4aebc891e28cba88176ebe2c43c9a95829fd4ecb5c71e0cd1fbab8f jetty-runner-9.2.16.v20160414.jar +bcf503157b94c7714355e6ff66eb87e7ef9558247b4242d02452d768cd99a6c73bd1f9aad899128fec063f8c68901d98cc41497211eacf075ae10dfe2f28557d jetty-runner +a2f78a637374fb43ad0ddf58593dd31fd66f997171c54e204638cb00f67365e17346af1763273f1ebd35fca175d0df29907ddcd74745c24d766a329a19e7d4ce jetty-runner.initd +3e7e52e31f69b54ff81e741ccec8fad5afb5277affb085f6b4f42d643a5609a75e8b6f83fff33c24e41866a42e698de72d687ba5f6cf74825b40ac8c7dda57b3 jetty-runner.confd" diff --git a/community/jetty-runner/jetty-runner b/community/jetty-runner/jetty-runner new file mode 100644 index 0000000000..cc6d83a3ab --- /dev/null +++ b/community/jetty-runner/jetty-runner @@ -0,0 +1,5 @@ +#!/bin/sh + +java="${JAVA_HOME:+$JAVA_HOME/bin/}java" + +$java $JAVA_OPTS -cp /usr/share/java/jetty-runner.jar org.eclipse.jetty.runner.Runner $@ diff --git a/community/jetty-runner/jetty-runner.confd b/community/jetty-runner/jetty-runner.confd new file mode 100644 index 0000000000..10df14f290 --- /dev/null +++ b/community/jetty-runner/jetty-runner.confd @@ -0,0 +1,50 @@ +# YOU SHOULD NOT MODIFY THIS FILE! CREATE A COPY NAMED AFTER THE APPLICATION +# YOU WANT TO RUN AND MODIFY THAT INSTEAD (and remove this notice). + +# User to run the application. +user="nobody" + +# Path of the WAR file, the web app directory, or the context xml file to run. +webapp_path="" + +# The relative URL root (i.e. context path) of the application. +#context_root="" + +# The port to listen on for HTTP connections (or 0 for a randomly allocated port). +server_port="8080" + +# The name or IP of the interface to listen on (default is all interfaces). +#server_bind_address="" + +# Path of the log file to catch stdout/stderr of the server process. +# Use empty value to disable stdout/sderr logging. +#server_out_log="/var/log/jetty/server.log" + +# Path of the access log file. +# Use empty value to disable access log. +#server_access_log="/var/log/jetty/access.log" + +# Additional JARs to be added to the classloader. +# It may contain space or colon separated paths of JAR files or directories. +#server_extra_jars="" + +# Java system properties to pass to the JVM. +# Define space separated tuples of =; it will be transformed into +# -D= arguments for java. +#java_properties="" + +# Initial and maximum size of the heap (in megabytes). +# Note: This sets parameters -Xms and -Xmx. +java_heap_size="128" + +# Ratio of old/new generation sizes. The default value is 2 (i.e. max size of +# old will be twice as the max size of young). +# Note: This sets parameter -XX:NewRatio. +java_new_ratio="2" + +# Additional options to pass to the JVM. +java_opts="-XX:MaxGCPauseMillis=80" + +# You may use rc_need, rc_use, rc_after, rc_before and rc_provide variables to +# influence the dependencies of the service. +#rc_use="nginx postgresql" diff --git a/community/jetty-runner/jetty-runner.initd b/community/jetty-runner/jetty-runner.initd new file mode 100644 index 0000000000..b96b0aa07c --- /dev/null +++ b/community/jetty-runner/jetty-runner.initd @@ -0,0 +1,79 @@ +#!/sbin/openrc-run + +: ${name:=${RC_SVCNAME}} +: ${pidfile:=/run/${RC_SVCNAME}.pid} +: ${user:=nobody} +: ${jetty_runner:=/usr/share/java/jetty-runner.jar} + +command="java" +command_background="true" + +start_stop_daemon_args="--quiet --user $user" +retry="SIGTERM/20" + +depend() { + need net +} + +start_pre() { + if [ "$RC_SVCNAME" = "jetty-runner" ]; then + ewarn "You are not supposed to run this runscript directly. Instead, you should" + ewarn "create a symlink for the application you want to run as well as a copy of" + ewarn "the configuration file and modify it appropriately, like so:" + ewarn "" + ewarn " ln -s jetty-runner /etc/init.d/myapp" + ewarn " cp /etc/conf.d/jetty-runner /etc/conf.d/myapp" + ewarn "" + fi + + if [ ! -e "$webapp_path" ]; then + eerror "File or directory '$webapp_path' does not exist!"; exit 1 + fi + + if [ -n "$server_out_log" ]; then + checkpath -d -o "$user" "$(dirname "$server_out_log")" + fi + + if [ -n "$server_access_log" ]; then + checkpath -d -o "$user" "$(dirname "$server_access_log")" + fi + + if [ -n "$server_port" ] && nc -z 127.0.0.1 "$server_port"; then + eerror "Port $server_port is already in use!"; exit 1 + fi + + java_opts=" + -server + ${java_heap_size:+ -Xms${java_heap_size}M -Xmx${java_heap_size}M} + ${java_new_ratio:+ -XX:NewRatio=${java_new_ratio}} + -Dfile.encoding=utf-8 + $java_opts" + + local item; for item in $java_properties; do + java_opts="$java_opts -D${item}" + done + + jetty_opts=" + $(optif --port "$server_port") + $(optif --host "$server_bind_address") + $(optif --out "$server_out_log") + $(optif --log "$server_access_log")" + + local path; for path in ${server_extra_jars//:/ }; do + if [ -f "$path" ]; then + jetty_opts="$jetty_opts --jar $path" + elif [ -d "$path" ]; then + jetty_opts="$jetty_opts --lib $path" + else + ewarn "JAR file or directory $path does not exist!" + fi + done + + jetty_opts="$jetty_opts $(optif --path "$context_root") $webapp_path" + + command_args="$java_opts -cp $jetty_runner org.eclipse.jetty.runner.Runner $jetty_opts" +} + +optif() { + test -n "$2" && echo "$1 $2" +} -- cgit v1.2.3