Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit c5a7c16

Browse files
author
ronald
committed
upgpkg: iptables 1.4.14-2
add systemd files; patch for shared build git-svn-id: file:///srv/repos/svn-packages/svn@162146 eb2447ed-0c53-47e4-bac8-5bc4a241df78
1 parent 231ce33 commit c5a7c16

File tree

5 files changed

+73
-10
lines changed

5 files changed

+73
-10
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Index: b/extensions/GNUmakefile.in
2+
===================================================================
3+
--- a/extensions/GNUmakefile.in 2012-03-27 12:14:05.000000000 -0400
4+
+++ b/extensions/GNUmakefile.in 2012-03-27 16:03:48.378790221 -0400
5+
@@ -21,7 +21,7 @@
6+
kinclude_CPPFLAGS = @kinclude_CPPFLAGS@
7+
8+
AM_CFLAGS = ${regular_CFLAGS}
9+
-AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_builddir} -I${top_srcdir}/include ${kinclude_CPPFLAGS}
10+
+AM_CPPFLAGS = ${CPPFLAGS} ${regular_CPPFLAGS} -I${top_builddir}/include -I${top_builddir} -I${top_srcdir}/include ${kinclude_CPPFLAGS}
11+
AM_DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
12+
AM_LDFLAGS = @noundef_LDFLAGS@
13+

trunk/PKGBUILD

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
pkgname=iptables
66
pkgver=1.4.14
7-
pkgrel=1
7+
pkgrel=2
88
pkgdesc='Linux kernel packet control tool'
99
arch=('i686' 'x86_64')
1010
license=('GPL2')
@@ -22,7 +22,11 @@ source=("http://www.iptables.org/projects/iptables/files/${pkgname}-${pkgver}.ta
2222
empty-mangle.rules
2323
empty-nat.rules
2424
empty-raw.rules
25-
empty-security.rules)
25+
empty-security.rules
26+
0503-extension_cppflags.patch
27+
iptables.service
28+
ip6tables.service
29+
iptables-flush)
2630
backup=(etc/conf.d/iptables)
2731
sha1sums=('daf2972b81e52f562a644798013e946c88319ea3'
2832
'5bb6fa526665cdd728c26f0f282f5a51f220cf88'
@@ -34,25 +38,25 @@ sha1sums=('daf2972b81e52f562a644798013e946c88319ea3'
3438
'c45b738b5ec4cfb11611b984c21a83b91a2d58f3'
3539
'1694d79b3e6e9d9d543f6a6e75fed06066c9a6c6'
3640
'7db53bb882f62f6c677cc8559cff83d8bae2ef73'
37-
'ebbd1424a1564fd45f455a81c61ce348f0a14c2e')
41+
'ebbd1424a1564fd45f455a81c61ce348f0a14c2e'
42+
'44626980a52e49f345a0b1e1ca03060f3a35763c'
43+
'5c4eb4ea88c302e8ff98f435a11dd59b00f4d8b9'
44+
'f1f16f44c6a5547b6f251d13007fe6585761e8b0'
45+
'e7abda09c61142121b6695928d3b71ccd8fdf73a')
3846

3947
build() {
4048
cd "${srcdir}/${pkgname}-${pkgver}"
4149

42-
# http://bugs.archlinux.org/task/17046
43-
sed -i '87 i libxt_RATEEST.so: libxt_RATEEST.oo' extensions/GNUmakefile.in
44-
sed -i '88 i \\t${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -lm -shared ${LDFLAGS} -o $@ $<;\n' extensions/GNUmakefile.in
45-
4650
# use system one
4751
rm include/linux/types.h
4852

53+
patch -Np1 -i ${srcdir}/0503-extension_cppflags.patch
54+
4955
./configure --prefix=/usr \
5056
--libexecdir=/usr/lib/iptables --sysconfdir=/etc \
5157
--with-xtlibdir=/usr/lib/iptables \
5258
--enable-devel --enable-libipq \
53-
--enable-shared --enable-static
54-
# build fails when not enabling static, see if we can remove it on next build
55-
# 1.4.13 still fails
59+
--enable-shared
5660

5761
make
5862
}
@@ -71,4 +75,10 @@ package() {
7175

7276
mkdir -p "${pkgdir}"/var/lib/iptables
7377
install -m644 empty-{filter,mangle,nat,raw,security}.rules "${pkgdir}"/var/lib/iptables
78+
79+
# install systemd files
80+
install -Dm644 ${srcdir}/iptables.service ${pkgdir}/usr/lib/systemd/system/iptables.service
81+
install -Dm644 ${srcdir}/ip6tables.service ${pkgdir}/usr/lib/systemd/system/ip6tables.service
82+
install -Dm755 ${srcdir}/iptables-flush ${pkgdir}/usr/lib/systemd/scripts/iptables-flush
7483
}
84+

trunk/ip6tables.service

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=IPv6 Packet Filtering Framework
3+
4+
[Service]
5+
Type=oneshot
6+
ExecStart=/usr/sbin/ip6tables-restore /etc/iptables/ip6tables.rules
7+
ExecStop=/usr/lib/systemd/scripts/iptables-flush 6
8+
RemainAfterExit=yes
9+
10+
[Install]
11+
WantedBy=multi-user.target

trunk/iptables-flush

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
#
3+
# Usage: iptables-flush [6]
4+
#
5+
6+
iptables=ip$1tables
7+
if ! type -p "$iptables"; then
8+
echo "error: invalid argument"
9+
exit 1
10+
fi
11+
12+
while read -r table; do
13+
tables+=("/var/lib/$iptables/empty-$table.rules")
14+
done <"/proc/net/ip$1_tables_names"
15+
16+
if (( ${#tables[*]} )); then
17+
cat "${tables[@]}" | "$iptables-restore"
18+
fi

trunk/iptables.service

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Packet Filtering Framework
3+
4+
[Service]
5+
Type=oneshot
6+
ExecStart=/usr/sbin/iptables-restore /etc/iptables/iptables.rules
7+
ExecStop=/usr/lib/systemd/scripts/iptables-flush
8+
RemainAfterExit=yes
9+
10+
[Install]
11+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)