diff options
author | Giorgio Peron <giorgio.peron@gmail.com> | 2014-03-02 22:50:06 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-03-03 01:13:05 +0700 |
commit | d36d82a9a977ddb8f8fd0882edf01586da129254 (patch) | |
tree | 512b7c0eb6e12a76df0a871bc8aa4f1b0f681f22 | |
parent | eab0b988e13cfaf0184e25b02cd7d05e280e7b5a (diff) |
network/wildfly: Added (Application Runtime).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/wildfly/README | 12 | ||||
-rw-r--r-- | network/wildfly/doinst.sh | 26 | ||||
-rw-r--r-- | network/wildfly/rc.wildfly | 145 | ||||
-rw-r--r-- | network/wildfly/slack-desc | 19 | ||||
-rw-r--r-- | network/wildfly/wildfly.SlackBuild | 159 | ||||
-rw-r--r-- | network/wildfly/wildfly.info | 10 |
6 files changed, 371 insertions, 0 deletions
diff --git a/network/wildfly/README b/network/wildfly/README new file mode 100644 index 0000000000000..5ad220da7f676 --- /dev/null +++ b/network/wildfly/README @@ -0,0 +1,12 @@ +WildFly is a free, open source, Java EE certified platform for developing and +deploying enterprise Java applications, Web applications, and Portals, +WildFly Application Server provides the full range of Java EE 7 features as +well as extended enterprise services including clustering, caching, and +persistence. + +WildFly requires a "wildfly" user and group; create these before running the +SlackBuild script. Examples: + +# groupadd -g 281 -r wildfly +# useradd -u 281 -M -r -s /bin/bash -d /usr/share/wildfly \ + -c "WildFly Application Server" -g wildfly wildfly diff --git a/network/wildfly/doinst.sh b/network/wildfly/doinst.sh new file mode 100644 index 0000000000000..8eafd82853440 --- /dev/null +++ b/network/wildfly/doinst.sh @@ -0,0 +1,26 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +# Keep same perms on rc.wildfly.new: +preserve_perms etc/rc.d/rc.wildfly.new diff --git a/network/wildfly/rc.wildfly b/network/wildfly/rc.wildfly new file mode 100644 index 0000000000000..b98d89cc18191 --- /dev/null +++ b/network/wildfly/rc.wildfly @@ -0,0 +1,145 @@ +#!/bin/sh + +# Start/stop/restart wildfly. + +# Copyright 2014 Giorgio Peron, Campodarsego, PD, Italy giorgio.peron@gmail.com +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# define where wildfly is - this is the directory containing directories log, bin, conf etc +WILDFLY_HOME=${WILDFLY_HOME:-"/usr/share/wildfly"} + +# make java is on your path +JAVAPTH=${JAVAPTH:-"$JAVA_HOME/bin"} + +# define the user under which wildfly will run, or use RUNASIS to run as the current user +WILDFLYUS=${WILDFLYUS:-"wildfly"} + +export LAUNCH_WILDFLY_IN_BACKGROUND=yes + +# define the script to use to start standalone wildfly +WILDFLY_START_STANDALONE=${WILDFLY_START_STANDALONE:-"$WILDFLY_HOME/bin/standalone.sh "} + +# define the script to use to shutdown wildfly +# change host and port as need +WILDFLY_STOP_STANDALONE=${WILDFLY_STOP_STANDALONE:-"$WILDFLY_HOME/bin/jboss-cli.sh --connect controller=127.0.0.1:9999 command=:shutdown"} + +# define log file +WILDFLY_CONSOLE="/var/log/wildfly/wildfly.log" +WILDFLY_DOMAIN_CONSOLE="/var/log/wildfly/wildfly_domain.log" + +if [ -n "$WILDFLY_CONSOLE" -a ! -d "$WILDFLY_CONSOLE" ]; then + # ensure the file exists + touch $WILDFLY_CONSOLE + if [ "$WILDFLYUS" != "RUNASIS" ]; then + chown -R $WILDFLYUS.$WILDFLYUS $WILDFLY_CONSOLE + fi +fi + +if [ -n "$WILDFLY_CONSOLE" -a ! -f "$WILDFLY_CONSOLE" ]; then + echo "WARNING: location for saving console log invalid: $WILDFLY_CONSOLE" + echo "WARNING: ignoring it and using /dev/null" + WILDFLY_CONSOLE="/dev/null" +fi + +# define what will be done with the console log +WILDFLY_CONSOLE=${WILDFLY_CONSOLE:-"/dev/null"} + +if [ -n "$WILDFLY_DOMAIN_CONSOLE" -a ! -d "$WILDFLY_DOMAIN_CONSOLE" ]; then + # ensure the file exists + touch $WILDFLY_DOMAIN_CONSOLE + if [ "$WILDFLYUS" != "RUNASIS" ]; then + chown -R $WILDFLYUS.$WILDFLYUS $WILDFLY_DOMAIN_CONSOLE + fi +fi + +if [ -n "$WILDFLY_DOMAIN_CONSOLE" -a ! -f "$WILDFLY_DOMAIN_CONSOLE" ]; then + echo "WARNING: location for saving console log invalid: $WILDFLY_DOMAIN_CONSOLE" + echo "WARNING: ignoring it and using /dev/null" + WILDFLY_DOMAIN_CONSOLE="/dev/null" +fi + +# define what will be done with the console log +WILDFLY_DOMAIN_CONSOLE=${WILDFLY_DOMAIN_CONSOLE:-"/dev/null"} + +CMD_START_STANDALONE="cd $WILDFLY_HOME/bin; $WILDFLY_START_STANDALONE" +CMD_STOP_STANDALONE="cd $WILDFLY_HOME/bin; $WILDFLY_STOP_STANDALONE" + +if [ "$WILDFLYUS" = "RUNASIS" ]; then + SUBIT="" +else + SUBIT="su $WILDFLYUS -c " +fi + +if [ -z "`echo $PATH | grep $JAVAPTH`" ]; then + export PATH=$PATH:$JAVAPTH +fi + +if [ ! -d "$WILDFLY_HOME" ]; then + echo "WILDFLY_HOME does not exist as a valid directory : $WILDFLY_HOME" + exit 1 +fi + +case "$1" in +start) + echo "Starting WildFly Application Server" + cd $WILDFLY_HOME/bin + if [ -z "$SUBIT" ]; then + eval $CMD_START_STANDALONE >${WILDFLY_CONSOLE} 2>&1 & + else + $SUBIT "$CMD_START_STANDALONE >${WILDFLY_CONSOLE} 2>&1 &" + fi + ;; +stop) + echo "Stopping WildFly Application Server" + if [ -z "$SUBIT" ]; then + $CMD_STOP_STANDALONE >/dev/null 2>&1 + else + $SUBIT "$CMD_STOP_STANDALONE >/dev/null 2>&1" + fi + ;; +restart) + $0 stop + $0 start + ;; +domain-start) + echo "Starting Domain WildFly Application Server" + cd $WILDFLY_HOME/bin + if [ -z "$SUBIT" ]; then + eval $CMD_START_DOMAIN >${WILDFLY_DOMAIN_CONSOLE} 2>&1 & + else + $SUBIT "$CMD_START_DOMAIN >${WILDFLY_DOMAIN_CONSOLE} 2>&1 &" + fi + ;; +domain-stop) + echo "Stopping Domain WildFly Application Server" + if [ -z "$SUBIT" ]; then + $CMD_STOP_DOMAIN >/dev/null 2>&1 + else + $SUBIT "$CMD_STOP_DOMAIN >/dev/null 2>&1" + fi + ;; +domain-restart) + $0 domain-stop + $0 domain-start + ;; +*) + echo "usage: $0 (start|stop|restart|help|domain-start|domain-stop|domain-restart)" +esac diff --git a/network/wildfly/slack-desc b/network/wildfly/slack-desc new file mode 100644 index 0000000000000..19caa042d7201 --- /dev/null +++ b/network/wildfly/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +wildfly: WildFly (Application Runtime) +wildfly: +wildfly: WildFly is a free, open source, Java EE 7 platform for +wildfly: developing and deploying enterprise Java applications, Web +wildfly: applications, and Portals, Wildfly provides the full +wildfly: range of Java EE 7 features as well as extended enterprise services +wildfly: including clustering, caching, and persistence. +wildfly: +wildfly: +wildfly: Homepage http://www.wildfly.org/ +wildfly: diff --git a/network/wildfly/wildfly.SlackBuild b/network/wildfly/wildfly.SlackBuild new file mode 100644 index 0000000000000..4b723b740eb47 --- /dev/null +++ b/network/wildfly/wildfly.SlackBuild @@ -0,0 +1,159 @@ +#!/bin/sh +# Slackware build script for WildFly + +# Copyright 2014 Giorgio Peron, Campodarsego, PD, Italy giorgio.peron@gmail.com +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +PRGNAM=wildfly +VERSION=${VERSION:-8.0.0} +MINORVER=${MINORVER:-.Final} + +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +ARCH=noarch + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +# Check if the 'wildfly' user & group exist: +if [ "$(grep ^wildfly /etc/passwd)" = "" -o "$(grep ^wildfly /etc/group)" = "" ] ; then + printf "\nYou must have a wildfly user and group.\n\nExample:\n" + printf "\t# groupadd -g 281 wildfly\n" + printf "\t# useradd -u 281 -M -r -s /bin/bash -d /usr/share/wildfly -c \"Wildfly Application Server\" -g wildfly wildfly\n\n" + exit 1 +fi + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +tar xvzf $CWD/$PRGNAM-$VERSION$MINORVER.tar.gz + +# move everything to /usr/share/wildfly +mkdir -p $PKG/usr/share/$PRGNAM +mv $TMP/$PRGNAM-$VERSION$MINORVER/* $PKG/usr/share/$PRGNAM +cd $PKG/usr/share/$PRGNAM +chown -R root:root . + +# Move the docs to our standard location first +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +mv docs/* $PKG/usr/doc/$PRGNAM-$VERSION +mv *.txt $PKG/usr/doc/$PRGNAM-$VERSION +rm -rf docs +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +# directory server: wildfly/standalone/* -> /var/lib/wildfly/standalone/* +cd $PKG +mkdir -p $PKG/var/lib/$PRGNAM +mv $PKG/usr/share/$PRGNAM/standalone $PKG/var/lib/$PRGNAM +cd $PKG/usr/share/$PRGNAM +ln -sf ../../../var/lib/$PRGNAM/standalone +mv $PKG/usr/share/$PRGNAM/domain $PKG/var/lib/$PRGNAM +cd $PKG/usr/share/$PRGNAM +ln -sf ../../../var/lib/$PRGNAM/domain +mkdir -p $PKG/etc/$PRGNAM/{standalone,domain} +mv $PKG/var/lib/$PRGNAM/standalone/configuration $PKG/etc/$PRGNAM/standalone/ +mv $PKG/var/lib/$PRGNAM/domain/configuration $PKG/etc/$PRGNAM/domain/ +cd $PKG/var/lib/$PRGNAM/standalone +ln -sf ../../../../etc/$PRGNAM/standalone/configuration configuration +cd $PKG/var/lib/$PRGNAM/domain +ln -sf ../../../../etc/$PRGNAM/domain/configuration configuration +mkdir -p $PKG/var/{log,tmp}/$PRGNAM/standalone +cd $PKG/var/lib/$PRGNAM/standalone +ln -sf ../../../log/$PRGNAM/standalone log +ln -sf ../../../tmp/$PRGNAM/standalone tmp + +mv $PKG/usr/share/$PRGNAM/bin/standalone.conf $PKG/etc/$PRGNAM/standalone/ +mv $PKG/usr/share/$PRGNAM/bin/domain.conf $PKG/etc/$PRGNAM/domain/ +cd $PKG/usr/share/$PRGNAM/bin +ln -sf ../../../../etc/$PRGNAM/standalone/standalone.conf +ln -sf ../../../../etc/$PRGNAM/domain/domain.conf + +# the xml history need some special treatment +mkdir -p $PKG/var/lib/$PRGNAM/standalone/standalone_xml_history +mkdir -p $PKG/var/lib/$PRGNAM/domain/domain_xml_history +mkdir -p $PKG/var/lib/$PRGNAM/domain/host_xml_history +cd $PKG/etc/$PRGNAM/standalone/configuration +ln -sf ../../../../var/lib/$PRGNAM/standalone/standalone_xml_history +cd $PKG/etc/$PRGNAM/domain/configuration +ln -sf ../../../../var/lib/$PRGNAM/domain/domain_xml_history +ln -sf ../../../../var/lib/$PRGNAM/domain/host_xml_history + +# Add /etc/rc.d/rc.wildfly.new +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new + +# Add /etc/profile.d/wildfly.sh +mkdir -p $PKG/etc/profile.d +cat > $PKG/etc/profile.d/$PRGNAM.sh << EOF +#!/bin/sh +export JBOSS_HOME=/usr/share/wildfly +EOF +cat > $PKG/etc/profile.d/$PRGNAM.csh << EOF +#!/bin/csh +setenv JBOSS_HOME /usr/share/wildfly +EOF +chmod +x $PKG/etc/profile.d/$PRGNAM.* + +# Remove win*z executables +rm $PKG/usr/share/$PRGNAM/bin/*.bat +chmod 0755 $PKG/usr/share/$PRGNAM/bin/*.sh + +mkdir -p $PKG/sbin +cd $PKG/sbin +ln -sf ../usr/share/$PRGNAM/bin/add-user.sh +ln -sf ../usr/share/$PRGNAM/bin/appclient.sh +ln -sf ../usr/share/$PRGNAM/bin/domain.sh +ln -sf ../usr/share/$PRGNAM/bin/jboss-cli.sh +ln -sf ../usr/share/$PRGNAM/bin/jconsole.sh +ln -sf ../usr/share/$PRGNAM/bin/jdr.sh +ln -sf ../usr/share/$PRGNAM/bin/run.sh +ln -sf ../usr/share/$PRGNAM/bin/standalone.sh +ln -sf ../usr/share/$PRGNAM/bin/wsconsume.sh +ln -sf ../usr/share/$PRGNAM/bin/wsprovide.sh + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +chown -R root:root $PKG +find -L $PKG \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +chown -R wildfly:wildfly $PKG/var/{lib,log,tmp}/$PRGNAM +chown -R wildfly:wildfly $PKG/etc/$PRGNAM/{standalone,domain} + +# Don't overwrite existing configuration: +cd $PKG +for cf in $( find etc/$PRGNAM/ -type f ); do + chmod -x $cf + mv $cf $cf.new + echo "config $cf.new" >> install/doinst.sh +done + +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/wildfly/wildfly.info b/network/wildfly/wildfly.info new file mode 100644 index 0000000000000..b06b65180c3d7 --- /dev/null +++ b/network/wildfly/wildfly.info @@ -0,0 +1,10 @@ +PRGNAM="wildfly" +VERSION="8.0.0" +HOMEPAGE="http://www.wildfly.org/" +DOWNLOAD="http://download.jboss.org/wildfly/8.0.0.Final/wildfly-8.0.0.Final.tar.gz" +MD5SUM="0604f208b5744901127f25285c514081" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="jdk" +MAINTAINER="Giorgio Peron" +EMAIL="giorgio.peron@gmail.com" |