~sircmpwn/sr.ht-packages

todo.sr.ht: Add api service v1 PROPOSED

Thorben Günther: 1
 todo.sr.ht: Add api service

 2 files changed, 24 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-packages/patches/20555/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] todo.sr.ht: Add api service Export this patch

---
 todo.sr.ht/PKGBUILD               | 15 +++++++++++----
 todo.sr.ht/todo.sr.ht-api.service | 13 +++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)
 create mode 100644 todo.sr.ht/todo.sr.ht-api.service
diff --git a/todo.sr.ht/PKGBUILD b/todo.sr.ht/PKGBUILD
index 60d79ed..5663f52 100644
--- a/todo.sr.ht/PKGBUILD
+++ b/todo.sr.ht/PKGBUILD
@@ -1,8 +1,8 @@
pkgname=todo.sr.ht
pkgver=0.62.8
pkgver=0.64.5
pkgrel=2
pkgdesc="sr.ht ticket tracking service"
arch=("any")
arch=("x86_64")
license=("AGPL3")
url="https://git.sr.ht/~sircmpwn/todo.sr.ht"
depends=(
@@ -10,24 +10,28 @@ depends=(
	"gunicorn"
)
install=todo.sr.ht.install
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"
	"todo.sr.ht.service"
	"todo.sr.ht-lmtp.service"
	"todo.sr.ht-webhooks.service"
	"todo.sr.ht-api.service"
	"sysusers.conf"
)
sha256sums=('2a5ea11cf94e225611e90d8975bf382ff167dfc7013b9d8b7d6b8f22b2379096'
sha256sums=('a9add8966c181d34b8c1262341428de89bd141915c89864800fcc0b8d75fa1c7'
            '6c373a2df95e6062efd167de75b1d58af980a509a50b71507d07120c6b9358b2'
            '79ae025c6c4f40b8fda2444668704842c90348f42c291232296f6d0368e99b32'
            'fd00e7e8664f4ef42c5d51117ae62dd8cfa7286754cd1c7334238ff53d69379d'
            '4a9d0ebb19f819ae94f3f9c083860f0a9d3adf69b5489230271469054c9157c6'
            'f9b1dbca0557b7b24654dcb0d7e7d990675ce251a3d2f380d87eb1d3aca93821')
export PKGVER=$pkgver

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

package() {
@@ -35,6 +39,9 @@ package() {
	install -Dm0644 ../todo.sr.ht.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../todo.sr.ht-lmtp.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../todo.sr.ht-webhooks.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../todo.sr.ht-api.service -t "$pkgdir"/usr/lib/systemd/system/
	install -Dm0644 ../sysusers.conf "$pkgdir/usr/lib/sysusers.d/todo.sr.ht.conf"
	python3 setup.py install --root="${pkgdir}" --optimize=1
	cd api
	install -Dm0755 todosrht-api "$pkgdir"/usr/bin/todosrht-api
}
diff --git a/todo.sr.ht/todo.sr.ht-api.service b/todo.sr.ht/todo.sr.ht-api.service
new file mode 100644
index 0000000..b55065c
--- /dev/null
+++ b/todo.sr.ht/todo.sr.ht-api.service
@@ -0,0 +1,13 @@
[Unit]
Description=todo.sr.ht API service
Requires=redis.service postgresql.service
After=redis.service postgresql.service network.target

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

[Install]
WantedBy=multi-user.target
-- 
2.30.1