61 lines
1.7 KiB
Plaintext
Executable File

# Contributor: Minoplhy <c@3qx.nl>
maintainer="Minoplhy <c@3qx.nl>"
pkgname=crowdsec-firewall-bouncer
pkgver=0.0.31
pkgrel=1
pkgdesc="Crowdsec Bouncer: Iptables Firewall"
url="https://crowdsec.net/"
arch="all"
license="MIT"
depends="iptables ipset"
makedepends="go"
subpackages="
$pkgname-openrc
$pkgname-awall::noarch
"
options="!check" # no test suite identified
source="$pkgname-$pkgver.tar.gz::https://github.com/crowdsecurity/cs-firewall-bouncer/archive/refs/tags/v$pkgver.tar.gz
"$pkgname".initd
awall-policy.json
"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
builddir="$srcdir"/cs-firewall-bouncer-$pkgver
build() {
make binary \
BUILD_VERSION=v$pkgver \
BUILD_TAG="aports"
}
package() {
install -Dm 0755 "$builddir"/crowdsec-firewall-bouncer "$pkgdir"/usr/bin/crowdsec-firewall-bouncer
install -Dm 0755 "$srcdir"/"$pkgname".initd "$pkgdir"/etc/init.d/"$pkgname"
install -dm 0755 \
"$pkgdir"/etc/crowdsec/bouncers
(umask 077 && BACKEND=iptables API_KEY="" envsubst \
<config/crowdsec-firewall-bouncer.yaml \
>"$pkgdir"/etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml)
}
awall() {
pkgdesc="crowdsec bouncer awall policy"
depends="$pkgname"
install_if="awall $pkgname=$pkgver-r$pkgrel"
install -Dm0644 "$srcdir"/awall-policy.json \
"$subpkgdir"/etc/awall/optional/cs-firewall-bouncer.json
}
sha512sums="
400c61595f456668343d8ff34b68eaaabc03db4ae503d6a0a3def60cfd495162e9b72c75ed791d0bbfce691b36a947c2643922ad196a59fae53a300a740acab8 crowdsec-firewall-bouncer-0.0.31.tar.gz
75a22f88820c84a66649bebe06bff4c1aaa00f60273aea54a37b6392a2df5d859f16cdb36f6f3dcefdfffdd0c05978e7ad0ab1062a4812fb31954fd45c6faba2 crowdsec-firewall-bouncer.initd
"