From 572f643e082e1159e0a3ed6717f1f799b5e7d935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Wed, 2 Nov 2022 13:07:11 +0100 Subject: [PATCH] hub.sr.ht: Add API --- hub.sr.ht/PKGBUILD | 12 +++++++++--- hub.sr.ht/hub.sr.ht-api.service | 13 +++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 hub.sr.ht/hub.sr.ht-api.service diff --git a/hub.sr.ht/PKGBUILD b/hub.sr.ht/PKGBUILD index be96efe..5e5e9b1 100644 --- a/hub.sr.ht/PKGBUILD +++ b/hub.sr.ht/PKGBUILD @@ -1,8 +1,8 @@ pkgname=hub.sr.ht -pkgver=0.15.2 +pkgver=0.16.0 pkgrel=1 pkgdesc="SourceHut project hub" -arch=('any') +arch=('x86_64') url="https://git.sr.ht/~sircmpwn/$pkgname" license=('AGPL3') depends=('python-srht') @@ -10,20 +10,26 @@ makedepends=('nodejs' 'sassc' 'go') install=hub.sr.ht.install source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz" "$pkgname.service" + "$pkgname-api.service" "sysusers.conf") -sha256sums=('3838423ee9f61587250d05d4559f79de0d6c41b0af917f29e90402e86b1e3a29' +sha256sums=('796bd975fe1ec063f18ffe2fd79b1e96869e3f81f6d337035f7b3c06d4541928' '3de78b1220fcfd6bd293f8caa6c8f6e9e4a9b0757b6cd614b5c4869613ec0959' + '6fd5e043fcbb1fe1f48f35e79d595560c4171f9c7daca3924ef926319977e6e7' '2ef86c4fddee7cb98af57ef725d393edbda2c2f2cb34c70000a59938510a54ee') export PKGVER=$pkgver build() { cd $pkgname-$pkgver python3 setup.py build + cd api + go build -o hubsrht-api } package() { cd $pkgname-$pkgver install -Dm0644 ../$pkgname.service -t "$pkgdir"/usr/lib/systemd/system/ + install -Dm644 ../$pkgname-api.service -t "$pkgdir"/usr/lib/systemd/system/ install -Dm0644 ../sysusers.conf "$pkgdir"/usr/lib/sysusers.d/$pkgname.conf + install -Dm755 api/hubsrht-api "$pkgdir"/usr/bin/hubsrht-api python3 setup.py install --root="$pkgdir" --optimize=1 } diff --git a/hub.sr.ht/hub.sr.ht-api.service b/hub.sr.ht/hub.sr.ht-api.service new file mode 100644 index 0000000..75c4080 --- /dev/null +++ b/hub.sr.ht/hub.sr.ht-api.service @@ -0,0 +1,13 @@ +[Unit] +Description=hub.sr.ht API service +Requires=redis.service postgresql.service +After=redis.service postgresql.service network.target + +[Service] +Type=simple +User=hubsrht +Restart=always +ExecStart=/usr/bin/hubsrht-api -b :5114 + +[Install] +WantedBy=multi-user.target -- 2.44.0