# Maintainer: PktSurf <smlinux@pktsurf.in>
app=iptables
version=1.8.9
build=1sml
homepage="https://www.netfilter.org/projects/iptables/index.html"
download="https://www.netfilter.org/projects/iptables/files/iptables-$version.tar.bz2"
desc="IP packet filter administration tool"
requires="libpcap libnfnetlink libnetfilter_conntrack"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
}

build() {
  ./configure \
    --prefix="" \
    --sbindir=/bin \
    --disable-nftables

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/
  
  # Fix awkward symlinking
  ( 
    cd $pkg/bin 
    rm iptables-xml
    ln -sf xtables-legacy-multi iptables-xml
  )

  mkfinalpkg
}

sha512sums="
b821e22f08aa398cbb98fe2fe99baa8cefa16f49d9834b43cad28f1884b576f3bd10628eb05b319fe5139e0c500fac4c7f7fd45ebccbdce83c1d28305fc4d607  iptables-1.8.9.tar.lz
"
