description="The principal firewall tool for Linux."
url="http://www.iptables.org/"
packager="tnut <tnut@nutyx.org>"
contributors="Pierre B"

name=iptables
version=1.6.2
nutyx_version=10.1

source=(http://downloads.tuxfamily.org/nutyx/files/nutyx-${nutyx_version}.tar.xz
	http://www.netfilter.org/projects/iptables/files/$name-$version.tar.bz2)

build() {

cd $name-$version

./configure --prefix=/usr \
--sbindir=/sbin \
--with-xtlibdir=/lib/xtables \
--with-pkgconfigdir=/usr/lib/pkgconfig \
--enable-libipq \
--disable-nftables \
--enable-devel
make
make DESTDIR=$PKG install

ln -sfv ../../sbin/xtables-multi $PKG/usr/bin/iptables-xml
for file in ip4tc ip6tc ipq iptc xtables
do
   mv -v $PKG/usr/lib/lib${file}.so.* $PKG/lib
   ln -sfv ../../lib/$(readlink $PKG/usr/lib/lib${file}.so) $PKG/usr/lib/lib${file}.so
done
# service
cd ../nutyx-${nutyx_version}
make DESTDIR=$PKG install-$name
}
