Magellan Linux

Contents of /branches/magellan-next/core/iptables/iptables-1.4.12.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9833 - (show annotations) (download)
Thu Jan 12 12:40:35 2012 UTC (12 years, 3 months ago) by niro
File size: 2891 byte(s)
-fixed ip6tables.service installation
1 # $Id$
2
3 PNAME="iptables"
4 PVER="1.4.12.2"
5 PBUILD="r1"
6
7 PCATEGORIE="net-misc"
8
9 DESCRIPTION="iptables is used to create internet firewalls based on stateless and stateful packet filtering."
10 HOMEPAGE="http://www.netfilter.org/"
11
12 DEPEND=""
13 SDEPEND=">= virtual/kernel-headers"
14
15 SRCFILE="${PNAME}-${PVER}.tar.bz2"
16 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
17
18 sminclude mtools mbuild
19
20 # cvs revisions
21 CONFD_REV=1.2
22
23 SRC_URI=(
24 http://www.netfilter.org/projects/${PNAME}/files/${SRCFILE}
25 mirror://${PNAME}/${SRCFILE}
26 mirror://${PNAME}/iptables.sh
27 mirror://${PNAME}/iptables.confd-${CONFD_REV}
28 mirror://${PNAME}/iptables.service
29 )
30
31 # exclude rc versions
32 UP2DATE="updatecmd 'http://www.netfilter.org/projects/${PNAME}/files?C=M;O=A' | grep -v '.*rc.*' | lasttarball"
33
34 src_compile()
35 {
36 cd ${SRCDIR}
37
38 mconfigure \
39 --sbindir=/sbin \
40 --libexecdir=/$(mlibdir) \
41 --without-kernel \
42 --enable-devel \
43 --enable-libipq \
44 --enable-shared \
45 --enable-static \
46 || die
47
48 mmake || die
49 }
50
51 src_install()
52 {
53 cd ${SRCDIR}
54 mmake DESTDIR=${BINDIR} install || die
55
56 # installs headers
57 minstalldir /usr/include/libiptc || die
58 minstalldir /usr/$(mlibdir) || die
59 minstalldir /usr/$(mlibdir)/iptables || die
60 minstallfile include/iptables.h /usr/include || die
61 minstallfile include/ip6tables.h /usr/include || die
62 minstallfile include/iptables/internal.h /usr/include/iptables || die
63 # the makefile seems to handle them now correctly
64 # minstallfile libiptc/libiptc.a /usr/$(mlibdir) || die
65 # minstallfile include/libiptc/\*.h /usr/include/libiptc || die
66
67 # install iptables rc & conf.d for ipv4
68 minstallconf iptables.confd-${CONFD_REV} iptables || die
69 minstalldir /lib/systemd || die
70 minstallexec -s iptables.sh /lib/systemd/magellan-iptables || die
71 minstallunit iptables.service || die
72
73 # now for ipv6; some line needs to be seded
74 minstallconf iptables.confd-${CONFD_REV} ip6tables || die
75 minstallexec -s iptables.sh /lib/systemd/magellan-ip6tables || die
76 minstallunit iptables.service ip6tables.service || die
77
78 # fix iptables-cmds for ipv6
79 sed -i -e "s:^\(SVC_NAME=\).*:\1ip6tables:" \
80 -e "s:^\(IPTABLES=\).*:\1/sbin/ip6tables:" \
81 -e "s:^\(IPTABLES_SAVE=\).*:\1/sbin/ip6tables-save:" \
82 -e "s:^\(IPTABLES_RESTORE=\).*:\1/sbin/ip6tables-restore:" \
83 -e "s:^\(IPTABLES_PROC=\).*:\1/proc/net/ip6_tables_names:" \
84 ${BINDIR}/lib/systemd/magellan-ip6tables || die
85 sed -i -e "s:IPv4:IPv6:g" \
86 -e "s:iptables:ip6tables:g" \
87 ${BINDIR}/lib/systemd/system/ip6tables.service || die
88 sed -i -e "s:iptables:ip6tables:g" \
89 ${BINDIR}/etc/conf.d/ip6tables || die
90
91 # prevents removing of iptables-save default path
92 mkeepdir /var/lib/iptables || die
93 mkeepdir /var/lib/ip6tables || die
94
95 # docs
96 minstalldocs COPYING INCOMPATIBILITIES || die
97 }
98
99 postinstall()
100 {
101 mstartunit iptables.service
102 mstartunit ip6tables.service
103 }
104
105 postremove()
106 {
107 mstopunit iptables.service
108 mstopunit ip6tables.service
109 }