pacotes.eletrotupi.com

commit 66ee1f79d583a5c93193031d62b980a4888fa5ef

Author: Pedro Lucas Porcellis <porcellis@eletrotupi.com>

antispam-api: new aports

 pkgs/antispam-api/APKBUILD | 42 ++++++++++++++++++++++++
 pkgs/antispam-api/antispam-api.confd | 2 +
 pkgs/antispam-api/antispam-api.initd | 15 ++++++++
 pkgs/antispam-api/antispam-api.pre-install | 6 +++


diff --git a/pkgs/antispam-api/APKBUILD b/pkgs/antispam-api/APKBUILD
new file mode 100644
index 0000000000000000000000000000000000000000..2738768c63a0681c604699962cbbdd860aed7480
--- /dev/null
+++ b/pkgs/antispam-api/APKBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
+pkgname=antispam-api
+pkgver=0_git20220503
+_commit=cb63e0104ac171fd9fed9ca172610d409b4aaa7f
+pkgrel=0
+pkgdesc="A simple API to potentially identify spammy domains/usernames"
+options="!check" # No testsuite
+url="https://git.sr.ht/~porcellis/antispam-api"
+arch="all"
+license="MIT"
+subpackages="$pkgname-openrc"
+makedepends="go git"
+install="$pkgname.pre-install"
+source="
+	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~porcellis/antispam-api/archive/$_commit.tar.gz
+	$pkgname.initd
+	$pkgname.confd
+"
+builddir="$srcdir/$pkgname-$_commit"
+
+build() {
+	go mod vendor
+	go build \
+		-o $pkgname \
+		-trimpath \
+		-mod=vendor \
+		-ldflags "-extldflags $LDFLAGS"
+}
+
+check() {
+	go test ./...
+}
+
+package() {
+	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
+	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+}
+sha512sums="
+b64c286dbfd9480ac945c2ebe170099b35eff6cfbe8c90371ab9c58ba566bf9b5df593672eb446a1ac1bc77fee31b997bdb96ff60f8f2799d93fee8cb94803f7  antispam-api-0_git20220503.tar.gz
+b775b65fab8ec07098b6ff75f5a9985d60ce62634ce511d9757f478961bc1acfb504188378cae25491570f4065d5b9a91684acb4577d72902dba6ab5653e584f  antispam-api.initd
+a5b86f03c863d588ed1a69709dbbf28ab7c36becd5b9e139b64029ab7cd1ffa7dda27b58c4c276db8a77c4d398a8afa496f80dbe8586dceb735a5d61027ac7f7  antispam-api.confd
+"




diff --git a/pkgs/antispam-api/antispam-api.confd b/pkgs/antispam-api/antispam-api.confd
new file mode 100644
index 0000000000000000000000000000000000000000..13bd13e60eee686ccb476a2d22201029fa898bc0
--- /dev/null
+++ b/pkgs/antispam-api/antispam-api.confd
@@ -0,0 +1,2 @@
+# Configuration files for antispam
+ANTISPAM_DATADIR=/usr/share/antispam




diff --git a/pkgs/antispam-api/antispam-api.initd b/pkgs/antispam-api/antispam-api.initd
new file mode 100644
index 0000000000000000000000000000000000000000..660e7d6fe698f2a644cdcc361033c4fecf83a549
--- /dev/null
+++ b/pkgs/antispam-api/antispam-api.initd
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+name="antispam"
+description="Tiny daemon API for identify potentially spam username/domains"
+supervisor=supervise-daemon
+command=/usr/bin/antispam
+command_args="$antispam_upstream"
+command_user="antispam:antispam"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+start_pre() {
+	[ -n "$output_log" ] && checkpath -f "$output_log" \
+		-m 644 -o antispam:antispam
+	[ -n "$error_log" ] && checkpath -f "$error_log" \
+		-m 644 -o antispam:antispam
+}




diff --git a/pkgs/antispam-api/antispam-api.pre-install b/pkgs/antispam-api/antispam-api.pre-install
new file mode 100644
index 0000000000000000000000000000000000000000..33ec54c907000dd6ff97d281bfa51f9eb5e2b48a
--- /dev/null
+++ b/pkgs/antispam-api/antispam-api.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S antispam 2>/dev/null
+adduser -S -D -H -h /var/empty -s /sbin/nologin -G antispam -g antispam antispam 2>/dev/null
+
+exit 0