summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Obst2015-06-08 10:55:33 +0200
committerZdenek Obst2015-06-08 10:55:33 +0200
commit93ca0a74f549b3177dbb75c43bee6eb326ae18b1 (patch)
tree6d05798dcfbe6a7ec34ff9e2411c0e666a2c1e0c
downloadaur-93ca0a74f549b3177dbb75c43bee6eb326ae18b1.tar.gz
Initial commit
-rw-r--r--.SRCINFO42
-rw-r--r--PKGBUILD62
-rwxr-xr-xsystemd-wrapper.sh12
-rwxr-xr-xwildfly.install33
-rwxr-xr-xwildfly.service13
-rwxr-xr-xwildfly.sh21
6 files changed, 183 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..ad8c07fc889
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,42 @@
+pkgbase = wildfly
+ pkgdesc = Wildfly Application Server
+ pkgver = 8.2.0.Final
+ pkgrel = 2
+ url = http://www.wildfly.org/
+ install = wildfly.install
+ arch = any
+ license = LGPL
+ depends = java-runtime>=7
+ backup = etc/profile.d/wildfly.sh
+ backup = opt/wildfly/domain/configuration/application-roles.properties
+ backup = opt/wildfly/domain/configuration/application-users.properties
+ backup = opt/wildfly/domain/configuration/logging.properties
+ backup = opt/wildfly/domain/configuration/mgmt-groups.properties
+ backup = opt/wildfly/domain/configuration/mgmt-users.properties
+ backup = opt/wildfly/domain/configuration/domain.xml
+ backup = opt/wildfly/domain/configuration/host.xml
+ backup = opt/wildfly/standalone/configuration/application-roles.properties
+ backup = opt/wildfly/standalone/configuration/application-users.properties
+ backup = opt/wildfly/standalone/configuration/logging.properties
+ backup = opt/wildfly/standalone/configuration/mgmt-groups.properties
+ backup = opt/wildfly/standalone/configuration/mgmt-users.properties
+ backup = opt/wildfly/standalone/configuration/standalone.xml
+ backup = opt/wildfly/bin/add-user.properties
+ backup = opt/wildfly/bin/appclient.conf
+ backup = opt/wildfly/bin/domain.conf
+ backup = opt/wildfly/bin/jboss-cli-logging.properties
+ backup = opt/wildfly/bin/jboss-cli.xml
+ backup = opt/wildfly/bin/standalone.conf
+ source = http://download.jboss.org/wildfly/8.2.0.Final/wildfly-8.2.0.Final.tar.gz
+ source = wildfly.service
+ source = wildfly.sh
+ source = wildfly.install
+ source = systemd-wrapper.sh
+ sha256sums = bf16e2be38fd1476b0e8a0b038f7d41d7ab525fc96c2a1077338814b7442728b
+ sha256sums = 65e4b22b106aa16413e5c95686969b3f16974235451d8445ce4c562299325412
+ sha256sums = 3b2d059fcecb799ea8134b23ee0b77b4bc53dd99c7bd541679c4c139638b323a
+ sha256sums = a360ddb4beb9c704257bd78e08e8eea69c43b410a9c93d346541158c3b9d4330
+ sha256sums = 922035fcf68a66ed4b36a89370d2335941cb64ef8561e81fa6f59b5784f659e1
+
+pkgname = wildfly
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..83298743578
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Wildfly Application Server package
+# Maintainer: Zdenek Obst <zdenek dot obst at gmail dot com>
+
+pkgname=wildfly
+pkgver=8.2.0.Final
+pkgrel=2
+
+pkgdesc='Wildfly Application Server'
+arch=('any')
+url='http://www.wildfly.org/'
+license=('LGPL')
+depends=('java-runtime>=7')
+conficts=('wildfly-devel')
+
+_pkgloc=opt
+backup=(etc/profile.d/${pkgname}.sh
+ ${_pkgloc}/${pkgname}/domain/configuration/application-roles.properties
+ ${_pkgloc}/${pkgname}/domain/configuration/application-users.properties
+ ${_pkgloc}/${pkgname}/domain/configuration/logging.properties
+ ${_pkgloc}/${pkgname}/domain/configuration/mgmt-groups.properties
+ ${_pkgloc}/${pkgname}/domain/configuration/mgmt-users.properties
+ ${_pkgloc}/${pkgname}/domain/configuration/domain.xml
+ ${_pkgloc}/${pkgname}/domain/configuration/host.xml
+ ${_pkgloc}/${pkgname}/standalone/configuration/application-roles.properties
+ ${_pkgloc}/${pkgname}/standalone/configuration/application-users.properties
+ ${_pkgloc}/${pkgname}/standalone/configuration/logging.properties
+ ${_pkgloc}/${pkgname}/standalone/configuration/mgmt-groups.properties
+ ${_pkgloc}/${pkgname}/standalone/configuration/mgmt-users.properties
+ ${_pkgloc}/${pkgname}/standalone/configuration/standalone.xml
+ ${_pkgloc}/${pkgname}/bin/add-user.properties
+ ${_pkgloc}/${pkgname}/bin/appclient.conf
+ ${_pkgloc}/${pkgname}/bin/domain.conf
+ ${_pkgloc}/${pkgname}/bin/jboss-cli-logging.properties
+ ${_pkgloc}/${pkgname}/bin/jboss-cli.xml
+ ${_pkgloc}/${pkgname}/bin/standalone.conf)
+install=${pkgname}.install
+source=(http://download.jboss.org/wildfly/${pkgver}/wildfly-${pkgver}.tar.gz
+ ${pkgname}.service
+ ${pkgname}.sh
+ ${pkgname}.install
+ systemd-wrapper.sh)
+sha256sums=('bf16e2be38fd1476b0e8a0b038f7d41d7ab525fc96c2a1077338814b7442728b'
+ '65e4b22b106aa16413e5c95686969b3f16974235451d8445ce4c562299325412'
+ '3b2d059fcecb799ea8134b23ee0b77b4bc53dd99c7bd541679c4c139638b323a'
+ 'a360ddb4beb9c704257bd78e08e8eea69c43b410a9c93d346541158c3b9d4330'
+ '922035fcf68a66ed4b36a89370d2335941cb64ef8561e81fa6f59b5784f659e1')
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ rm -f bin/*.{bat,exe}
+ install -dm755 ${pkgdir}/${_pkgloc}
+ cp -R ${srcdir}/${pkgname}-${pkgver} ${pkgdir}/${_pkgloc}/${pkgname}
+
+ # Prepare systemd service file
+ install -Dm755 ${srcdir}/${pkgname}.service ${pkgdir}/usr/lib/systemd/system/${pkgname}.service
+
+ # Prepare file for environment variables to profile.d
+ install -Dm755 ${srcdir}/${pkgname}.sh ${pkgdir}/etc/profile.d/${pkgname}.sh
+
+ # Include wrapper script for systemd startup
+ install -Dm755 ${srcdir}/systemd-wrapper.sh ${pkgdir}/${_pkgloc}/${pkgname}/bin/systemd-wrapper.sh
+}
diff --git a/systemd-wrapper.sh b/systemd-wrapper.sh
new file mode 100755
index 00000000000..5eab363b62a
--- /dev/null
+++ b/systemd-wrapper.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+source /etc/profile.d/wildfly.sh
+source /etc/profile.d/jre.sh
+
+if [ "$JBOSS_MODE" = "standalone" ]; then
+ JBOSS_CONFIGS="-c $JBOSS_CONFIG"
+else
+ JBOSS_CONFIGS="--domain-config=$JBOSS_DOMAIN_CONFIG --host-config=$JBOSS_HOST_CONFIG"
+fi
+
+export LAUNCH_IN_BACKGROUND=1
+exec $JBOSS_HOME/bin/$JBOSS_MODE.sh $JBOSS_CONFIGS "$@" >> $JBOSS_CONSOLE_LOG 2>&1
diff --git a/wildfly.install b/wildfly.install
new file mode 100755
index 00000000000..485050c3b69
--- /dev/null
+++ b/wildfly.install
@@ -0,0 +1,33 @@
+post_install() {
+ . /etc/profile.d/wildfly.sh
+
+ getent group $JBOSS_USER >/dev/null 2>&1 || groupadd -r $JBOSS_USER
+ getent passwd $JBOSS_USER >/dev/null 2>&1 || useradd -g $JBOSS_USER -d $JBOSS_HOME -s /bin/bash -r $JBOSS_USER
+ chown -R $JBOSS_USER:$JBOSS_USER $JBOSS_HOME
+
+ JBOSS_PIDFILE_DIR=`dirname $JBOSS_PIDFILE`
+ mkdir -p $JBOSS_PIDFILE_DIR
+ chown $JBOSS_USER:$JBOSS_USER $JBOSS_PIDFILE_DIR
+
+ JBOSS_CONSOLE_LOG_DIR=`dirname $JBOSS_CONSOLE_LOG`
+ mkdir -p $JBOSS_CONSOLE_LOG_DIR
+ chown $JBOSS_USER:$JBOSS_USER $JBOSS_CONSOLE_LOG_DIR
+
+ echo 'Environment/configuration variables are placed in /etc/profile.d/wildfly.sh'
+ echo 'This package contains only Final versions of AS. If you are looking for Alpha/Beta/CR... versions, please get wildfly-devel package instead'
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ . /etc/profile.d/wildfly.sh
+
+ if getent passwd $JBOSS_USER >/dev/null 2>&1; then
+ userdel $JBOSS_USER
+ fi
+ if getent group $JBOSS_USER >/dev/null 2>&1; then
+ groupdel $JBOSS_USER
+ fi
+}
diff --git a/wildfly.service b/wildfly.service
new file mode 100755
index 00000000000..f3ed738ece8
--- /dev/null
+++ b/wildfly.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Wildfly Application Server
+
+[Service]
+Type=simple
+User=wildfly
+PIDFile=/run/wildfly/wildfly.pid
+ExecStart=/opt/wildfly/bin/systemd-wrapper.sh
+ExecReload=/opt/wildfly/bin/jboss-cli.sh --connect command=:reload
+ExecStop=/opt/wildfly/bin/jboss-cli.sh --connect command=:shutdown
+
+[Install]
+WantedBy=multi-user.target
diff --git a/wildfly.sh b/wildfly.sh
new file mode 100755
index 00000000000..a225e378fb5
--- /dev/null
+++ b/wildfly.sh
@@ -0,0 +1,21 @@
+# Location of WildFly
+export JBOSS_HOME=/opt/wildfly
+
+# Application server mode (standalone/domain)
+export JBOSS_MODE=standalone
+
+# Configuration for standalone mode
+export JBOSS_CONFIG=standalone.xml
+
+# Configuration for domain mode
+export JBOSS_DOMAIN_CONFIG=domain.xml
+export JBOSS_HOST_CONFIG=host-master.xml
+
+# The username who should own the process.
+export JBOSS_USER=wildfly
+
+# PID file
+export JBOSS_PIDFILE=/run/wildfly/wildfly.pid
+
+# Location to keep the console log
+export JBOSS_CONSOLE_LOG=/var/log/wildfly/console.log