PKGBUILD 2.68 KB
Newer Older
philm's avatar
philm committed
1 2 3 4
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
Jan Mette's avatar
Jan Mette committed
5 6

pkgname=iptables
manu tortosa's avatar
manu tortosa committed
7 8 9 10
pkgver=1.4.18
pkgrel=1
pkgdesc='Linux kernel packet control tool'
arch=('x86_64')
Jan Mette's avatar
Jan Mette committed
11
license=('GPL2')
manu tortosa's avatar
manu tortosa committed
12
url='http://www.netfilter.org/projects/iptables/index.html'
Jan Mette's avatar
Jan Mette committed
13
depends=('glibc' 'bash')
manu tortosa's avatar
manu tortosa committed
14
makedepends=('linux-api-headers' 'chrpath')
Jan Mette's avatar
Jan Mette committed
15
options=('!libtool')
manu tortosa's avatar
manu tortosa committed
16
source=("http://www.netfilter.org/projects/iptables/files/${pkgname}-${pkgver}.tar.bz2"
philm's avatar
philm committed
17 18
        empty.rules
        simple_firewall.rules
manu tortosa's avatar
manu tortosa committed
19 20 21 22 23 24 25 26 27 28
        empty-filter.rules
        empty-mangle.rules
        empty-nat.rules
        empty-raw.rules
        empty-security.rules
        0503-extension_cppflags.patch
        iptables.service
        ip6tables.service
        iptables-flush)
sha1sums=('34bf627c8755a61caf3635a998d2a5279f664f9e'
philm's avatar
philm committed
29
          '83b3363878e3660ce23b2ad325b53cbd6c796ecf'
manu tortosa's avatar
manu tortosa committed
30 31 32 33 34 35
          'f085a71f467e4d7cb2cf094d9369b0bcc4bab6ec'
          'd9f9f06b46b4187648e860afa0552335aafe3ce4'
          'c45b738b5ec4cfb11611b984c21a83b91a2d58f3'
          '1694d79b3e6e9d9d543f6a6e75fed06066c9a6c6'
          '7db53bb882f62f6c677cc8559cff83d8bae2ef73'
          'ebbd1424a1564fd45f455a81c61ce348f0a14c2e'
Manuel's avatar
Manuel committed
36
          '9434783cdb968f205b272fbe531b36204a322b65'
manu tortosa's avatar
manu tortosa committed
37 38 39
          '9306cba67dbeaa004af084a816f66920a6a10faf'
          '38fa2ffe7965e63b494d333f69193029c1258c28'
          'e7abda09c61142121b6695928d3b71ccd8fdf73a')
Jan Mette's avatar
Jan Mette committed
40 41

build() {
manu tortosa's avatar
manu tortosa committed
42
  cd "${srcdir}/${pkgname}-${pkgver}"
Jan Mette's avatar
Jan Mette committed
43

manu tortosa's avatar
manu tortosa committed
44 45
  # use system one
  rm include/linux/types.h
Jan Mette's avatar
Jan Mette committed
46

manu tortosa's avatar
manu tortosa committed
47
  patch -Np1 -i ${srcdir}/0503-extension_cppflags.patch
Jan Mette's avatar
Jan Mette committed
48

manu tortosa's avatar
manu tortosa committed
49 50 51 52 53
 ./configure --prefix=/usr \
     --libexecdir=/usr/lib/iptables --sysconfdir=/etc \
     --with-xtlibdir=/usr/lib/iptables \
     --enable-devel --enable-shared \
     --sbindir=/usr/bin
philm's avatar
philm committed
54
  make
philm's avatar
philm committed
55 56 57
}

package() {
manu tortosa's avatar
manu tortosa committed
58
  cd "${srcdir}/${pkgname}-${pkgver}"
philm's avatar
philm committed
59

manu tortosa's avatar
manu tortosa committed
60
  make DESTDIR="${pkgdir}" install
philm's avatar
philm committed
61

manu tortosa's avatar
manu tortosa committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
  # Remove RPATH from iptables libraries
  # http://www.spinics.net/lists/netfilter-devel/msg24969.html
  chrpath --delete "${pkgdir}"/usr/lib/iptables/*.so

  cd "${srcdir}"
  install -D -m644 empty.rules "${pkgdir}"/etc/iptables/empty.rules
  install -D -m644 simple_firewall.rules "${pkgdir}"/etc/iptables/simple_firewall.rules

  mkdir -p "${pkgdir}"/var/lib/{iptables,ip6tables}
  install -m644 empty-{filter,mangle,nat,raw,security}.rules "${pkgdir}"/var/lib/iptables
  install -m644 empty-{filter,mangle,nat,raw,security}.rules "${pkgdir}"/var/lib/ip6tables

  # install systemd files
  install -Dm644 ${srcdir}/iptables.service ${pkgdir}/usr/lib/systemd/system/iptables.service
  install -Dm644 ${srcdir}/ip6tables.service ${pkgdir}/usr/lib/systemd/system/ip6tables.service
  install -Dm755 ${srcdir}/iptables-flush ${pkgdir}/usr/lib/systemd/scripts/iptables-flush  
}