From 1b1036f1353d2625bdebe1aacc327210dea401a4 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Wed, 28 Dec 2022 01:49:02 +0100 Subject: feat: Add jnfilter package --- apks/jnfilter/APKBUILD | 57 +++++++++++++++++++++++++++++++++++++++ apks/jnfilter/jnfilter.confd | 3 +++ apks/jnfilter/jnfilter.initd | 17 ++++++++++++ apks/jnfilter/jnfilter.nginx.conf | 8 ++++++ 4 files changed, 85 insertions(+) create mode 100644 apks/jnfilter/APKBUILD create mode 100644 apks/jnfilter/jnfilter.confd create mode 100644 apks/jnfilter/jnfilter.initd create mode 100644 apks/jnfilter/jnfilter.nginx.conf (limited to 'apks/jnfilter') diff --git a/apks/jnfilter/APKBUILD b/apks/jnfilter/APKBUILD new file mode 100644 index 0000000..cf9c6fd --- /dev/null +++ b/apks/jnfilter/APKBUILD @@ -0,0 +1,57 @@ +# Maintainer: Gabriel Arakaki Giovanini +pkgname=jnfilter +pkgver=0.1.0 +pkgrel=5 +pkgdesc="Filtro for Joven Nerd's podcast feed" +url="https://git.sr.ht/~gabrielgio/jnfilter" +arch="noarch" +license="Apache-2.0" +options="!check" # package does not provide test +depends=" + python3 + py3-httpx + py3-flask + py3-gunicorn +" +makedepends="python3-dev " +builddir="$srcdir/$pkgname-$pkgver" +subpackages=" + $pkgname-openrc + $pkgname-nginx:_nginx:noarch +" +source=" + $pkgname-$pkgver.tar.gz::https://artifacts.gabrielgio.me/archive/$pkgname/$pkgname-$pkgver.tar.gz + $pkgname.initd + $pkgname.nginx.conf + $pkgname.confd +" +provides="py3-jnfilter=$pkgver-r$pkgrel" + + +build() { + python3 setup.py build +} + +_nginx() { + depends="nginx jnfilter" + pkgdesc="nginx configuration for $pkgname" + install -Dm644 "$srcdir"/"$package"/"$pkgname".nginx.conf \ + "$subpkgdir"/etc/nginx/http.d/"$pkgname".nginx.conf +} + +package() { + # install scripts + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname + + python3 setup.py install --prefix=/usr --root="$pkgdir" +} + +sha512sums=" +7af506e023cd1db5b18c4026e8d299852ea8baee6dacb29786ba334da0bc7e25de86352c11c08b8aa4207ab3dc07cfaa9eac4484aa446e816ee47406d3e03e03 jnfilter-0.1.0.tar.gz +4e9afb1c25218e78aa9ce033c76689613c55eeab2c3b460476ee64375c50b83f99e98ce504c9a9485ae55e186d02eb5d38715100343a8b59cab0f14aa7fa2346 jnfilter.initd +7edf3d3932a8af82aa5140523c517da2d697e10c197b784bd9d370baddccb66c25a67c4e2b1d64f7521e818258348e3153168256572ab5bc1b0f0bc73ffe6944 jnfilter.nginx.conf +00142d4a156bba4b714c2488674a53f82a95cbfd073aede159011de5aca415fe51481eee2bd225e376fd9cdf66ba95faa76beb038c896b6148454f940a58fffd jnfilter.confd +" diff --git a/apks/jnfilter/jnfilter.confd b/apks/jnfilter/jnfilter.confd new file mode 100644 index 0000000..d446d70 --- /dev/null +++ b/apks/jnfilter/jnfilter.confd @@ -0,0 +1,3 @@ +port=32000 +host=127.0.0.1 +workers=2 diff --git a/apks/jnfilter/jnfilter.initd b/apks/jnfilter/jnfilter.initd new file mode 100644 index 0000000..83c7a97 --- /dev/null +++ b/apks/jnfilter/jnfilter.initd @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +supervisor="supervise-daemon" + +name="jnfilter" +command="/usr/bin/gunicorn" +command_args=" + -w ${workers} + -b ${host}:${port} + jnfilter:app +" +command_background="yes" + +pidfile="/run/$RC_SVCNAME.pid" + +depend() { + use net +} diff --git a/apks/jnfilter/jnfilter.nginx.conf b/apks/jnfilter/jnfilter.nginx.conf new file mode 100644 index 0000000..2f4672e --- /dev/null +++ b/apks/jnfilter/jnfilter.nginx.conf @@ -0,0 +1,8 @@ +server { + server_name jnfilter.lan; + access_log /var/log/nginx/jnfilter.log main; + + location / { + proxy_pass http://localhost:32000; + } +} -- cgit v1.2.3