Annotation of /branches/magellan-next/core/iptables/iptables-1.4.12.2-r1.smage2
Parent Directory | Revision Log
Revision 9834 -
(hide annotations)
(download)
Thu Jan 12 12:43:03 2012 UTC (12 years, 4 months ago) by niro
File size: 2851 byte(s)
Thu Jan 12 12:43:03 2012 UTC (12 years, 4 months ago) by niro
File size: 2851 byte(s)
-let mage-features handle to build any static libs or not
1 | niro | 9830 | # $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 | || die | ||
45 | |||
46 | mmake || die | ||
47 | } | ||
48 | |||
49 | src_install() | ||
50 | { | ||
51 | cd ${SRCDIR} | ||
52 | mmake DESTDIR=${BINDIR} install || die | ||
53 | |||
54 | # installs headers | ||
55 | minstalldir /usr/include/libiptc || die | ||
56 | minstalldir /usr/$(mlibdir) || die | ||
57 | minstalldir /usr/$(mlibdir)/iptables || die | ||
58 | minstallfile include/iptables.h /usr/include || die | ||
59 | minstallfile include/ip6tables.h /usr/include || die | ||
60 | minstallfile include/iptables/internal.h /usr/include/iptables || die | ||
61 | # the makefile seems to handle them now correctly | ||
62 | # minstallfile libiptc/libiptc.a /usr/$(mlibdir) || die | ||
63 | # minstallfile include/libiptc/\*.h /usr/include/libiptc || die | ||
64 | |||
65 | # install iptables rc & conf.d for ipv4 | ||
66 | minstallconf iptables.confd-${CONFD_REV} iptables || die | ||
67 | minstalldir /lib/systemd || die | ||
68 | niro | 9832 | minstallexec -s iptables.sh /lib/systemd/magellan-iptables || die |
69 | niro | 9830 | minstallunit iptables.service || die |
70 | |||
71 | # now for ipv6; some line needs to be seded | ||
72 | minstallconf iptables.confd-${CONFD_REV} ip6tables || die | ||
73 | niro | 9832 | minstallexec -s iptables.sh /lib/systemd/magellan-ip6tables || die |
74 | niro | 9833 | minstallunit iptables.service ip6tables.service || die |
75 | niro | 9830 | |
76 | # fix iptables-cmds for ipv6 | ||
77 | sed -i -e "s:^\(SVC_NAME=\).*:\1ip6tables:" \ | ||
78 | -e "s:^\(IPTABLES=\).*:\1/sbin/ip6tables:" \ | ||
79 | -e "s:^\(IPTABLES_SAVE=\).*:\1/sbin/ip6tables-save:" \ | ||
80 | -e "s:^\(IPTABLES_RESTORE=\).*:\1/sbin/ip6tables-restore:" \ | ||
81 | -e "s:^\(IPTABLES_PROC=\).*:\1/proc/net/ip6_tables_names:" \ | ||
82 | niro | 9831 | ${BINDIR}/lib/systemd/magellan-ip6tables || die |
83 | niro | 9830 | sed -i -e "s:IPv4:IPv6:g" \ |
84 | -e "s:iptables:ip6tables:g" \ | ||
85 | ${BINDIR}/lib/systemd/system/ip6tables.service || die | ||
86 | sed -i -e "s:iptables:ip6tables:g" \ | ||
87 | ${BINDIR}/etc/conf.d/ip6tables || die | ||
88 | |||
89 | # prevents removing of iptables-save default path | ||
90 | mkeepdir /var/lib/iptables || die | ||
91 | mkeepdir /var/lib/ip6tables || die | ||
92 | |||
93 | # docs | ||
94 | minstalldocs COPYING INCOMPATIBILITIES || die | ||
95 | } | ||
96 | |||
97 | postinstall() | ||
98 | { | ||
99 | mstartunit iptables.service | ||
100 | mstartunit ip6tables.service | ||
101 | } | ||
102 | |||
103 | postremove() | ||
104 | { | ||
105 | mstopunit iptables.service | ||
106 | mstopunit ip6tables.service | ||
107 | } |