62 lines
1.9 KiB
Plaintext
Executable File

# Contributor: Minoplhy <c@3qx.nl>
maintainer="Minoplhy <c@3qx.nl>"
pkgname=minoplhy-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 envsubst"
subpackages="
$pkgname-openrc
$pkgname-awall::noarch
"
options="!check" # no test suite identified
source="crowdsec-firewall-bouncer-$pkgver.tar.gz::https://github.com/crowdsecurity/cs-firewall-bouncer/archive/refs/tags/v$pkgver.tar.gz
crowdsec-firewall-bouncer.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
c7f522a18b61211ed4a3fa9a0b0242fec59e9a57107f0d1bba793ccce85f4d7dce0cf3c1286a3708f52e16b73cdb8266ea8da21afa6a051c9c4368bd99265e6e crowdsec-firewall-bouncer.initd
1300e046b97d6a1d9d1eac5080b1f4c16ad0387f9483dbd4f37b81feb9e9466b993bc396ed2a45ccf8bf026f0bc83026bc35cc92fdb2c075d5de56309afc9f3e awall-policy.json
"