aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDāvis2020-08-16 02:24:41 +0300
committerDāvis2020-08-16 02:24:41 +0300
commit89d60708eea35e680a8c44c610c2ebd568d2ee82 (patch)
treeb04bc3430df180aa2d7ff098071f535309734b3b
downloadaur-89d60708eea35e680a8c44c610c2ebd568d2ee82.tar.gz
First package release of OpenDJ
-rw-r--r--.SRCINFO25
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD82
-rw-r--r--README.md9
-rwxr-xr-xopendj-check-config21
-rw-r--r--opendj.service15
-rw-r--r--opendj.sysusers1
-rw-r--r--opendj.tmpfiles2
8 files changed, 160 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..684a2fe25c2f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = opendj
+ pkgdesc = OpenDJ is an LDAPv3 compliant directory service
+ pkgver = 4.4.6
+ pkgrel = 1
+ url = https://www.openidentityplatform.org/opendj
+ arch = any
+ license = CDDL
+ makedepends = unzip
+ makedepends = sed
+ makedepends = coreutils
+ depends = java-runtime
+ depends = sh
+ source = https://github.com/OpenIdentityPlatform/OpenDJ/releases/download/4.4.6/opendj-4.4.6.zip
+ source = opendj-check-config
+ source = opendj.service
+ source = opendj.sysusers
+ source = opendj.tmpfiles
+ sha256sums = 4365fa36b4176b5e2ea0e8212f466abd19ab9037edd759fa34475eac5286dbb0
+ sha256sums = 00536b0e88b0ba3ee3d7f5ddd41a07daad6d796fa0d57f4eba60f7a55d075c07
+ sha256sums = 70e16da40fc2971dbb9b9c8872f345b3895e510ce8e9accb6c4ccf6aa2cae6ed
+ sha256sums = cf710b63f2766563b8db39669708907d5b3873d58cef5226f02c1d3599a0128b
+ sha256sums = 33e1986926c63488628d853f617ae956a8cb04de8f70a1d0a61897dc94f122a2
+
+pkgname = opendj
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..f9b191a67a9b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/pkg/
+/src/
+/*.tar*
+/*.zip
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1cf7467ac39f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,82 @@
+# Maintainer: Dāvis Mosāns <davispuh at gmail dot com>
+
+pkgname=opendj
+pkgver=4.4.6
+pkgrel=1
+pkgdesc="OpenDJ is an LDAPv3 compliant directory service"
+arch=("any")
+url="https://www.openidentityplatform.org/opendj"
+license=("CDDL")
+depends=("java-runtime" "sh")
+makedepends=("unzip" "sed" "coreutils")
+source=("https://github.com/OpenIdentityPlatform/OpenDJ/releases/download/$pkgver/opendj-$pkgver.zip"
+ "opendj-check-config"
+ "opendj.service"
+ "opendj.sysusers"
+ "opendj.tmpfiles")
+sha256sums=("4365fa36b4176b5e2ea0e8212f466abd19ab9037edd759fa34475eac5286dbb0"
+ "00536b0e88b0ba3ee3d7f5ddd41a07daad6d796fa0d57f4eba60f7a55d075c07"
+ "70e16da40fc2971dbb9b9c8872f345b3895e510ce8e9accb6c4ccf6aa2cae6ed"
+ "cf710b63f2766563b8db39669708907d5b3873d58cef5226f02c1d3599a0128b"
+ "33e1986926c63488628d853f617ae956a8cb04de8f70a1d0a61897dc94f122a2")
+
+fix_script() {
+ script="$1"
+
+ sed -i '/^cd "`dirname "${0}"`"/d' "$script"
+ sed -i "/^cd ../d" "$script"
+ sed -i "s|\SCRIPT_DIR=.*|SCRIPT_DIR=/usr/share/opendj/bin|" "$script"
+ sed -i "s|\${SCRIPT_DIR}/../lib/|/usr/share/opendj/lib/|" "$script"
+ sed -i "s|^INSTALL_ROOT=.*|INSTALL_ROOT=/usr/share/opendj|" "$script"
+ sed -i "s|\${INSTANCE_ROOT}/lib/|/usr/share/java/opendj/|" "$script"
+ sed -i "s|\${INSTALL_ROOT}/lib/\(.*\).jar|/usr/share/java/opendj/\\1.jar|" "$script"
+
+ # Hack... Some OpenDJ tools determine install dir based on Java classpath
+ # So we just add this fake entry to make it work
+ sed -i "s|CLASSPATH=\"\${INSTANCE_ROOT}/classes\"|CLASSPATH=\"\${INSTANCE_ROOT}/classes:/usr/share/opendj/lib/bootstrap-client.jar\"|" "$script"
+}
+
+package() {
+ cd "$srcdir/opendj"
+
+ bindir="$pkgdir/usr/bin/"
+ sharedir="/usr/share/opendj/"
+ dest="$pkgdir$sharedir"
+ jardir="/usr/share/java/opendj/"
+ jardest="$pkgdir$jardir"
+
+ mkdir -p "$bindir" "$dest" "$jardest"
+ cp lib/*.jar -t "$jardest"
+ cp -r lib/extensions "$jardest"
+ cp -r * "$dest"
+ rm -rf "$dest/"{bat,bin,lib,*.bat,QuickSetup.app,Uninstall.app,uninstall*,upgrade*}
+
+ mkdir -p "$dest/bin" "$dest/lib"
+ cp lib/*.sh "$dest/lib/"
+
+ fix_script "$dest/setup"
+ sed -i "/export SCRIPT_NAME/a SCRIPT_ARGS=\"-Dorg.opends.quicksetup.Root=/usr/share/opendj/ \${SCRIPT_ARGS}\"" "$dest/setup"
+ for script in "$dest/lib/"*.sh; do
+ fix_script "$script"
+ done
+
+ for script in bin/*; do
+ if [ -f "$script" ] && [ "$script" != "bin/create-rc-script" ]; then
+ name=$(basename "$script")
+ cp "$script" "$dest/$script"
+ fix_script "$dest/$script"
+ ln -s "${sharedir}bin/$name" "${bindir}opendj-$name"
+ fi
+ done
+
+ echo "/var/lib/opendj" > "${dest}/instance.loc"
+
+ install -Dm 755 "../opendj-check-config" -t "${bindir}"
+ install -Dm 644 "../opendj.service" -t "${pkgdir}/usr/lib/systemd/system"
+ install -Dm 644 "../opendj.sysusers" "${pkgdir}/usr/lib/sysusers.d/opendj.conf"
+ install -Dm 644 "../opendj.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/opendj.conf"
+
+ chmod -R u+rwX,go+rX "$dest"
+
+}
+
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..56bef715d468
--- /dev/null
+++ b/README.md
@@ -0,0 +1,9 @@
+# OpenDJ
+
+https://www.openidentityplatform.org/opendj
+
+Configure by running:
+```sh
+su opendj -s /bin/sh /usr/share/opendj/setup
+```
+
diff --git a/opendj-check-config b/opendj-check-config
new file mode 100755
index 000000000000..c0587fc93f5d
--- /dev/null
+++ b/opendj-check-config
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+read INSTANCE 2>/dev/null < /usr/share/opendj/instance.loc
+
+if [ -z "$INSTANCE" ]
+then
+ echo "Didn't found OpenDJ instance. Verify that you've installed OpenDJ correctly."
+ exit 1
+fi
+
+if [ ! -f "$INSTANCE/config/config.ldif" ]
+then
+ # No existing config! Warn user to configure OpenDJ
+ echo $"OpenDJ instance at \"$INSTANCE\" is not configured. Use a command like"
+ echo $" su opendj -s /bin/sh /usr/share/opendj/setup"
+ echo $"to configure it."
+ exit 1
+fi
+
+exit 0
+
diff --git a/opendj.service b/opendj.service
new file mode 100644
index 000000000000..ddd73bd7272d
--- /dev/null
+++ b/opendj.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=OpenDJ server
+
+[Service]
+Type=simple
+User=opendj
+Group=opendj
+SyslogIdentifier=opendj
+ExecStartPre=/usr/bin/opendj-check-config
+ExecStart=/usr/bin/opendj-start-ds --nodetach
+ExecStop=/usr/bin/opendj-stop-ds
+Restart=on-abnormal
+
+[Install]
+WantedBy=multi-user.target
diff --git a/opendj.sysusers b/opendj.sysusers
new file mode 100644
index 000000000000..5a291e67a03e
--- /dev/null
+++ b/opendj.sysusers
@@ -0,0 +1 @@
+u opendj - "OpenDJ" /var/lib/opendj /usr/bin/nologin
diff --git a/opendj.tmpfiles b/opendj.tmpfiles
new file mode 100644
index 000000000000..a8dc597f14ea
--- /dev/null
+++ b/opendj.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/opendj 755 opendj opendj
+h /var/lib/opendj/db - - - - +C