~dricottone/huttese-apk

e70a64ff9e7b91aece1054ade3dc209f4df9eadd — Drew DeVault 5 years ago cdfa0da
Add hg.sr.ht package
M sr.ht/git.sr.ht/APKBUILD => sr.ht/git.sr.ht/APKBUILD +3 -3
@@ 1,6 1,6 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=git.sr.ht
pkgver=0.16.21
pkgver=0.22.1
pkgrel=0
pkgdesc="sr.ht git service"
url="https://git.sr.ht/~sircmpwn/git.sr.ht"


@@ 34,5 34,5 @@ package() {
	install -Dm755 "$srcdir"/git.sr.ht.init "$pkgdir"/etc/init.d/git.sr.ht
}

sha512sums="3f6559de738796ea522fff2ed1aa592bbae4ba56f59535fb66885deb832b5189fd023b108a63427e94128cd5dc71491c76d1e0104b51f20f758bd3fa89168c16  meta.sr.ht-0.9.8.tar.xz
c149ba165ce153a13f55ce4b46427e6a7f7dc97ce7bbd776e6d56255b90edb52cc02f80c83e59dd11a67efd1ef0fe9e2a2812ca171d215df15513a1ca60ba597  meta.sr.ht.init"
sha512sums="48d41ed22e4ba785366016c2044904eb2a2ab0e24f21660b2b262acce3e1f4bc04f36b2340f2344b924592e271c8e8ab67e76b472b0f5a1fbb8afe6f30f6b5b0  git.sr.ht-0.22.1.tar.gz
53d7ecb4456ea5d95afb40d483b6c2feff23543bff0493e14a94a914db4092986ab2fa1e25c6a9478fd7507b9719ef6d214f69f33cd681d756e1d1e5a5db4295  git.sr.ht.init"

A sr.ht/hg.sr.ht/APKBUILD => sr.ht/hg.sr.ht/APKBUILD +39 -0
@@ 0,0 1,39 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=hg.sr.ht
pkgver=0.1.1
pkgrel=0
pkgdesc="sr.ht mercurial service"
url="https://git.sr.ht/~sircmpwn/hg.sr.ht"
arch="noarch"
license="AGPLv3"
depends="
	py3-hglib
	py3-redis
	py3-scmsrht
	py3-unidiff
"
makedepends="py-setuptools nodejs sassc"
subpackages="${pkgname}-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz
	hg.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
	mkdir -p "$pkgdir"/etc/init.d
	install -Dm755 "$srcdir"/hg.sr.ht.init "$pkgdir"/etc/init.d/hg.sr.ht
}

sha512sums="1594fe5b889525c05539c836594c63d7563184b646724fb3cfa0c4e7aaef0f7f61f66606081dc1ff5e9c77acf1febcbb0d6a89ce0ebf11fb58f04d0a7b6e39fb  hg.sr.ht-0.1.1.tar.gz
5138478f70bf2a0614b72ecbb5c85aafae3c8829d126e4a2f6356dde981154e407b55ab74e3724e2a17a70301fd92f8e233bd0bf0c07e047417bf7d8ea1fcf23  hg.sr.ht.init"

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

# Override these with /etc/conf.d/hg.sr.ht
HG_USER=${HG_USER:-hg}
HG_BIND=${HG_BIND:-127.0.0.1:5001}
LOCAL_PG=${LOCAL_PG:-yes}
LOGS=/var/log/hg.sr.ht.log

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

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

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

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

A sr.ht/hg.sr.ht/hg.sr.ht.post-upgrade => sr.ht/hg.sr.ht/hg.sr.ht.post-upgrade +2 -0
@@ 0,0 1,2 @@
#!/bin/sh
hgsrht-migrate -a upgrade head