summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSky Swimmer2021-07-06 15:12:22 +0200
committerSky Swimmer2021-07-06 15:12:22 +0200
commit9fe79778a70d7b4a4b4556e1592d8f98f952f638 (patch)
treeb21460698d87159e84b4b9aa1069ba515d376768
downloadaur-9fe79778a70d7b4a4b4556e1592d8f98f952f638.tar.gz
Initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD37
-rw-r--r--main.install55
3 files changed, 108 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ffea70618d5c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = connective-index-pages
+ pkgdesc = Custom Index Pages module for Connective servers
+ pkgver = 1.0.0
+ pkgrel = 1
+ install = main.install
+ arch = any
+ groups = connective-server
+ license = LGPL3
+ makedepends = gradle>=6.7
+ makedepends = cq
+ depends = java-environment
+ depends = connective-http
+ source = git+https://aerialworks.ddns.net/ASF/CustomIndexPages.git
+ md5sums = SKIP
+
+pkgname = connective-index-pages
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..bfa3cee8a694
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Stefan Eekhof <stefaneekhof@gmail.com>
+pkgname=connective-index-pages
+pkgver=1.0.0
+
+pkgrel=1
+pkgdesc="Custom Index Pages module for Connective servers"
+arch=( 'any' )
+url=""
+license=('LGPL3')
+groups=( "connective-server" )
+depends=( 'java-environment' 'connective-http' )
+makedepends=( 'gradle>=6.7' 'cq' )
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=main.install
+changelog=
+source=("git+https://aerialworks.ddns.net/ASF/CustomIndexPages.git")
+noextract=()
+md5sums=('SKIP')
+
+build() {
+ cd CustomIndexPages
+ chmod +x gradlew createlocalserver.sh
+ ./createlocalserver.sh
+ gradle build
+}
+
+package() {
+ cd CustomIndexPages
+
+ mkdir -p "$pkgdir/usr/lib/customindexpages"
+ mv build/libs/CustomIndexPages-*.jar "$pkgdir/usr/lib/customindexpages/CustomIndexPages.jar"
+}
diff --git a/main.install b/main.install
new file mode 100644
index 000000000000..b8b66108cfe6
--- /dev/null
+++ b/main.install
@@ -0,0 +1,55 @@
+post_install() {
+ serverDir=/etc/connective-http
+ classPathFolders=( "libs/" )
+ mainType=org.asf.connective.standalone.main.ConnectiveStandalone
+ credtoolLibs=()
+ credtoolTarget=""
+ jvmArguments="-Djava.net.preferIPv4Stack=true"
+
+ if [ -f "/etc/connective-http/config.props" ]; then
+ source "/etc/connective-http/config.props"
+ fi
+
+ mkdir "$serverDir/modules" -p
+ chown connective:connective "$serverDir/modules" -R
+ cp "/usr/lib/customindexpages/CustomIndexPages.jar" "$serverDir/modules/CustomIndexPages.jar" -f
+ chown connective "$serverDir/modules/CustomIndexPages.jar"
+
+ if [ -f "$serverDir"/server.ccfg ] && cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .context.root &>/dev/null; then
+ cipsupportcode='
+# Custom Index Pages Support Block (Auto-generated, avoid manual removal)
+defaultindexpage "class:org.asf.connective.customindexpages.CustomIndexPageProvider"'
+
+ rootcontextblock="$(cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .context.root --viewmode | sed "0,/^..*/s||&\n${cipsupportcode//$'\n'/\\n}|" ; echo .)"
+ rootcontextblock=${rootcontextblock:0:-2}
+
+ cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .context.root &>/dev/null && cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg . -s .context.root "$rootcontextblock" --ccfg-output --output "$serverDir"/server.ccfg
+ fi
+}
+
+post_remove() {
+ serverDir=/etc/connective-http
+ classPathFolders=( "libs/" )
+ mainType=org.asf.connective.standalone.main.ConnectiveStandalone
+ credtoolLibs=()
+ credtoolTarget=""
+ jvmArguments="-Djava.net.preferIPv4Stack=true"
+
+ if [ -f "/etc/connective-http/config.props" ]; then
+ source "/etc/connective-http/config.props"
+ fi
+
+ rm -f "$serverDir/modules/CustomIndexPages.jar"
+
+ if [ -f "$serverDir"/server.ccfg ] && cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .context.root &>/dev/null; then
+ cipsupportcode='
+# Custom Index Pages Support Block (Auto-generated, avoid manual removal)
+defaultindexpage "class:org.asf.connective.customindexpages.CustomIndexPageProvider"'
+
+ rootcontextblock="$(cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .context.root --viewmode ; echo .)"
+ rootcontextblock="${rootcontextblock//$cipsupportcode$'\n'/}"
+ rootcontextblock=${rootcontextblock:0:-1}
+
+ cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .context.root &>/dev/null && cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg . -s .context.root "$rootcontextblock" --ccfg-output --output "$serverDir"/server.ccfg
+ fi
+}