~alpine/aports

testing/pasticcio: new aport v1 PROPOSED

Francesco Camuffo <dev@fmac.xyz>
Francesco Camuffo: 1
 testing/pasticcio: new aport

 3 files changed, 62 insertions(+), 0 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.alpinelinux.org/~alpine/aports/patches/4137/mbox | git am -3
Learn more about email & git

[PATCH] testing/pasticcio: new aport Export this patch

Francesco Camuffo <dev@fmac.xyz>
https://sr.ht/~fmac/Pasticcio/
Pastebin with private and public collections
---
 testing/pasticcio/APKBUILD              | 44 +++++++++++++++++++++++++
 testing/pasticcio/pasticcio.initd       | 12 +++++++
 testing/pasticcio/pasticcio.pre-install |  6 ++++
 3 files changed, 62 insertions(+)
 create mode 100644 testing/pasticcio/APKBUILD
 create mode 100644 testing/pasticcio/pasticcio.initd
 create mode 100644 testing/pasticcio/pasticcio.pre-install

diff --git a/testing/pasticcio/APKBUILD b/testing/pasticcio/APKBUILD
new file mode 100644
index 0000000000..57d12c617b
--- /dev/null
+++ b/testing/pasticcio/APKBUILD
@@ -0,0 +1,44 @@
# Maintainer: Francesco Camuffo <dev@fmac.xyz>
pkgname=pasticcio
pkgver=0.1.8
pkgrel=0
pkgdesc="Pastebin with private and public collections"
url="https://git.sr.ht/~fmac/pasticcio"
arch="all"
license="MIT"
makedepends="
	go
	minify
	npm
	sassc
"
install="$pkgname.pre-install"
pkgusers="$pkgname"
pkggroups="$pkgname"
options="!check" # no tests
subpackages="$pkgname-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~fmac/pasticcio/archive/v$pkgver.tar.gz
	$pkgname.initd
"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	npm install
	make
	go build -o pasticcio cmd/server/main.go
}

package() {
	install -vDm 755 pasticcio "$pkgdir"/usr/bin/pasticcio
	install -vDm 644 config.example.yaml "$pkgdir"/etc/pasticcio/config.yaml
	install -vdm 755 "$pkgdir"/usr/share/webapps/$pkgname
	mv web/client/public web/templates "$pkgdir"/usr/share/webapps/$pkgname/

	install -vDm 755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
}

sha512sums="
43e7eb40da90f65a153c52e2c51dcb59fe8709aa2a8d7517e86053f1ea1ddb3a34ac062a7c14a820daa273e9bf40a63956e4df528c169b5a5a3a560bc6474ba6  pasticcio-0.1.8.tar.gz
091115e5423478d89fa5bd6f0d73eb132a8d4e04316577cc4b687e675baeaa909762f55c8deb344e3d88521e7a2559dd24f7ea4d88b09d299b143f693c7abb81  pasticcio.initd
"
diff --git a/testing/pasticcio/pasticcio.initd b/testing/pasticcio/pasticcio.initd
new file mode 100644
index 0000000000..1459bfd74f
--- /dev/null
+++ b/testing/pasticcio/pasticcio.initd
@@ -0,0 +1,12 @@
#!/sbin/openrc-run

supervisor=supervise-daemon
name=pasticcio
command="/usr/bin/pasticcio"
command_user="${PASTICCIO_USER:-pasticcio}"
pidfile="/run/pasticcio.pid"

depend() {
  need net
  after firewall
}
diff --git a/testing/pasticcio/pasticcio.pre-install b/testing/pasticcio/pasticcio.pre-install
new file mode 100644
index 0000000000..c73d1a29f4
--- /dev/null
+++ b/testing/pasticcio/pasticcio.pre-install
@@ -0,0 +1,6 @@
#!/bin/sh

addgroup -S pasticcio 2>/dev/null
adduser -S -D -h /usr/share/webapps/pasticcio/public -s /sbin/nologin -G pasticcio -g pasticcio pasticcio 2>/dev/null

exit 0
-- 
2.34.1