aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpcyrd <git@rxv.cc>2020-05-25 00:03:34 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-05-24 22:04:40 +0000
commit7e9e42b9be8b6f41f612a6682a3f4573b7fc7ed7 (patch)
tree9b79d35db586f5c132c8d154c6d663f3c473b2a7
parente759196927733ac180a1c1af6a52bde9e3b6d887 (diff)
downloadaports-7e9e42b9be8b6f41f612a6682a3f4573b7fc7ed7.tar.gz
aports-7e9e42b9be8b6f41f612a6682a3f4573b7fc7ed7.tar.bz2
aports-7e9e42b9be8b6f41f612a6682a3f4573b7fc7ed7.tar.xz
testing/acme-redirect: new aport
-rw-r--r--testing/acme-redirect/APKBUILD64
-rw-r--r--testing/acme-redirect/acme-redirect.pre-install6
2 files changed, 70 insertions, 0 deletions
diff --git a/testing/acme-redirect/APKBUILD b/testing/acme-redirect/APKBUILD
new file mode 100644
index 0000000000..1edc0f108f
--- /dev/null
+++ b/testing/acme-redirect/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: kpcyrd <git@rxv.cc>
+# Maintainer: kpcyrd <git@rxv.cc>
+pkgname=acme-redirect
+pkgver=0.4.0
+pkgrel=0
+pkgdesc="Tiny http daemon that answers acme challenges and redirects everything else to https"
+url="https://github.com/kpcyrd/acme-redirect"
+arch="x86_64 armhf armv7" # limited by cargo
+license="GPL-3.0-or-later"
+makedepends="
+ cargo
+ openssl-dev
+ scdoc
+ "
+subpackages="$pkgname-doc
+ $pkgname-openrc
+ $pkgname-bash-completion
+ $pkgname-zsh-completion
+ $pkgname-fish-completion
+ "
+install="$pkgname.pre-install"
+options="net"
+source="$pkgname-$pkgver.tar.gz::https://github.com/kpcyrd/acme-redirect/archive/v$pkgver.tar.gz"
+
+build() {
+ cargo build --release --locked
+
+ mkdir -p completions
+ "target/release/acme-redirect" completions bash > completions/acme-redirect.bash
+ "target/release/acme-redirect" completions zsh > completions/_acme-redirect
+ "target/release/acme-redirect" completions fish > completions/acme-redirect.fish
+
+ make docs
+}
+
+check() {
+ cargo test --release --locked
+}
+
+package() {
+ install -Dm755 "$builddir/target/release/acme-redirect" -t "$pkgdir/usr/bin"
+
+ install -Dm755 "$builddir/contrib/openrc/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
+ install -Dm755 "$builddir/contrib/cron/acme-redirect.cron" \
+ "$pkgdir"/etc/periodic/daily/acme-redirect
+
+ install -Dm644 "$builddir/contrib/confs/acme-redirect.conf" -t "$pkgdir/etc"
+ install -Dm644 "$builddir/contrib/confs/certs.d/example.com.conf" "$pkgdir/etc/acme-redirect.d/example.com.conf.sample"
+
+ install -Dm644 -t "$pkgdir/usr/share/man/man1" \
+ "$builddir/contrib/docs/acme-redirect.1"
+ install -Dm644 -t "$pkgdir/usr/share/man/man5" \
+ "$builddir/contrib/docs/acme-redirect.conf.5" \
+ "$builddir/contrib/docs/acme-redirect.d.5"
+
+ install -Dm644 "$builddir/completions/acme-redirect.bash" \
+ "$pkgdir/usr/share/bash-completion/completions/acme-redirect"
+ install -Dm644 "$builddir/completions/_acme-redirect" \
+ "$pkgdir/usr/share/zsh/site-functions/_acme-redirect"
+ install -Dm644 "$builddir/completions/acme-redirect.fish" \
+ "$pkgdir/usr/share/fish/completions/acme-redirect.fish"
+}
+
+sha512sums="726cb8a28e93743ff6bb28b3f134b11980ba7731ed18900602401e595c21ff7c51f935e0cca1a98f4e69cc08bdd8ca3f5437c4450c296313d631fa9df81f8fa1 acme-redirect-0.4.0.tar.gz"
diff --git a/testing/acme-redirect/acme-redirect.pre-install b/testing/acme-redirect/acme-redirect.pre-install
new file mode 100644
index 0000000000..138ea113ba
--- /dev/null
+++ b/testing/acme-redirect/acme-redirect.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S acme-redirect 2>/dev/null
+adduser -S -D -H -s /sbin/nologin -G acme-redirect -g acme-redirect acme-redirect 2>/dev/null
+
+exit 0