summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDct Mei2020-07-29 06:10:21 +0800
committerDct Mei2020-07-29 06:13:38 +0800
commit5851bc4fa3e709dd6b77f4810ecf912351b329af (patch)
treeefda1b62339ee82f37bcb218f8b827c955fd9cd8
parentc5d5e0f46bfa448d676fedbc890ceced46500958 (diff)
downloadaur-5851bc4fa3e709dd6b77f4810ecf912351b329af.tar.gz
fix: v1.6.0-2
1. Standard content format. 2. Modify the content of the service unit and run it as the hath user. 3. Add hath.sysusers to deploy hath users and user groups. 4. Add hath.tmpfiles to deploy the folder structure required at runtime.
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD34
-rw-r--r--hath.install19
-rw-r--r--hath.service8
-rw-r--r--[-rwxr-xr-x]hath.sh10
-rw-r--r--hath.sysusers1
-rw-r--r--hath.tmpfiles6
7 files changed, 54 insertions, 36 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c72e0e3fa619..63fd332ea9cc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = hath
pkgdesc = Open-source Peer-2-Peer gallery distribution system
pkgver = 1.6.0
- pkgrel = 1
+ pkgrel = 2
url = https://ehwiki.org/wiki/Hentai@Home
install = hath.install
arch = any
@@ -9,11 +9,15 @@ pkgbase = hath
makedepends = java-environment
depends = java-runtime
source = https://repo.e-hentai.org/hath/HentaiAtHome_1.6.0_src.zip
- source = hath.sh
source = hath.service
+ source = hath.sh
+ source = hath.sysusers
+ source = hath.tmpfiles
sha256sums = 3c807dadb3303a407101c428c65a68f55b3463fc3da29133ffe43b73591eaab8
- sha256sums = 737d8b70150f9e897c3f7413669562f1f92e0df6539403f1936d6463e832c841
- sha256sums = 8afd6ff66bfa986c7787e39aaad5d35a5ce1e2b722edb95bc86f76965d8d9fd0
+ sha256sums = 4b7124af5e27d25a9b3033b2a14e48ea8745417c3fd400a6ec6ddf1817b74b61
+ sha256sums = 80064d7e31085b56ad5b41863f51b25c33a20328a7f49cd88f80dfed281c439a
+ sha256sums = 0c3a1a6c26cec616bc44274acbf5908e736581ae30cdf0af7508d4bfcad3a81e
+ sha256sums = 9d11932a3ff1011cbe5ad2f000d29e3ad6011235fcc94685dcbc9bd61a54f87c
pkgname = hath
diff --git a/PKGBUILD b/PKGBUILD
index 75a0ef8b67bc..10daf8db67da 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,20 +3,24 @@
pkgname=hath
pkgver=1.6.0
-pkgrel=1
+pkgrel=2
pkgdesc="Open-source Peer-2-Peer gallery distribution system"
-arch=(any)
+arch=('any')
url="https://ehwiki.org/wiki/Hentai@Home"
license=('GPL3')
-depends=(java-runtime)
-makedepends=(java-environment)
+depends=('java-runtime')
+makedepends=('java-environment')
+install="$pkgname.install"
source=("https://repo.e-hentai.org/hath/HentaiAtHome_1.6.0_src.zip"
+ "hath.service"
"hath.sh"
- "hath.service")
-install="${pkgname}.install"
+ "hath.sysusers"
+ "hath.tmpfiles")
sha256sums=('3c807dadb3303a407101c428c65a68f55b3463fc3da29133ffe43b73591eaab8'
- '737d8b70150f9e897c3f7413669562f1f92e0df6539403f1936d6463e832c841'
- '8afd6ff66bfa986c7787e39aaad5d35a5ce1e2b722edb95bc86f76965d8d9fd0')
+ '4b7124af5e27d25a9b3033b2a14e48ea8745417c3fd400a6ec6ddf1817b74b61'
+ '80064d7e31085b56ad5b41863f51b25c33a20328a7f49cd88f80dfed281c439a'
+ '0c3a1a6c26cec616bc44274acbf5908e736581ae30cdf0af7508d4bfcad3a81e'
+ '9d11932a3ff1011cbe5ad2f000d29e3ad6011235fcc94685dcbc9bd61a54f87c')
build() {
make
@@ -24,12 +28,10 @@ build() {
}
package() {
- mkdir -p -- "$pkgdir/var/lib/hath/cache"
- mkdir -p -- "$pkgdir/var/lib/hath/data"
- mkdir -p -- "$pkgdir/var/lib/hath/log"
- mkdir -p -- "$pkgdir/var/lib/hath/tmp"
- install -Dm755 -- "build/HentaiAtHome.jar" "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"
- install -Dm755 -- "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
- install -Dm644 -- "hath.service" "${pkgdir}/usr/lib/systemd/system/hath.service"
- install -Dm644 -- LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm 644 'build/HentaiAtHome.jar' "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"
+ install -Dm 644 'hath.service' "$pkgdir/usr/lib/systemd/system/hath.service"
+ install -Dm 755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
+ install -Dm 644 'hath.sysusers' "$pkgdir/usr/lib/sysusers.d/hath.conf"
+ install -Dm 644 'hath.tmpfiles' "$pkgdir/usr/lib/tmpfiles.d/hath.conf"
+ install -Dm 644 'LICENSE' "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
diff --git a/hath.install b/hath.install
index 0445232b9194..1bca0b3d405f 100644
--- a/hath.install
+++ b/hath.install
@@ -1,15 +1,14 @@
post_install() {
- cat >&2 << 'EOF'
+cat << EOF
- ## ##
- ## To use this package, you must have a ID & token. ##
- ## Register at https://e-hentai.org/hentaiathome.php ##
- ## when used as a downloader, your files will be in ##
- ## /var/lib/hath/download/ ##
- ## ##
- ## Do not manually delete the cache; this adversely ##
- ## impacts the H@H network. For more information: ##
- ## https://ehwiki.org/wiki/Hentai@Home ##
+## To use this package, you must have a ID & token. ##
+## Register at https://e-hentai.org/hentaiathome.php ##
+## when used as a downloader, your files will be in ##
+## /var/lib/hath/download/ ##
+## ##
+## Do not manually delete the cache; this adversely ##
+## impacts the H@H network. For more information: ##
+## https://ehwiki.org/wiki/Hentai@Home ##
EOF
}
diff --git a/hath.service b/hath.service
index 885af132938c..4ea252b0c090 100644
--- a/hath.service
+++ b/hath.service
@@ -1,16 +1,16 @@
[Unit]
Description=Hentai@Home Service
After=network-online.target
+Wants=network-online.target
[Service]
-#User=nobody
+User=hath
WorkingDirectory=/var/lib/hath/
ExecStart=/usr/bin/java -Xms16m -Xmx512m -jar /usr/share/java/hath/hath.jar
SuccessExitStatus=143
TimeoutStopSec=10
-Restart=on-failure
+Restart=always
RestartSec=5
-
[Install]
-WantedBy=multi-user.target \ No newline at end of file
+WantedBy=multi-user.target
diff --git a/hath.sh b/hath.sh
index 81fff8a44c9e..dcfb27394c0c 100755..100644
--- a/hath.sh
+++ b/hath.sh
@@ -1,2 +1,8 @@
-#!/bin/sh
-exec /usr/bin/java -jar /usr/share/java/hath/hath.jar --data-dir=/var/lib/hath/data --cache-dir=/var/lib/hath/cache --temp-dir=/var/lib/hath/temp --log-dir=/var/lib/hath/log "$@" \ No newline at end of file
+#!/bin/bash
+
+exec /usr/bin/java -jar /usr/share/java/hath/hath.jar \
+ --cache-dir=/var/lib/hath/cache \
+ --data-dir=/var/lib/hath/data \
+ --log-dir=/var/lib/hath/log \
+ --temp-dir=/var/lib/hath/temp \
+ "$@"
diff --git a/hath.sysusers b/hath.sysusers
new file mode 100644
index 000000000000..7334e39ddf49
--- /dev/null
+++ b/hath.sysusers
@@ -0,0 +1 @@
+u hath - "Hentai@Home" /var/lib/hath -
diff --git a/hath.tmpfiles b/hath.tmpfiles
new file mode 100644
index 000000000000..b7677e9065fd
--- /dev/null
+++ b/hath.tmpfiles
@@ -0,0 +1,6 @@
+d /var/lib/hath 0755 hath hath - -
+d /var/lib/hath/cache 0755 hath hath - -
+d /var/lib/hath/data 0755 hath hath - -
+d /var/lib/hath/download 0755 hath hath - -
+d /var/lib/hath/log 0700 hath hath - -
+d /var/lib/hath/tmp 0755 hath hath - -