~xenrox/personal-packages

5618865e7d31fc204e33590725889131973a0242 — Thorben Günther 1 year, 6 months ago 572f643
man.sr.ht: Add API
2 files changed, 23 insertions(+), 4 deletions(-)

M man.sr.ht/PKGBUILD
A man.sr.ht/man.sr.ht-api.service
M man.sr.ht/PKGBUILD => man.sr.ht/PKGBUILD +10 -4
@@ 1,31 1,37 @@
pkgname=man.sr.ht
pkgver=0.15.27
pkgver=0.15.30
pkgrel=1
pkgdesc="sr.ht wiki services"
arch=("any")
arch=("x86_64")
license=("AGPL3")
url="https://git.sr.ht/~sircmpwn/man.sr.ht"
install=man.sr.ht.install
depends=("python-srht" "python-pygit2" "gunicorn")
makedepends=("python-setuptools" "nodejs" "sassc")
makedepends=("python-setuptools" "nodejs" "sassc" "go")
source=(
	"$pkgname-$pkgver.tar.gz::http://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz"
	"man.sr.ht.service"
	"man.sr.ht-api.service"
	"sysusers.conf"
)
sha256sums=('05ced39397a837ac54631ca9ac0dcb61b38a5d58681c926329bbe758bc39d2ad'
sha256sums=('e34c821428e783f85319b0571de9c7e79b601e2a2c29f9ebb109fa11ea0a7415'
            '47130a2897bca5a6491c0cdcd4443a052eb3f1f83484332b1775ef5f991b9ea0'
            'f6cebc31b1f4993168b9d3873442be2ab93c0a3e604e1f86e34a8aabf65c3a39'
            '8dbd5ed13adcd3fe4f0e31e3b6a7f6c7b116cbd63ce1c430ddcdaec4f7491dee')
export PKGVER=$pkgver

build() {
	cd $pkgbase-$pkgver
	python3 setup.py build
	cd api
	go build -o mansrht-api
}

package() {
	cd $pkgbase-$pkgver
	install -Dm0644 ../man.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm644 ../man.sr.ht-api.service -t "$pkgdir"/usr/lib/systemd/system
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/man.sr.ht.conf"
	install -Dm755 api/mansrht-api "$pkgdir"/usr/bin/mansrht-api
	python3 setup.py install --root="${pkgdir}" --optimize=1
}

A man.sr.ht/man.sr.ht-api.service => man.sr.ht/man.sr.ht-api.service +13 -0
@@ 0,0 1,13 @@
[Unit]
Description=man.sr.ht API service
Requires=redis.service postgresql.service
After=redis.service postgresql.service network.target

[Service]
Type=simple
User=mansrht
Restart=always
ExecStart=/usr/bin/mansrht-api -b :5104

[Install]
WantedBy=multi-user.target