| 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-2.6.35-r3.ebuild,v 1.4 2012/05/04 09:17:29 jdhore Exp $
|
| 4 |
|
| 5 |
EAPI="2"
|
| 6 |
|
| 7 |
inherit eutils multilib toolchain-funcs flag-o-matic
|
| 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
|
| 12 |
SRC_URI=""
|
| 13 |
#KEYWORDS=""
|
| 14 |
else
|
| 15 |
if [[ ${PV} == *.*.*.* ]] ; then
|
| 16 |
MY_PV=${PV%.*}-${PV##*.}
|
| 17 |
else
|
| 18 |
MY_PV=${PV}
|
| 19 |
fi
|
| 20 |
MY_P="${PN}-${MY_PV}"
|
| 21 |
SRC_URI="http://developer.osdl.org/dev/iproute2/download/${MY_P}.tar.bz2"
|
| 22 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
| 23 |
S=${WORKDIR}/${MY_P}
|
| 24 |
fi
|
| 25 |
|
| 26 |
DESCRIPTION="kernel routing and traffic control utilities"
|
| 27 |
HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
|
| 28 |
|
| 29 |
LICENSE="GPL-2"
|
| 30 |
SLOT="0"
|
| 31 |
IUSE="atm berkdb +iptables ipv6 minimal"
|
| 32 |
|
| 33 |
RDEPEND="!net-misc/arpd
|
| 34 |
iptables? ( >=net-firewall/iptables-1.4.5 )
|
| 35 |
!minimal? ( berkdb? ( sys-libs/db ) )
|
| 36 |
atm? ( net-dialup/linux-atm )"
|
| 37 |
DEPEND="${RDEPEND}
|
| 38 |
iptables? ( virtual/pkgconfig )
|
| 39 |
elibc_glibc? ( >=sys-libs/glibc-2.7 )
|
| 40 |
sys-devel/bison
|
| 41 |
sys-devel/flex
|
| 42 |
>=sys-kernel/linux-headers-2.6.27"
|
| 43 |
|
| 44 |
src_prepare() {
|
| 45 |
sed -i \
|
| 46 |
-e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
|
| 47 |
-e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
|
| 48 |
Makefile || die
|
| 49 |
|
| 50 |
# build against system headers
|
| 51 |
rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
|
| 52 |
|
| 53 |
epatch "${FILESDIR}"/${PN}-2.6.29.1-hfsc.patch #291907
|
| 54 |
epatch "${FILESDIR}"/${P}-cached-routes.patch #331447
|
| 55 |
use ipv6 || epatch "${FILESDIR}"/${PN}-2.6.35-no-ipv6.patch #326849
|
| 56 |
epatch "${FILESDIR}"/${PN}-2.6.35-xtables.patch
|
| 57 |
epatch "${FILESDIR}"/${PN}-2.6.35-no-iptables.patch
|
| 58 |
|
| 59 |
epatch_user
|
| 60 |
|
| 61 |
# don't build arpd if USE=-berkdb #81660
|
| 62 |
use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
|
| 63 |
|
| 64 |
use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
|
| 65 |
}
|
| 66 |
|
| 67 |
use_yn() { use $1 && echo y || echo n ; }
|
| 68 |
src_configure() {
|
| 69 |
cat <<-EOF > Config
|
| 70 |
TC_CONFIG_ATM := $(use_yn atm)
|
| 71 |
TC_CONFIG_XT := $(use_yn iptables)
|
| 72 |
EOF
|
| 73 |
if use iptables ; then
|
| 74 |
# Use correct iptables dir, #144265 #293709
|
| 75 |
append-cppflags -DXT_LIB_DIR=\\\"`$(tc-getPKG_CONFIG) xtables --variable=xtlibdir`\\\"
|
| 76 |
fi
|
| 77 |
}
|
| 78 |
|
| 79 |
src_compile() {
|
| 80 |
emake \
|
| 81 |
CC="$(tc-getCC)" \
|
| 82 |
HOSTCC="$(tc-getBUILD_CC)" \
|
| 83 |
AR="$(tc-getAR)" \
|
| 84 |
|| die
|
| 85 |
}
|
| 86 |
|
| 87 |
src_install() {
|
| 88 |
if use minimal ; then
|
| 89 |
into /
|
| 90 |
dosbin tc/tc || die "minimal"
|
| 91 |
return 0
|
| 92 |
fi
|
| 93 |
|
| 94 |
emake \
|
| 95 |
DESTDIR="${D}" \
|
| 96 |
SBINDIR=/sbin \
|
| 97 |
DOCDIR=/usr/share/doc/${PF} \
|
| 98 |
MANDIR=/usr/share/man \
|
| 99 |
install \
|
| 100 |
|| die
|
| 101 |
prepalldocs
|
| 102 |
|
| 103 |
dolib.a lib/libnetlink.a || die
|
| 104 |
insinto /usr/include
|
| 105 |
doins include/libnetlink.h || die
|
| 106 |
|
| 107 |
if use berkdb ; then
|
| 108 |
dodir /var/lib/arpd
|
| 109 |
# bug 47482, arpd doesn't need to be in /sbin
|
| 110 |
dodir /usr/sbin
|
| 111 |
mv "${D}"/sbin/arpd "${D}"/usr/sbin/
|
| 112 |
fi
|
| 113 |
}
|