APKBUILD 1.85 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2 3 4
#!/bin/sh
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

pkgname=iptables
5
pkgver=1.4.6
Natanael Copa's avatar
Natanael Copa committed
6 7 8 9 10 11 12 13 14
pkgrel=0
pkgdesc="Linux kernel firewall, NAT and packet mangling tools"
url="http://www.iptables.org/"
license=GPL-2
source="http://iptables.org/projects/iptables/files/$pkgname-$pkgver.tar.bz2
	iptables-1.4.2-include-in.patch
	iptables.initd
	iptables.confd
	"
15

Natanael Copa's avatar
Natanael Copa committed
16 17 18 19 20 21 22
makedepends="linux-headers"
subpackages="ip6tables $pkgname-doc $pkgname-dev"

build() {
	local i
	cd "$srcdir/$pkgname-$pkgver"
	for i in ../*.patch; do
23
		msg "Applying $i..."
Natanael Copa's avatar
Natanael Copa committed
24 25 26 27 28 29 30 31 32 33 34
		patch -p1 -i $i || return 1
	done

	./configure --prefix=/usr \
		--mandir=/usr/share/man \
		--sbindir=/sbin \
		--without-kernel \
	        --enable-devel \
		--enable-libipq \
		--enable-shared 
	make || return 1
35 36 37 38
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
39
	make -j1 install DESTDIR="$pkgdir"
Natanael Copa's avatar
Natanael Copa committed
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

	mkdir -p "$pkgdir"/usr/include/libiptc \
		"$pkgdir"/usr/lib \
		"$pkgdir"/var/lib/iptables \
		"$pkgdir"/etc/init.d \
		"$pkgdir"/etc/conf.d
	install -m644 include/iptables.h include/ip6tables.h \
		"$pkgdir"/usr/include/
	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() {
	mkdir -p "$subpkgdir"/sbin \
		"$subpkgdir"/etc/init.d/ \
		"$subpkgdir"/var/lib/ip6tables \
		"$subpkgdir"/usr/libexec/xtables

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

67
md5sums="c67cf30e281a924def6426be0973df56  iptables-1.4.6.tar.bz2
Natanael Copa's avatar
Natanael Copa committed
68 69 70
ec3e80a1b0ea3e13e4e60824b7ebd1b9  iptables-1.4.2-include-in.patch
2202ac150a5dfe32a8363b0ad565ee1d  iptables.initd
956ebf5ab69e5a1e1d3983541eab643b  iptables.confd"