M sr.ht/paste.sr.ht/APKBUILD => sr.ht/paste.sr.ht/APKBUILD +16 -3
@@ 11,13 11,15 @@ depends="
py3-srht
py3-yaml
"
-makedepends="py-setuptools nodejs sassc"
+makedepends="py-setuptools nodejs sassc go"
subpackages="$pkgname-openrc $pkgname-nginx:_nginx"
source="
$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz
sr.ht-nginx-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/sr.ht-nginx/archive/master.tar.gz
paste.sr.ht.initd
paste.sr.ht.confd
+ paste.sr.ht-api.initd
+ paste.sr.ht-api.confd
"
export PKGVER=$pkgver
options="$options !check"
@@ 25,6 27,8 @@ install="$pkgname.post-install $pkgname.post-upgrade"
build() {
python3 setup.py build
+ cd api
+ go build -o pastesrht-api
}
package() {
@@ 33,6 37,11 @@ package() {
"$pkgdir"/etc/init.d/paste.sr.ht
install -Dm644 "$srcdir"/paste.sr.ht.confd \
"$pkgdir"/etc/conf.d/paste.sr.ht
+ install -Dm755 "$srcdir"/paste.sr.ht-api.initd \
+ "$pkgdir"/etc/init.d/paste.sr.ht-api
+ install -Dm644 "$srcdir"/paste.sr.ht-api.confd \
+ "$pkgdir"/etc/conf.d/paste.sr.ht-api
+ install -Dm755 api/pastesrht-api "$pkgdir"/usr/bin/pastesrht-api
}
_nginx() {
@@ 42,7 51,11 @@ _nginx() {
"$subpkgdir"/etc/nginx/http.d/paste.sr.ht.conf
}
-sha512sums="7f138f10c863c17db26f9b625885351dbdc41e00da1d6f070fb8785aee23e4b63a0e2c9acc0054f86b583a05aad196f98c80845ae536debaf1cf6c4e2b2d15b4 paste.sr.ht-0.12.1.tar.gz
+sha512sums="
+7f138f10c863c17db26f9b625885351dbdc41e00da1d6f070fb8785aee23e4b63a0e2c9acc0054f86b583a05aad196f98c80845ae536debaf1cf6c4e2b2d15b4 paste.sr.ht-0.12.1.tar.gz
0b2b6b2916799e20d05d6e35fdb20ac0cded65e254beb79a3aa91d4faa20fe6c93bd3e178acb2d2966841a7ce4f0149b0a863db1d57a36407ff85833779d3959 sr.ht-nginx-0.12.1.tar.gz
ecbbfe19bbb60bb7724210bb38601dcf64cbd24056fb59d22ac4539082b6e30ac4d80b59d1e3ba58ac232df291304746b6deb49836c0a329233c3531baa33bda paste.sr.ht.initd
-8b4f89e5d8fd96b6e898f81c7d5f516715285a4cb871a6bb31bcea059eb40aff5019039a973815aacd22eb9957bb02b2835a8e9c9aac3ab83649145c6636a388 paste.sr.ht.confd"
+8b4f89e5d8fd96b6e898f81c7d5f516715285a4cb871a6bb31bcea059eb40aff5019039a973815aacd22eb9957bb02b2835a8e9c9aac3ab83649145c6636a388 paste.sr.ht.confd
+263f268ba32fef424d8b44af76fa9c94a309c75d2d8c40f46b6556c713c590744edb6e78810b3d9c7a1d037d314c12e034d5e2cee4b46c92851a5e65dfb4f3a3 paste.sr.ht-api.initd
+e226a1a3913749c5a72e57c2e6f75f94199f47c72d47ccbac5abba3bc30b827d8619c2f1a60ef2b67f28074007a051981f47d4d2c749da4c5e5e9d1823f54dbf paste.sr.ht-api.confd
+"
A sr.ht/paste.sr.ht/paste.sr.ht-api.confd => sr.ht/paste.sr.ht/paste.sr.ht-api.confd +8 -0
@@ 0,0 1,8 @@
+# Run the daemon as this user:
+# PASTE_USER=paste
+
+# Bind the API service to this address:
+# PASTE_BIND=:5111
+
+# Extra arguments to pass to Gunicorn
+# PASTE_ARGS=
A sr.ht/paste.sr.ht/paste.sr.ht-api.initd => sr.ht/paste.sr.ht/paste.sr.ht-api.initd +23 -0
@@ 0,0 1,23 @@
+#!/sbin/openrc-run
+name="paste.sr.ht-api"
+description="paste.sr.ht API service"
+supervisor=supervise-daemon
+PASTE_USER=${PASTE_USER:-paste}
+PASTE_BIND=${PASTE_BIND:-:5111}
+PASTE_ARGS=${PASTE_ARGS:-}
+LOGS=/var/log/paste.sr.ht-api.log
+supervise_daemon_args="-1 $LOGS -2 $LOGS"
+command="/usr/bin/pastesrht-api"
+command_args="-b $PASTE_BIND"
+command_user="$PASTE_USER:$PASTE_USER"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need net
+ use redis
+ use postgresql
+}
+
+start_pre() {
+ checkpath -f "$LOGS" -m 644 -o "$PASTE_USER:$PASTE_USER"
+}