~dricottone/huttese-apk

f8d3e69db8233c87539d0268f28822e0a8ff2b7e — Drew DeVault 5 years ago ec4d219
lists.sr.ht: normalize init scripts
12 files changed, 142 insertions(+), 143 deletions(-)

M sr.ht/lists.sr.ht/APKBUILD
A sr.ht/lists.sr.ht/lists.sr.ht-lmtp.confd
D sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init
A sr.ht/lists.sr.ht/lists.sr.ht-lmtp.initd
A sr.ht/lists.sr.ht/lists.sr.ht-process.confd
D sr.ht/lists.sr.ht/lists.sr.ht-process.init
A sr.ht/lists.sr.ht/lists.sr.ht-process.initd
A sr.ht/lists.sr.ht/lists.sr.ht-webhooks.confd
D sr.ht/lists.sr.ht/lists.sr.ht-webhooks.init
A sr.ht/lists.sr.ht/lists.sr.ht-webhooks.initd
A sr.ht/lists.sr.ht/lists.sr.ht.confd
R sr.ht/lists.sr.ht/{lists.sr.ht.init => lists.sr.ht.initd}
M sr.ht/lists.sr.ht/APKBUILD => sr.ht/lists.sr.ht/APKBUILD +32 -14
@@ 1,7 1,7 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=lists.sr.ht
pkgver=0.14.1
pkgrel=1
pkgver=0.27.1
pkgrel=0
pkgdesc="sr.ht mailing list service"
url="https://git.sr.ht/~sircmpwn/lists.sr.ht"
arch="noarch"


@@ 19,10 19,14 @@ makedepends="py-setuptools nodejs sassc"
subpackages="${pkgname}-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz
	lists.sr.ht.init
	lists.sr.ht-process.init
	lists.sr.ht-lmtp.init
	lists.sr.ht-webhooks.init
	lists.sr.ht.initd
	lists.sr.ht.confd
	lists.sr.ht-process.initd
	lists.sr.ht-process.confd
	lists.sr.ht-lmtp.initd
	lists.sr.ht-lmtp.confd
	lists.sr.ht-webhooks.initd
	lists.sr.ht-webhooks.confd
"
builddir="$srcdir/$pkgname-$pkgver"
export PKGVER=$pkgver


@@ 38,16 42,30 @@ package() {
	cd "$builddir"
	python3 setup.py install --root="$pkgdir" --optimize=1
	mkdir -p "$pkgdir"/etc/init.d
	install -Dm755 "$srcdir"/lists.sr.ht.init "$pkgdir"/etc/init.d/lists.sr.ht
	install -Dm755 "$srcdir"/lists.sr.ht-lmtp.init \
	install -Dm755 "$srcdir"/lists.sr.ht.initd \
		"$pkgdir"/etc/init.d/lists.sr.ht
	install -Dm644 "$srcdir"/lists.sr.ht.confd \
		"$pkgdir"/etc/conf.d/lists.sr.ht
	install -Dm755 "$srcdir"/lists.sr.ht-lmtp.initd \
		"$pkgdir"/etc/init.d/lists.sr.ht-lmtp
	install -Dm755 "$srcdir"/lists.sr.ht-process.init \
	install -Dm644 "$srcdir"/lists.sr.ht-lmtp.confd \
		"$pkgdir"/etc/conf.d/lists.sr.ht-lmtp
	install -Dm755 "$srcdir"/lists.sr.ht-process.initd \
		"$pkgdir"/etc/init.d/lists.sr.ht-process
	install -Dm755 "$srcdir"/lists.sr.ht-webhooks.init \
	install -Dm644 "$srcdir"/lists.sr.ht-process.confd \
		"$pkgdir"/etc/conf.d/lists.sr.ht-process
	install -Dm755 "$srcdir"/lists.sr.ht-webhooks.initd \
		"$pkgdir"/etc/init.d/lists.sr.ht-webhooks
	install -Dm644 "$srcdir"/lists.sr.ht-webhooks.confd \
		"$pkgdir"/etc/conf.d/lists.sr.ht-webhooks
}

