53 lines
1.7 KiB
Bash
53 lines
1.7 KiB
Bash
# Maintainer: PktSurf <smlinux@pktsurf.in>
|
|
app=fail2ban
|
|
version=1.0.2
|
|
build=1sml
|
|
homepage="http://www.fail2ban.org/wiki/index.php/Main_Page"
|
|
download="https://github.com/fail2ban/fail2ban/archive/refs/tags/$version.tar.gz"
|
|
desc="Log-based intrusion detection and prevention system written in Python"
|
|
requires="python3 iptables"
|
|
|
|
prepbuilddir() {
|
|
mkandenterbuilddir
|
|
rm -rf $app-$version
|
|
|
|
tar xf $srcdir/$app-$version.tar.?z*
|
|
cd $app-$version
|
|
fixbuilddirpermissions
|
|
}
|
|
|
|
build() {
|
|
sh fail2ban-2to3
|
|
python setup.py install --root=$pkg
|
|
|
|
cp COPYING $pkgdocs/
|
|
|
|
# move config files to .new
|
|
(
|
|
cd $pkg/etc/fail2ban
|
|
for file in $(find . -type f); do
|
|
mv $file "$file.new"
|
|
done
|
|
)
|
|
|
|
( cd $pkg/etc/fail2ban ; patch -p0 < $srcdir/jail.conf.patch )
|
|
|
|
install -D -m 0755 $srcdir/rc.fail2ban $pkg/etc/rc.d/rc.fail2ban.new
|
|
install -D -m 0644 $srcdir/paths-smlinux.conf $pkg/etc/fail2ban/paths-smlinux.conf.new
|
|
rm -f $pkg/etc/fail2ban/paths-{arch,debian,fedora,freebsd,osx,opensuse}.conf.new
|
|
|
|
mkdir -p $pkg/var/{run,lib/fail2ban} $pkg/usr/share/man/man1
|
|
for man in fail2ban-client.1 fail2ban-regex.1 fail2ban-server.1 fail2ban.1 fail2ban-testcases.1 ; do
|
|
install -Dm 0644 man/$man $pkg/usr/share/man/man1
|
|
done
|
|
install -Dm 0644 man/jail.conf.5 $pkg/usr/share/man/man5/jail.conf.5
|
|
|
|
mv $pkg/usr/share/doc/$app/* $pkgdocs/
|
|
|
|
mkfinalpkg
|
|
}
|
|
|
|
sha512sums="
|
|
688a84361b5794e1658f53d2d200ce752fe1e3320ddb1742c32c4b4b82a79ace16ae464e7ea3eeb94a0e862bcac73c2d3a0e61dd7b28e179a4c857f950d74dbb fail2ban-1.0.2.tar.gz
|
|
89c6e4bbb1a01f3f7601372bbd49d72dd6a17a58503cce30f754110cdc8b55fc80dfa21b5e97a16525bd80c7cae961af5024e5cca45d922245eeefa83cb54ef2 jail.conf.patch
|
|
"
|