~dricottone/huttese-apk

f26e327f64d7eb57decdd2d57f07bf2d3da1baba — Drew DeVault 6 years ago 52d4617
Initial pass on todo.sr.ht package
A sr.ht/todo.sr.ht/APKBUILD => sr.ht/todo.sr.ht/APKBUILD +35 -0
@@ 0,0 1,35 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=todo.sr.ht
pkgver=0.26.3
pkgrel=0
pkgdesc="sr.ht ticket tracking service"
url="https://git.sr.ht/~sircmpwn/todo.sr.ht"
arch="noarch"
license="AGPLv3"
depends="
	py3-alembic
	py3-srht
"
makedepends="py-setuptools nodejs sassc"
source="
	http://git.sr.ht/~sircmpwn/$pkgname/snapshot/$pkgname-$pkgver.tar.xz
	todo.sr.ht.init
"
builddir="$srcdir/$pkgname-$pkgver"
export PKGVER=$pkgver
options="$options !check"
install="$pkgname.post-install $pkgname.post-upgrade"

build() {
	cd "$builddir"
	python3 setup.py build
}

package() {
	cd "$builddir"
	python3 setup.py install --root="$pkgdir" --optimize=1
	install -Dm755 "$srcdir"/todo.sr.ht.init "$pkgdir"/etc/init.d/todo.sr.ht
}

sha512sums="3f6559de738796ea522fff2ed1aa592bbae4ba56f59535fb66885deb832b5189fd023b108a63427e94128cd5dc71491c76d1e0104b51f20f758bd3fa89168c16  meta.sr.ht-0.9.8.tar.xz
c149ba165ce153a13f55ce4b46427e6a7f7dc97ce7bbd776e6d56255b90edb52cc02f80c83e59dd11a67efd1ef0fe9e2a2812ca171d215df15513a1ca60ba597  meta.sr.ht.init"

A sr.ht/todo.sr.ht/todo.sr.ht.init => sr.ht/todo.sr.ht/todo.sr.ht.init +35 -0
@@ 0,0 1,35 @@
#!/sbin/openrc-run
name="todo.sr.ht"
description="todo.sr.ht service"

# Override these with /etc/conf.d/todo.sr.ht
TODO_USER=${TODO_USER:-todo}
TODO_BIND=${TODO_BIND:-127.0.0.1:5000}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/todo.sr.ht.log

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

start() {
	ebegin "Starting $name"
	start-stop-daemon \
		-u ${TODO_USER} \
		-1 "$LOGS" \
		-2 "$LOGS" \
		--background \
		--make-pidfile \
		--pidfile /run/$name.pid \
		--exec /usr/bin/gunicorn -- \
			todosrht.app:app -b ${TODO_BIND}
	eend $?
}

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

A sr.ht/todo.sr.ht/todo.sr.ht.post-install => sr.ht/todo.sr.ht/todo.sr.ht.post-install +3 -0
@@ 0,0 1,3 @@
#!/bin/sh
addgroup -S todo || true
adduser -SDH -s /sbin/nologin -g todo todo || true

A sr.ht/todo.sr.ht/todo.sr.ht.post-upgrade => sr.ht/todo.sr.ht/todo.sr.ht.post-upgrade +6 -0
@@ 0,0 1,6 @@
#!/bin/sh
conf=/etc/sr.ht/alembic/todo.ini
if [ -e "$conf" ]
then
	alembic-3 -c "$conf" upgrade head
fi