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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Fri Jun 1 04:26:02 2012 UTC (2 years, 1 month ago) by zmedico
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -2 lines
inherit multilib for get_libdir

(Portage version: 2.2.0_alpha108_p12/cvs/Linux i686)

1 vapier 1.4 # Copyright 1999-2012 Gentoo Foundation
2 vapier 1.1 # Distributed under the terms of the GNU General Public License v2
3 zmedico 1.6 # $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-3.1.0.ebuild,v 1.5 2012/05/05 05:12:31 vapier Exp $
4 vapier 1.1
5 vapier 1.3 EAPI="4"
6 vapier 1.1
7 zmedico 1.6 inherit eutils multilib toolchain-funcs flag-o-matic
8 vapier 1.1
9 vapier 1.3 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 vapier 1.1 else
15 vapier 1.3 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 vapier 1.1 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 vapier 1.5 IUSE="atm berkdb +iptables ipv6 minimal"
25 vapier 1.1
26     RDEPEND="!net-misc/arpd
27 vapier 1.5 iptables? ( >=net-firewall/iptables-1.4.5 )
28 vapier 1.1 !minimal? ( berkdb? ( sys-libs/db ) )
29     atm? ( net-dialup/linux-atm )"
30     DEPEND="${RDEPEND}
31 vapier 1.5 iptables? ( virtual/pkgconfig )
32 vapier 1.1 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 vapier 1.5 use ipv6 || epatch "${FILESDIR}"/${PN}-3.1.0-no-ipv6.patch #326849
40 vapier 1.1
41     sed -i \
42 vapier 1.4 -e '/^CC =/d' \
43 vapier 1.1 -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    
50     # don't build arpd if USE=-berkdb #81660
51     use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
52    
53     use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
54     }
55    
56     src_configure() {
57     tc-export AR CC PKG_CONFIG
58    
59     # This sure is ugly. Should probably move into toolchain-funcs at some point.
60     local setns
61     pushd "${T}" >/dev/null
62     echo 'main(){return setns();};' > test.c
63     ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
64 vapier 1.5 echo 'main(){};' > test.c
65     ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
66 vapier 1.1 popd >/dev/null
67    
68     cat <<-EOF > Config
69     TC_CONFIG_ATM := $(usex atm y n)
70 vapier 1.5 TC_CONFIG_XT := $(usex iptables y n)
71 vapier 1.1 IP_CONFIG_SETNS := ${setns}
72     # Use correct iptables dir, #144265 #293709
73 vapier 1.5 IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
74 vapier 1.1 EOF
75     }
76    
77     src_install() {
78     if use minimal ; then
79     into /
80     dosbin tc/tc
81     return 0
82     fi
83    
84     emake \
85     DESTDIR="${D}" \
86     SBINDIR=/sbin \
87     DOCDIR=/usr/share/doc/${PF} \
88     MANDIR=/usr/share/man \
89     install
90    
91     dolib.a lib/libnetlink.a
92     insinto /usr/include
93     doins include/libnetlink.h
94    
95     if use berkdb ; then
96     dodir /var/lib/arpd
97     # bug 47482, arpd doesn't need to be in /sbin
98     dodir /usr/sbin
99     mv "${ED}"/sbin/arpd "${ED}"/usr/sbin/
100     fi
101     }

  ViewVC Help
Powered by ViewVC 1.1.20