From 79c2dc9a5247fe7c5524e9d814fea1557b938e40 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 23 Apr 2019 15:06:56 -0400 Subject: [PATCH] meta.sr.ht: normalize init scripts --- sr.ht/meta.sr.ht/APKBUILD | 25 +++++++++----- sr.ht/meta.sr.ht/meta.sr.ht-webhooks.confd | 8 +++++ sr.ht/meta.sr.ht/meta.sr.ht-webhooks.init | 36 -------------------- sr.ht/meta.sr.ht/meta.sr.ht-webhooks.initd | 22 ++++++++++++ sr.ht/meta.sr.ht/meta.sr.ht.confd | 14 ++++++++ sr.ht/meta.sr.ht/meta.sr.ht.init | 39 ---------------------- sr.ht/meta.sr.ht/meta.sr.ht.initd | 24 +++++++++++++ sr.ht/py-alembic/APKBUILD | 2 +- sr.ht/py-misaka/APKBUILD | 2 +- sr.ht/py3-srht/APKBUILD | 4 +-- 10 files changed, 89 insertions(+), 87 deletions(-) create mode 100644 sr.ht/meta.sr.ht/meta.sr.ht-webhooks.confd delete mode 100755 sr.ht/meta.sr.ht/meta.sr.ht-webhooks.init create mode 100755 sr.ht/meta.sr.ht/meta.sr.ht-webhooks.initd create mode 100644 sr.ht/meta.sr.ht/meta.sr.ht.confd delete mode 100755 sr.ht/meta.sr.ht/meta.sr.ht.init create mode 100755 sr.ht/meta.sr.ht/meta.sr.ht.initd diff --git a/sr.ht/meta.sr.ht/APKBUILD b/sr.ht/meta.sr.ht/APKBUILD index 06df021..3a63fef 100644 --- a/sr.ht/meta.sr.ht/APKBUILD +++ b/sr.ht/meta.sr.ht/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Drew DeVault pkgname=meta.sr.ht -pkgver=0.9.8 +pkgver=0.31.2 pkgrel=0 pkgdesc="sr.ht account service" url="https://git.sr.ht/~sircmpwn/meta.sr.ht" @@ -23,8 +23,10 @@ makedepends="py-setuptools nodejs sassc" subpackages="${pkgname}-openrc" source=" $pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz - meta.sr.ht.init - meta.sr.ht-webhooks.init + meta.sr.ht.initd + meta.sr.ht.confd + meta.sr.ht-webhooks.initd + meta.sr.ht-webhooks.confd " builddir="$srcdir/$pkgname-$pkgver" export PKGVER=$pkgver @@ -39,11 +41,18 @@ build() { package() { cd "$builddir" python3 setup.py install --root="$pkgdir" --optimize=1 - install -Dm755 "$srcdir"/meta.sr.ht.init "$pkgdir"/etc/init.d/meta.sr.ht - install -Dm755 "$srcdir"/meta.sr.ht-webhooks.init \ + install -Dm755 "$srcdir"/meta.sr.ht.initd \ + "$pkgdir"/etc/init.d/meta.sr.ht + install -Dm644 "$srcdir"/meta.sr.ht.confd \ + "$pkgdir"/etc/conf.d/meta.sr.ht + install -Dm755 "$srcdir"/meta.sr.ht-webhooks.initd \ "$pkgdir"/etc/init.d/meta.sr.ht-webhooks + install -Dm644 "$srcdir"/meta.sr.ht-webhooks.confd \ + "$pkgdir"/etc/conf.d/meta.sr.ht-webhooks } -sha512sums="3f6559de738796ea522fff2ed1aa592bbae4ba56f59535fb66885deb832b5189fd023b108a63427e94128cd5dc71491c76d1e0104b51f20f758bd3fa89168c16 meta.sr.ht-0.9.8.tar.xz -c149ba165ce153a13f55ce4b46427e6a7f7dc97ce7bbd776e6d56255b90edb52cc02f80c83e59dd11a67efd1ef0fe9e2a2812ca171d215df15513a1ca60ba597 meta.sr.ht.init -2f002245a570ae7e51063f488e5199cb34de71762d1fdf0605463923a02b6d81d20c7bc5777f6c984b2f58906b0378fe53b456d76f56a06ec865db1e3923d8c8 meta.sr.ht-webhooks.init" +sha512sums="6e592c84715e2af400a80855b805f3017f56bd4c708a2fa7103b96d38a687a51bf4da24f176147aa450bb6b44ccb6dd8a70289871b2e299d82e2fcda75352119 meta.sr.ht-0.31.1.tar.gz +16674a3b4011c0900158af7ad8e241a26d83a2a4edb01c21256073b8373da977efc4f581992f9c4b1917423b3680c71e5e0364748ab9f375205393298ceccdbe meta.sr.ht.initd +6ee005b75d1a277a3795a0b91eb88c490f27f4053cad5d74051140e812ee5514c77a334f37cd70a3ef7be02feae4a0688e9c06401cd530d3d56b3441c3d57a54 meta.sr.ht.confd +10b4cc09f13c61352c5d0be895eb0012b2781e7a4e11d95dd2787ad31295ec3098f0355fc2b28acae010b080241064168a5ad0d837065e8d24ba4e174bbaa2b6 meta.sr.ht-webhooks.initd +b055504df3b8ede19aa50d36d97c255f6310dbc6e4fd62f6776beb8d62d0592b761819ecb3120754dbb8ad0b48c04b41bae95a2264de0d96de9e1bee70bc2693 meta.sr.ht-webhooks.confd" diff --git a/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.confd b/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.confd new file mode 100644 index 0000000..cc3c71c --- /dev/null +++ b/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.confd @@ -0,0 +1,8 @@ +# Run the daemon as this user: +# META_USER=meta + +# Extra arguments to pass to Gunicorn +# META_ARGS= + +# If no, use an external postgresql server +# LOCAL_PG=yes diff --git a/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.init b/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.init deleted file mode 100755 index 5c4f147..0000000 --- a/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.init +++ /dev/null @@ -1,36 +0,0 @@ -#!/sbin/openrc-run -name="meta.sr.ht-webhooks" -description="meta.sr.ht webhook delivery service" - -# Override these with /etc/conf.d/meta.sr.ht-webhooks -META_USER=${META_USER:-meta} -LOCAL_PG=${LOCAL_PG:-yes} -LOGS=/var/log/meta.sr.ht-webhooks.log - -depend() { - need net - need redis - [ "$LOCAL_PG" == "yes" ] && need postgresql -} - -start() { - ebegin "Starting $name" - touch "$LOGS" - chown ${META_USER} "$LOGS" - start-stop-daemon \ - -u ${META_USER} \ - -1 "$LOGS" \ - -2 "$LOGS" \ - --background \ - --make-pidfile \ - --pidfile /run/$name.pid \ - --exec /usr/bin/celery -- \ - -A metasrht.webhooks worker --loglevel=info - eend $? -} - -stop() { - ebegin "Stopping $name" - start-stop-daemon --stop --exec /usr/bin/celery --pidfile /run/$name.pid - eend $? -} diff --git a/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.initd b/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.initd new file mode 100755 index 0000000..9738341 --- /dev/null +++ b/sr.ht/meta.sr.ht/meta.sr.ht-webhooks.initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +name="meta.sr.ht-webhooks" +description="meta.sr.ht webhook delivery service" +META_USER=${META_USER:-meta} +LOCAL_PG=${LOCAL_PG:-yes} +META_ARGS=${META_ARGS:-} +LOGS=/var/log/meta.sr.ht-webhooks.log +supervise_daemon_args="-1 $LOGS -2 $LOGS" +command="/usr/bin/celery" +command_args="-A metasrht.webhooks worker --loglevel=info $META_ARGS" +command_user="$META_USER:$META_USER" +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + need net + need redis + [ "$LOCAL_PG" == "yes" ] && need postgresql +} + +start_pre() { + checkpath -f "$LOGS" -m 644 -o "$META_USER:$META_USER" +} diff --git a/sr.ht/meta.sr.ht/meta.sr.ht.confd b/sr.ht/meta.sr.ht/meta.sr.ht.confd new file mode 100644 index 0000000..a31b4ab --- /dev/null +++ b/sr.ht/meta.sr.ht/meta.sr.ht.confd @@ -0,0 +1,14 @@ +# Run the daemon as this user: +# META_USER=meta + +# Bind the web service to this address: +# META_BIND=127.0.0.1:5001 + +# Extra arguments to pass to Gunicorn +# META_ARGS= + +# If no, use an external postgresql server +# LOCAL_PG=yes + +# If no, use an external redis server +# LOCAL_REDIS=yes diff --git a/sr.ht/meta.sr.ht/meta.sr.ht.init b/sr.ht/meta.sr.ht/meta.sr.ht.init deleted file mode 100755 index f2456d9..0000000 --- a/sr.ht/meta.sr.ht/meta.sr.ht.init +++ /dev/null @@ -1,39 +0,0 @@ -#!/sbin/openrc-run -name="meta.sr.ht" -description="meta.sr.ht service" - -# Override these with /etc/conf.d/meta.sr.ht -META_USER=${META_USER:-meta} -META_BIND=${META_BIND:-127.0.0.1:5000} -META_ARGS=${META_ARGS:-} -LOCAL_PG=${LOCAL_PG:-yes} -LOCAL_REDIS=${LOCAL_REDIS:-yes} -LOGS=/var/log/meta.sr.ht.log - -depend() { - need net - [ "$LOCAL_REDIS" = "yes" ] && need redis - [ "$LOCAL_PG" = "yes" ] && need postgresql -} - -start() { - ebegin "Starting $name" - touch "$LOGS" - chown $META_USER "$LOGS" - start-stop-daemon \ - -u $META_USER \ - -1 "$LOGS" \ - -2 "$LOGS" \ - --background \ - --make-pidfile \ - --pidfile /run/$name.pid \ - --exec /usr/bin/gunicorn -- \ - metasrht.app:app_dispatch -b ${META_BIND} ${META_ARGS} - eend $? -} - -stop() { - ebegin "Stopping $name" - start-stop-daemon --stop --exec /usr/bin/gunicorn --pidfile /run/$name.pid - eend $? -} diff --git a/sr.ht/meta.sr.ht/meta.sr.ht.initd b/sr.ht/meta.sr.ht/meta.sr.ht.initd new file mode 100755 index 0000000..cf62267 --- /dev/null +++ b/sr.ht/meta.sr.ht/meta.sr.ht.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +name="meta.sr.ht" +description="meta.sr.ht service" +META_USER=${META_USER:-meta} +META_BIND=${META_BIND:-127.0.0.1:5000} +META_ARGS=${META_ARGS:-} +LOCAL_PG=${LOCAL_PG:-yes} +LOCAL_REDIS=${LOCAL_REDIS:-yes} +LOGS=/var/log/meta.sr.ht.log +supervise_daemon_args="-1 $LOGS -2 $LOGS" +command="/usr/bin/gunicorn" +command_args="metasrht.app:app_dispatch -b $META_BIND $META_ARGS" +command_user="$META_USER:$META_USER" +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + need net + [ "$LOCAL_REDIS" = "yes" ] && need redis + [ "$LOCAL_PG" = "yes" ] && need postgresql +} + +start_pre() { + checkpath -f "$LOGS" -m 644 -o "$META_USER:$META_USER" +} diff --git a/sr.ht/py-alembic/APKBUILD b/sr.ht/py-alembic/APKBUILD index 92cdfe3..561589c 100644 --- a/sr.ht/py-alembic/APKBUILD +++ b/sr.ht/py-alembic/APKBUILD @@ -3,7 +3,7 @@ pkgname=py-alembic _pkgname=alembic pkgver=0.9.6 -pkgrel=0 +pkgrel=1 pkgdesc="Lightweight database migration tool for usage with SQLAlchemy" url="https://bitbucket.org/zzzeek/alembic" arch="noarch" diff --git a/sr.ht/py-misaka/APKBUILD b/sr.ht/py-misaka/APKBUILD index 4d7da50..be06761 100644 --- a/sr.ht/py-misaka/APKBUILD +++ b/sr.ht/py-misaka/APKBUILD @@ -2,7 +2,7 @@ pkgname=py-misaka _pkgname=misaka pkgver=2.1.1 -pkgrel=0 +pkgrel=1 pkgdesc="A Python binding for Hoedown" url="http://misaka.61924.nl/" arch="all" diff --git a/sr.ht/py3-srht/APKBUILD b/sr.ht/py3-srht/APKBUILD index 9513c4e..5b0732f 100644 --- a/sr.ht/py3-srht/APKBUILD +++ b/sr.ht/py3-srht/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Drew DeVault pkgbase=core.sr.ht pkgname=py3-srht -pkgver=0.11.3 +pkgver=0.49.0 pkgrel=0 pkgdesc="sr.ht shared code" url="https://git.sr.ht/~sircmpwn/core.sr.ht" @@ -53,4 +53,4 @@ package() { python3 setup.py install --root="$pkgdir" --optimize=1 } -sha512sums="85372540e058544612b52775c41647ebf7158bb2eca2e14012038746719bc9313110d3f9599a5dccf5235d95bdfdc86a68877305f4dc6b120ec3a20b1148972d srht-0.11.3.tar.xz" +sha512sums="9862d7e8e1c17fb1ed990bf8ea23c0ff2d9b3e1cf9c355526c1cdd68e54a209e3463b6612ceb58dbfb29c1df04685de7a52e47ad645ade25bc91db873605bf46 core.sr.ht-0.49.0.tar.gz" -- 2.45.2