aboutsummaryrefslogtreecommitdiffstats
path: root/main/iptables/APKBUILD
blob: 12e2fa3c1f33a368236efd8881d840c2ddf1ddd7 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

pkgname=iptables
pkgver=1.4.16.3
pkgrel=0
pkgdesc="Linux kernel firewall, NAT and packet mangling tools"
url="http://www.iptables.org/"
arch="all"
license=GPL-2
source="http://iptables.org/projects/iptables/files/$pkgname-$pkgver.tar.bz2
	iptables.initd
	iptables.confd
	ip6tables.confd
	"

makedepends="linux-headers autoconf automake"
subpackages="ip6tables $pkgname-doc $pkgname-dev"

prepare() {
	cd "$srcdir/$pkgname-$pkgver"
	local i
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	sed -i -e '/if_packet/i#define __aligned_u64 __u64 __attribute__((aligned(8)))'    \
		extensions/libxt_pkttype.c || return 1
}

build() {
	cd "$srcdir/$pkgname-$pkgver"
	./configure --prefix=/usr \
		--mandir=/usr/share/man \
		--sbindir=/sbin \
		--without-kernel \
	        --enable-devel \
		--enable-libipq \
		--enable-shared  \
		|| return 1
	make || return 1
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make -j1 install DESTDIR="$pkgdir" || return 1
	rm "$pkgdir"/usr/lib/*.la || return 1

	mkdir -p "$pkgdir"/usr/include/libiptc \
		"$pkgdir"/usr/lib \
		"$pkgdir"/var/lib/iptables \
		"$pkgdir"/etc/init.d \
		"$pkgdir"/etc/conf.d \
		"$pkgdir"/etc/iptables \
		|| return 1
	install -m644 include/iptables.h include/ip6tables.h \
		"$pkgdir"/usr/include/ || return 1
	install include/libiptc/*.h "$pkgdir"/usr/include/libiptc/
	install -m644 libiptc/libiptc.a "$pkgdir"/usr/lib
	install -m755 "$startdir"/iptables.initd "$pkgdir"/etc/init.d/iptables
	install -m644 "$startdir"/iptables.confd "$pkgdir"/etc/conf.d/iptables
}

ip6tables() {
	depends="iptables"
	mkdir -p "$subpkgdir"/sbin \
		"$subpkgdir"/etc/init.d/ \
		"$subpkgdir"/etc/conf.d \
		"$subpkgdir"/var/lib/ip6tables \
		"$subpkgdir"/usr/lib/xtables

	mv "$pkgdir"/sbin/ip6* "$subpkgdir"/sbin/
	mv "$pkgdir"/usr/lib/xtables/libip6* \
		"$subpkgdir"/usr/lib/xtables/
	install -m755 "$startdir"/iptables.initd \
		"$subpkgdir"/etc/init.d/ip6tables
	install -m644 "$startdir"/ip6tables.confd "$subpkgdir"/etc/conf.d/ip6tables
}

md5sums="6dd40c12fb8f4c4312a0f8434369fbcd  iptables-1.4.16.3.tar.bz2
f73fb9a0b9fe42a19d1109b415d86c9c  iptables.initd
c91286c54f8fe0de6ed8950f375cb7a5  iptables.confd
d3f37ebc2cd3fbfc326c3a8df5a79e11  ip6tables.confd"