summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranck Lucien Duriez2019-02-08 10:27:28 +0000
committerFranck Lucien Duriez2019-02-08 16:33:04 +0100
commit4673b17ec339a9904420aaa57cf00c8bacf2139b (patch)
tree2eb790739f6311eb89dae4c1b0bd39bdbe15eac6
downloadaur-opensearchserver.tar.gz
First commit
-rw-r--r--.SRCINFO19
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD38
-rw-r--r--opensearchserver.service18
-rw-r--r--start.sh19
-rw-r--r--stop.sh24
6 files changed, 122 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9167cf583a33
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = opensearchserver
+ pkgdesc = The open-source enterprise class search engine software
+ pkgver = 1.5.14
+ pkgrel = 1
+ url = http://www.opensearchserver.com
+ arch = any
+ license = GPL
+ depends = java-runtime-common
+ source = http://sourceforge.net/projects/opensearchserve/files/Stable_release/1.5.14/opensearchserver-1.5.14-d0d167e.zip
+ source = opensearchserver.service
+ source = start.sh
+ source = stop.sh
+ md5sums = 07104dd4fff4174833e3678c57c04d1b
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = opensearchserver
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..ae12c5feadf3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.pkg.tar.xz
+*.zip
+pkg/
+src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1a6e2dbcc952
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# This is an example PKGBUILD file. Use this as a start to creating your own,
+# and remove these comments. For more information, see 'man PKGBUILD'.
+# NOTE: Please fill out the license field for your package! If it is unknown,
+# then please put 'unknown'.
+
+# Maintainer: Your Name <youremail@domain.com>
+pkgname=opensearchserver
+pkgver=1.5.14
+pkgrel=1
+pkgdesc='The open-source enterprise class search engine software'
+arch=('any')
+url='http://www.opensearchserver.com'
+license=('GPL')
+depends=('java-runtime-common')
+_commitsha1='d0d167e'
+source=(
+ "http://sourceforge.net/projects/opensearchserve/files/Stable_release/${pkgver}/${pkgname}-${pkgver}-${_commitsha1}.zip"
+ 'opensearchserver.service'
+ 'start.sh'
+ 'stop.sh')
+md5sums=(
+ '07104dd4fff4174833e3678c57c04d1b'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP')
+
+package() {
+ _dest=${pkgdir}/usr/share/${pkgname}
+ install -d "${_dest}"
+ install -m644 "${srcdir}/${pkgname}/LICENSE.txt" "${_dest}"
+ install -m644 "${srcdir}/${pkgname}/${pkgname}.jar" "${_dest}"
+ install -m644 "${srcdir}/${pkgname}/${pkgname}.war" "${_dest}"
+ install -m644 "${srcdir}/start.sh" "${_dest}"
+ install -m644 "${srcdir}/stop.sh" "${_dest}"
+
+ install -d "${pkgdir}/usr/lib/systemd/system"
+ install -m644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+}
diff --git a/opensearchserver.service b/opensearchserver.service
new file mode 100644
index 000000000000..231dab87ec7b
--- /dev/null
+++ b/opensearchserver.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=opensearchserver
+Wants=network.target
+After=network.target
+
+[Service]
+Environment="SERVER_PORT=9090"
+ExecStart=/bin/bash /usr/share/opensearchserver/start.sh
+ExecStop=/bin/bash /usr/share/opensearchserver/stop.sh
+PIDFile=opensearchserver/oss.pid
+ProtectHome=on
+ProtectSystem=on
+RuntimeDirectory=opensearchserver
+StateDirectory=opensearchserver
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/start.sh b/start.sh
new file mode 100644
index 000000000000..f4fa04184ded
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Move to the directory containing this script
+BASEDIR=`dirname "$0"`
+
+export LANG=en_US.UTF-8
+JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Djava.protocol.handler.pkgs=jcifs"
+
+# The directory containing the indexes (must be exported)
+export OPENSEARCHSERVER_DATA="$STATE_DIRECTORY"
+
+# Starting the server
+java $JAVA_OPTS -jar "${BASEDIR}/opensearchserver.jar" \
+ -extractDirectory "${RUNTIME_DIRECTORY}" \
+ -httpPort "${SERVER_PORT}" \
+ -uriEncoding UTF-8 &
+
+# Writing the PID
+echo $! > "$RUNTIME_DIRECTORY/oss.pid"
diff --git a/stop.sh b/stop.sh
new file mode 100644
index 000000000000..88893723a384
--- /dev/null
+++ b/stop.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# The location of the PID file
+OSS_PID_FILE="$RUNTIME_DIRECTORY/oss.pid"
+
+if ! test -f "$OSS_PID_FILE"
+then
+ echo "PID file not found. Stop aborted."
+ exit 1
+fi
+
+# Extract the PID
+OSS_PID=`cat "$OSS_PID_FILE"`
+
+# Check if the process exists
+kill -0 "$OSS_PID" >/dev/null 2>&1
+if [ $? -gt 0 ]
+then
+ echo "No matching process was found. Stop aborted."
+ exit 1
+fi
+
+# Stopping the process and removing the PID file
+kill "$OSS_PID" && rm "$OSS_PID_FILE"