Author: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
rascunho: new package
pkgs/rascunho/APKBUILD | 42 ++++++++++++++++++++++++++++++++ pkgs/rascunho/rascunho.confd | 8 ++++++ pkgs/rascunho/rascunho.initd | 22 ++++++++++++++++ pkgs/rascunho/rascunho.pre-install | 3 ++
diff --git a/pkgs/rascunho/APKBUILD b/pkgs/rascunho/APKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..88bf22d3dca21e27c32767a680e080a949cfaeb0 --- /dev/null +++ b/pkgs/rascunho/APKBUILD @@ -0,0 +1,42 @@ +# Maintainer: Pedro Lucas Porcellis <porcellis@eletrotupi.com> +pkgname=rascunho +pkgver=0.0.1 +pkgrel=0 +pkgdesc="a barebones markdown preview service" +url="https://git.sr.ht/~porcellis/rascunho" +arch="noarch" +license="AGPLv3" +depends=" + py3-gunicorn + py3-flask + py3-mistune + py3-sqlalchemy + py3-psycopg2 +" +makedepends="py-setuptools" +subpackages="$pkgname-openrc" +source=" + $pkgname-$pkgver.tar.gz::https://git.sr.ht/~porcellis/$pkgname/archive/$pkgver.tar.gz + rascunho.initd + rascunho.confd +" +export PKGVER=$pkgver +options="$options !check" # no testsuite +install="$pkgname.pre-install" + +build() { + python3 setup.py build +} + +package() { + python3 setup.py install --root="$pkgdir" --optimize=1 + install -Dm755 "$srcdir"/rascunho.initd \ + "$pkgdir"/etc/init.d/rascunho + install -Dm644 "$srcdir"/rascunho.confd \ + "$pkgdir"/etc/conf.d/rascunho +} +sha512sums=" +a1f885d4cd69f376a7763e8bf72e00c905f4fbcb7aa25cce2577394b4f939bf654358cc1d87327655891d8831241275bc0ac208ac6d2a59eb55ef13344f8bd73 rascunho-0.0.1.tar.gz +0d48f5c4e01ecc21c54be6b52bf3b8a576cfb57305b3a2c3cc83484bff4131e123d319e44c56ec6cca3c25b6f35754f629f094a94e0888950dc13d7a46c56cad rascunho.initd +1e00c452f699340728a686c3fac9821d0882a8a982b9e8fd20572762b474d0c74721902fb491b7df6a55f750d760ca5cc383972dc7d1c59ca69e2fe57012e24a rascunho.confd +" diff --git a/pkgs/rascunho/rascunho.confd b/pkgs/rascunho/rascunho.confd new file mode 100644 index 0000000000000000000000000000000000000000..e6aca7090137b1787e4ffe64b67e81cfdd0e4f5d --- /dev/null +++ b/pkgs/rascunho/rascunho.confd @@ -0,0 +1,8 @@ +# Run the daemon as this user: +# RASCUNHO_USER=rascunho + +# Bind the web service to this address: +# RASCUNHO_BIND=127.0.0.1:5004 + +# Extra arguments to pass to Gunicorn +# RASCUNHO_ARGS= diff --git a/pkgs/rascunho/rascunho.initd b/pkgs/rascunho/rascunho.initd new file mode 100755 index 0000000000000000000000000000000000000000..091ca8ff3fa9368ac0e433fbad93ef46974981a6 --- /dev/null +++ b/pkgs/rascunho/rascunho.initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +name="rascunho" +description="rascunho markdown preview service" +supervisor=supervise-daemon +RASCUNHO_USER=${RASCUNHO_USER:-rascunho} +RASCUNHO_BIND=${RASCUNHO_BIND:-127.0.0.1:5004} +RASCUNHO_ARGS=${RASCUNHO_ARGS:-} +LOGS=/var/log/rascunho.log +supervise_daemon_args="-1 $LOGS -2 $LOGS" +command="/usr/bin/gunicorn" +command_args="rascunho:app -b $RASCUNHO_BIND $RASCUNHO_ARGS" +command_user="$RASCUNHO_USER:$RASCUNHO_USER" +pidfile="/run/${RC_SVCNAME}.pid" + +depend() { + need net + use postgresql +} + +start_pre() { + checkpath -f "$LOGS" -m 644 -o "$RASCUNHO_USER:$RASCUNHO_USER" +} diff --git a/pkgs/rascunho/rascunho.pre-install b/pkgs/rascunho/rascunho.pre-install new file mode 100644 index 0000000000000000000000000000000000000000..878fe02d932ae0263958e31476316f32f92655af --- /dev/null +++ b/pkgs/rascunho/rascunho.pre-install @@ -0,0 +1,3 @@ +#!/bin/sh +addgroup -S rascunho || true +adduser -HSD -h / -s /sbin/nologin -G rascunho -g rascunho rascunho || true