summaryrefslogtreecommitdiffstats
path: root/main/fail2ban/APKBUILD
blob: 170032b4e1f829b114f08c43ff4e9a00d9e44a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Contributor: Jeff Bilyk <jbilyk@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fail2ban
pkgver=0.8.4
pkgrel=2
pkgdesc="Scans log files for login failures then updates iptables to reject originating ip address"
url="http://www.fail2ban.org"
arch="noarch"
license="GPLv2"
depends="python iptables logrotate"
makedepends="python-dev"
install=""
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2
	gentoo-initd_create_run_dir.patch
	fail2ban.confd
	fail2ban.logrotate
	"

_builddir="$srcdir/$pkgname-$pkgver"
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
}

package() {
	cd "$_builddir"
	python setup.py install --root "$pkgdir" || return 1
	install -Dm755 files/gentoo-initd "$pkgdir"/etc/init.d/fail2ban \
		|| return 1
	install -Dm644 "$srcdir"/fail2ban.confd "$pkgdir"/etc/conf.d/fail2ban \
		|| return 1
	install -Dm644 "$srcdir"/fail2ban.logrotate \
		"$pkgdir"/etc/logrotate.d/fail2ban || return 1
}

md5sums="df94335a5d12b4750869e5fe350073fa  fail2ban-0.8.4.tar.bz2
61580eb6d8d9a4d187e97bc27f2fcb1e  gentoo-initd_create_run_dir.patch
b209a04f9314dd064a4aa0ee505c8a4d  fail2ban.confd
6d1af6ceebd15c8ae3938bc675efe553  fail2ban.logrotate"