sha512sums="80132b5b6af35902ac40be9202916a94257e62b348d5a60bf79fc6faeda319d7ed1639e486ab21c5906818c0b7176dc5658f995114343bf647ef46e803350116  lists.sr.ht-0.14.1.tar.gz
12d18641115a9f78e25f19a45686192d4f1123a58bfd8f5cd0a0e6e5b360af422309e405eedb46805a0f57913d7f2b0b99550895fa0e44654ed467a934a10fc6  lists.sr.ht.init
f5e5d188c3a6ced902d7965af4a5f4d1e2ebcdef9d57a2ac73b179e0a7ca60ab96f19ce3e8b63657f32fb7e8d0eb43588e716349d9d8965cdacbfc37c59d9593  lists.sr.ht-process.init
a1b95550a715eecc2a4ce5d4675748ec7f2c514646710b6326882513b81cc19ac02e463f7e8b48f3e45d5115ea8c6b81ad3d92547e5a13b2a9e521c9502dbb65  lists.sr.ht-lmtp.init"
sha512sums="b8ef18f78a7a8f43ddd868cd8c7c3dbbd0a5240dbee5f4ee553f9057ca0c9d070d6196abe4e6800bbf729e07b1a2f2c2728d91f3c05d81d4bb625135f4365895  lists.sr.ht-0.27.1.tar.gz
1343c585cc4a8e28067cd1191a1f64842a3cdbd6b79aa55e34468476555d0d28210912873044c033d426ad687b0362b05c8022618ff2eb140fa2555e5145eacf  lists.sr.ht.initd
3bff800b34e12ba05cbfa223855afeacacfb846221286d7f5c270ffef40a7afa6224c9cbe22d2e117b9350ed58c3ea3670b6c1e7265670ef89811fa6256241b3  lists.sr.ht.confd
0bd58c20843318e5bd3ab294ec3a5cdbf82c8b400f6c60b26ed188c2ae53100ebc3d461718877e4e44792261641c52e97e42f93b65ac48992df0bd2160d70d65  lists.sr.ht-process.initd
5521e95b2e69758957f575a1ec0d82a859f0c08a48dc4b3b60c3d7a1da24cba858f91d53a39bc8b5e57549124fae6caac581cec565ca2bf0c508d49be3c47186  lists.sr.ht-process.confd
cb5c0014d086c625f961ccbf7ee985f12364297b6f9579e81fea7ebe8d6bd5db80552e5e34a3307e0254a082bf906a72d1ade16722d9a26f034a04b170da75ea  lists.sr.ht-lmtp.initd
619d0940935f41d1079a9a725f45ee1e355ceb0d2fb98b7ddbb7320af60d49600b1b40ffa10a541c5f51df055e56aef2813522b6aeeeb35b318f10814ae1820b  lists.sr.ht-lmtp.confd
ced3ed3295b149dbeccd119322ff0bd450dee44ad47b1b74c8f0899365bdff2ae59195c00b0c793fb38da0d534f1e53fe8b465f510dbf3f9238015289a07a347  lists.sr.ht-webhooks.initd
5521e95b2e69758957f575a1ec0d82a859f0c08a48dc4b3b60c3d7a1da24cba858f91d53a39bc8b5e57549124fae6caac581cec565ca2bf0c508d49be3c47186  lists.sr.ht-webhooks.confd"

A sr.ht/lists.sr.ht/lists.sr.ht-lmtp.confd => sr.ht/lists.sr.ht/lists.sr.ht-lmtp.confd +5 -0
@@ 0,0 1,5 @@
# Run the daemon as this user:
# LISTS_USER=listssrht

# If no, use an external postgresql server
# LOCAL_PG=yes

D sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init => sr.ht/lists.sr.ht/lists.sr.ht-lmtp.init +0 -35
@@ 1,35 0,0 @@
#!/sbin/openrc-run
name="lists.sr.ht-lmtp"
description="lists.sr.ht mail ingress service"

# Override these with /etc/conf.d/lists.sr.ht-process
LISTS_USER=${LISTS_USER:-listssrht}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/lists.sr.ht-lmtp.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
}

start() {
	ebegin "Starting $name"
	touch "$LOGS"
	chown ${LISTS_USER} "$LOGS"
	start-stop-daemon \
		-u ${LISTS_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/listssrht-lmtp
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/listssrht-lmtp --pidfile /run/$name.pid
	eend $?
}

A sr.ht/lists.sr.ht/lists.sr.ht-lmtp.initd => sr.ht/lists.sr.ht/lists.sr.ht-lmtp.initd +21 -0
@@ 0,0 1,21 @@
#!/sbin/openrc-run
name="lists.sr.ht-lmtp"
description="lists.sr.ht mail ingress service"
supervisor=supervise-daemon
LISTS_USER=${LISTS_USER:-listssrht}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/lists.sr.ht-lmtp.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/lists.sr.ht-lmtp"
command_user="$LISTS_USER:$LISTS_USER"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
}

start_pre() {
	checkpath -f "$LOGS" -m 644 -o "$LISTS_USER:$LISTS_USER"
}

A sr.ht/lists.sr.ht/lists.sr.ht-process.confd => sr.ht/lists.sr.ht/lists.sr.ht-process.confd +8 -0
@@ 0,0 1,8 @@
# Run the daemon as this user:
# LISTS_USER=listssrht

# Extra arguments to pass to celery
# LISTS_ARGS=

# If no, use an external postgresql server
# LOCAL_PG=yes

D sr.ht/lists.sr.ht/lists.sr.ht-process.init => sr.ht/lists.sr.ht/lists.sr.ht-process.init +0 -36
@@ 1,36 0,0 @@
#!/sbin/openrc-run
name="lists.sr.ht-process"
description="lists.sr.ht mail processing service"

# Override these with /etc/conf.d/lists.sr.ht-process
LISTS_USER=${LISTS_USER:-listssrht}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/lists.sr.ht-process.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
}

