diff --git a/shorten/APKBUILD b/shorten/APKBUILD new file mode 100644 index 0000000..e4a35b1 --- /dev/null +++ b/shorten/APKBUILD @@ -0,0 +1,34 @@ +# Contributor: Patrycja Rosa +# Maintainer: Patrycja Rosa +pkgname=shorten +pkgver=1.0.0 +pkgrel=0 +pkgdesc="Simple URL shortener" +url="https://git.ddd.rip/ptrcnull/shorten" +arch="all" +license="BSD-2-Clause" +makedepends="go" +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://git.ddd.rip/ptrcnull/shorten/archive/v$pkgver.tar.gz + shorten.initd + shorten.confd + " +options="!check" +builddir="$srcdir/shorten" + +build() { + go build -o shorten . +} + +package() { + install -Dm755 shorten "$pkgdir"/usr/bin/shorten + + install -Dm755 "$srcdir"/shorten.initd "$pkgdir"/etc/init.d/shorten + install -Dm644 "$srcdir"/shorten.confd "$pkgdir"/etc/conf.d/shorten +} + +sha512sums=" +31b5f437a72195a112983becf33eabdfc224b1903358203621143629a136780c5567d1a48f6f6c02ea02b421f600d4b69a5aa21497ae7741adc4ec036cd02ce3 shorten-1.0.0.tar.gz +e030ea786e8f47f503476a5bca6ce1a88e3e0090c61005d247a7a16819020b22facf9cdfdaed2a615306aa5639d790cf718781df75c786ff66e7f0b980031248 shorten.initd +45d1a7b08f48f8aa6f84a390403927614533d68b1680e9a332da439e790df6bdbd59e5b44af901a14029e7aa27c1820e5d62f129fec8590fd2f97f6a5096a81e shorten.confd +" diff --git a/shorten/shorten.confd b/shorten/shorten.confd new file mode 100644 index 0000000..6844ea0 --- /dev/null +++ b/shorten/shorten.confd @@ -0,0 +1,3 @@ +# Configuration file for shorten +export SHORTEN_HOST="localhost" +export POSTGRES_URI="" diff --git a/shorten/shorten.initd b/shorten/shorten.initd new file mode 100644 index 0000000..955962b --- /dev/null +++ b/shorten/shorten.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run + +supervisor=supervise-daemon + +name="shorten" +command="/usr/bin/shorten" + +output_log="/var/log/shorten.log" +error_log="/var/log/shorten.log" + +depend() { + need net + after firewall postgresql +}