/[gentoo-x86]/sys-apps/iproute2/iproute2-3.3.0.ebuild
Gentoo

Contents of /sys-apps/iproute2/iproute2-3.3.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue May 22 21:15:07 2012 UTC (12 months ago) by xmw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +8 -5 lines
Finally fix prefix support (bug 414465)

(Portage version: 2.1.10.62/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-3.3.0.ebuild,v 1.8 2012/05/15 18:59:14 jer Exp $
4
5 EAPI="4"
6
7 inherit eutils toolchain-funcs flag-o-matic multilib
8
9 if [[ ${PV} == "9999" ]] ; then
10 EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
11 inherit git-2
12 SRC_URI=""
13 #KEYWORDS=""
14 else
15 SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.bz2"
16 KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
17 fi
18
19 DESCRIPTION="kernel routing and traffic control utilities"
20 HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
21
22 LICENSE="GPL-2"
23 SLOT="0"
24 IUSE="atm berkdb +iptables ipv6 minimal"
25
26 RDEPEND="!net-misc/arpd
27 iptables? ( >=net-firewall/iptables-1.4.5 )
28 !minimal? ( berkdb? ( sys-libs/db ) )
29 atm? ( net-dialup/linux-atm )"
30 DEPEND="${RDEPEND}
31 iptables? ( virtual/pkgconfig )
32 sys-devel/bison
33 sys-devel/flex
34 >=sys-kernel/linux-headers-2.6.27
35 elibc_glibc? ( >=sys-libs/glibc-2.7 )"
36
37 src_prepare() {
38 epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
39 use ipv6 || epatch "${FILESDIR}"/${PN}-3.1.0-no-ipv6.patch #326849
40
41 sed -i \
42 -e '/^CC =/d' \
43 -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
44 -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
45 Makefile || die
46
47 # build against system headers
48 rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
49 sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
50
51 # don't build arpd if USE=-berkdb #81660
52 use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
53
54 use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
55 }
56
57 src_configure() {
58 tc-export AR CC PKG_CONFIG
59
60 # This sure is ugly. Should probably move into toolchain-funcs at some point.
61 local setns
62 pushd "${T}" >/dev/null
63 echo 'main(){return setns();};' > test.c
64 ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
65 echo 'main(){};' > test.c
66 ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
67 popd >/dev/null
68
69 cat <<-EOF > Config
70 TC_CONFIG_ATM := $(usex atm y n)
71 TC_CONFIG_XT := $(usex iptables y n)
72 IP_CONFIG_SETNS := ${setns}
73 # Use correct iptables dir, #144265 #293709
74 IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
75 EOF
76 }
77
78 src_install() {
79 if use minimal ; then
80 into /
81 dosbin tc/tc
82 return 0
83 fi
84
85 emake \
86 DESTDIR="${D}" \
87 LIBDIR="${EPREFIX}"/$(get_libdir) \
88 SBINDIR="${EPREFIX}"/sbin \
89 CONFDIR="${EPREFIX}"/etc/iproute2 \
90 DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
91 MANDIR="${EPREFIX}"/usr/share/man \
92 ARPDDIR="${EPREFIX}"/var/lib/arpd \
93 install
94
95 dolib.a lib/libnetlink.a
96 insinto /usr/include
97 doins include/libnetlink.h
98
99 if use berkdb ; then
100 dodir /var/lib/arpd
101 # bug 47482, arpd doesn't need to be in /sbin
102 dodir /usr/sbin
103 mv "${ED}"/sbin/arpd "${ED}"/usr/sbin/
104 fi
105 }

  ViewVC Help
Powered by ViewVC 1.1.13