1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-firewall/iptables/iptables-1.4.12.1-r1.ebuild,v 1.2 2011/12/30 12:01:22 scarabeus Exp $ |
4 |
|
5 |
EAPI="4" |
6 |
|
7 |
# Force users doing their own patches to install their own tools |
8 |
AUTOTOOLS_AUTO_DEPEND=no |
9 |
|
10 |
inherit eutils toolchain-funcs autotools |
11 |
|
12 |
DESCRIPTION="Linux kernel (2.4+) firewall, NAT and packet mangling tools" |
13 |
HOMEPAGE="http://www.iptables.org/" |
14 |
SRC_URI="http://iptables.org/projects/iptables/files/${P}.tar.bz2" |
15 |
|
16 |
LICENSE="GPL-2" |
17 |
SLOT="0" |
18 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
19 |
IUSE="ipv6 netlink static-libs" |
20 |
|
21 |
RDEPEND=" |
22 |
netlink? ( net-libs/libnfnetlink ) |
23 |
" |
24 |
DEPEND="${RDEPEND} |
25 |
virtual/os-headers |
26 |
sys-devel/automake |
27 |
" |
28 |
|
29 |
src_prepare() { |
30 |
epatch \ |
31 |
"${FILESDIR}/iptables-1.4.12.1-lm.patch" \ |
32 |
"${FILESDIR}/iptables-1.4.12.1-conntrack-v2-ranges.patch" |
33 |
eautomake |
34 |
|
35 |
# Only run autotools if user patched something |
36 |
epatch_user && eautoreconf || elibtoolize |
37 |
} |
38 |
|
39 |
src_configure() { |
40 |
sed -i \ |
41 |
-e "/nfnetlink=[01]/s:=[01]:=$(use netlink && echo 1 || echo 0):" \ |
42 |
configure || die |
43 |
econf \ |
44 |
--sbindir=/sbin \ |
45 |
--libexecdir=/$(get_libdir) \ |
46 |
--enable-devel \ |
47 |
--enable-libipq \ |
48 |
--enable-shared \ |
49 |
$(use_enable static-libs static) \ |
50 |
$(use_enable ipv6) |
51 |
} |
52 |
|
53 |
src_compile() { |
54 |
emake V=1 |
55 |
} |
56 |
|
57 |
src_install() { |
58 |
default |
59 |
dodoc INCOMPATIBILITIES iptables/iptables.xslt |
60 |
|
61 |
# all the iptables binaries are in /sbin, so might as well |
62 |
# put these small files in with them |
63 |
into / |
64 |
dosbin iptables/iptables-apply |
65 |
dosym iptables-apply /sbin/ip6tables-apply |
66 |
doman iptables/iptables-apply.8 |
67 |
|
68 |
insinto /usr/include |
69 |
doins include/iptables.h $(use ipv6 && echo include/ip6tables.h) |
70 |
insinto /usr/include/iptables |
71 |
doins include/iptables/internal.h |
72 |
|
73 |
keepdir /var/lib/iptables |
74 |
newinitd "${FILESDIR}"/${PN}-1.4.11.init iptables |
75 |
newconfd "${FILESDIR}"/${PN}-1.3.2.confd iptables |
76 |
if use ipv6 ; then |
77 |
keepdir /var/lib/ip6tables |
78 |
newinitd "${FILESDIR}"/iptables-1.4.11.init ip6tables |
79 |
newconfd "${FILESDIR}"/ip6tables-1.3.2.confd ip6tables |
80 |
fi |
81 |
|
82 |
# Move important libs to /lib |
83 |
gen_usr_ldscript -a ip{4,6}tc ipq iptc xtables |
84 |
find "${ED}" -type f -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed" |
85 |
} |