# Maintainer: Natanael Copa pkgname=iptables pkgver=1.4.12.2 pkgrel=1 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-1.4.2-include-in.patch 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 } 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 install -m644 "$startdir"/ip6tables.confd "$pkgdir"/etc/conf.d/ip6tables } ip6tables() { depends="iptables" 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 } md5sums="212112389c7f10c72efb31a4ed193a4c iptables-1.4.12.2.tar.bz2 ec3e80a1b0ea3e13e4e60824b7ebd1b9 iptables-1.4.2-include-in.patch 375c4431c6c7a67da28ef9c470fc7e47 iptables.initd 2ae5c23689c65ed7e827802c47acd426 iptables.confd 91933090bd9d493c91dcffc0221def61 ip6tables.confd"