start() {
	ebegin "Starting $name"
	touch "$LOGS"
	chown ${LISTS_USER} "$LOGS"
	start-stop-daemon \
		-u ${LISTS_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/celery -- \
			-A listssrht.process worker --loglevel=info
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/celery --pidfile /run/$name.pid
	eend $?
}

A sr.ht/lists.sr.ht/lists.sr.ht-process.initd => sr.ht/lists.sr.ht/lists.sr.ht-process.initd +23 -0
@@ 0,0 1,23 @@
#!/sbin/openrc-run
name="lists.sr.ht-process"
description="lists.sr.ht mail processing service"
supervisor=supervise-daemon
LISTS_USER=${LISTS_USER:-listssrht}
LISTS_ARGS=${LISTS_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/lists.sr.ht-process.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/celery"
command_args="-A listssrht.process worker --loglevel=info $LISTS_ARGS"
command_user="$LISTS_USER:$LISTS_USER"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
}

start_pre() {
	checkpath -f "$LOGS" -m 644 -o "$LISTS_USER:$LISTS_USER"
}

A sr.ht/lists.sr.ht/lists.sr.ht-webhooks.confd => sr.ht/lists.sr.ht/lists.sr.ht-webhooks.confd +8 -0
@@ 0,0 1,8 @@
# Run the daemon as this user:
# LISTS_USER=listssrht

# Extra arguments to pass to celery
# LISTS_ARGS=

# If no, use an external postgresql server
# LOCAL_PG=yes

D sr.ht/lists.sr.ht/lists.sr.ht-webhooks.init => sr.ht/lists.sr.ht/lists.sr.ht-webhooks.init +0 -36
@@ 1,36 0,0 @@
#!/sbin/openrc-run
name="lists.sr.ht-webhooks"
description="lists.sr.ht webhook delivery service"

# Override these with /etc/conf.d/lists.sr.ht-webhooks
LISTS_USER=${LISTS_USER:-listssrht}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/lists.sr.ht-webhooks.log

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
}

start() {
	ebegin "Starting $name"
	touch "$LOGS"
	chown ${LISTS_USER} "$LOGS"
	start-stop-daemon \
		-u ${LISTS_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/celery -- \
			-A listssrht.webhooks worker --loglevel=info
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/celery --pidfile /run/$name.pid
	eend $?
}

A sr.ht/lists.sr.ht/lists.sr.ht-webhooks.initd => sr.ht/lists.sr.ht/lists.sr.ht-webhooks.initd +23 -0
@@ 0,0 1,23 @@
#!/sbin/openrc-run
name="lists.sr.ht-webhooks"
description="lists.sr.ht webhook delivery service"
supervisor=supervise-daemon
LISTS_USER=${LISTS_USER:-listssrht}
LISTS_ARGS=${LISTS_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/lists.sr.ht-webhooks.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/celery"
command_args="-A listssrht.webhooks worker --loglevel=info $LISTS_ARGS"
command_user="$LISTS_USER:$LISTS_USER"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net
	need redis
	[ "$LOCAL_PG" == "yes" ] && need postgresql
}

start_pre() {
	checkpath -f "$LOGS" -m 644 -o "$LISTS_USER:$LISTS_USER"
}

A sr.ht/lists.sr.ht/lists.sr.ht.confd => sr.ht/lists.sr.ht/lists.sr.ht.confd +14 -0
@@ 0,0 1,14 @@
# Run the daemon as this user:
# LISTS_USER=listssrht

# Bind the web service to this address:
# LISTS_BIND=127.0.0.1:5001

# Extra arguments to pass to Gunicorn
# LISTS_ARGS=

# If no, use an external postgresql server
# LOCAL_PG=yes

# If no, use an external redis server
# LOCAL_REDIS=yes

R sr.ht/lists.sr.ht/lists.sr.ht.init => sr.ht/lists.sr.ht/lists.sr.ht.initd +8 -22
@@ 1,14 1,18 @@
#!/sbin/openrc-run
name="lists.sr.ht"
description="lists.sr.ht service"

# Override these with /etc/conf.d/lists.sr.ht
supervisor=supervise-daemon
LISTS_USER=${LISTS_USER:-listssrht}
LISTS_BIND=${LISTS_BIND:-127.0.0.1:5001}
LISTS_ARGS=${LISTS_ARGS:-}
LOCAL_PG=${LOCAL_PG:-yes}
LOCAL_REDIS=${LOCAL_REDIS:-yes}
LOGS=/var/log/lists.sr.ht.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/gunicorn"
command_args="listssrht.app:app -b $LISTS_BIND $LISTS_ARGS"
command_user="$LISTS_USER:$LISTS_USER"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net


@@ 16,24 20,6 @@ depend() {
	[ "$LOCAL_PG" = "yes" ] && need postgresql
}

start() {
	ebegin "Starting $name"
	touch "$LOGS"
	chown ${LISTS_USER} "$LOGS"
	start-stop-daemon \
		-u ${LISTS_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/gunicorn -- \
			listssrht.app:app -b ${LISTS_BIND} ${LISTS_ARGS}
	eend $?
}

stop() {
	ebegin "Stopping $name"
	start-stop-daemon --stop --exec /usr/bin/gunicorn --pidfile /run/$name.pid
	eend $?
start_pre() {
	checkpath -f "$LOGS" -m 644 -o "$LISTS_USER:$LISTS_USER"
}