changeset 181:9ae9da1e3854

network/iproute2: initial import, closes #1146
author David Demelier <markand@malikania.fr>
date Sat, 16 Mar 2019 10:28:48 +0100
parents dbcde33dd783
children 65dc2d69d393
files network/iproute2/iproute2.sh network/iproute2/musl.patch
diffstat 2 files changed, 90 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/network/iproute2/iproute2.sh	Sat Mar 16 10:28:48 2019 +0100
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+PKGNAME=iproute2
+PKGVERSION=4.20.0
+PKGREVISION=1
+PKGLICENSE="GPL2"
+PKGSUMMARY="IP routing utilities"
+PKGDOWNLOAD="https://www.kernel.org/pub/linux/utils/net/$PKGNAME/$PKGNAME-$PKGVERSION.tar.xz"
+PKGDEPENDS="core/elfutils"
+PKGOPTIONS="CAP MNL"
+
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CTARGET:=$(uname -m)-linux-musl}
+: ${CC:=gcc}
+: ${CFLAGS:=-O2 -DHAVE_SETNS -DHAVE_ELF -DNEED_STRLCPY}
+: ${LIBS:=-lelf}
+: ${CAP:=yes}
+: ${MNL:=yes}
+
+if [ "$CAP" = "yes" ]; then
+	PKGDEPENDS="core/libcap $PKGDEPENDS"
+	CFLAGS="-DHAVE_LIBCAP $CFLAGS"
+	LIBS="-lcap $LIBS"
+fi
+
+if [ "$MNL" = "yes" ]; then
+	PKGDEPENDS="lib/libmnl $PKGDEPENDS"
+	CFLAGS="-DHAVE_LIBMNL $CFLAGS"
+	LIBS="-lmnl $LIBS"
+fi
+
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvaf $PKGNAME-$PKGVERSION.tar.xz
+	pushd $PKGNAME-$PKGVERSION
+
+	# custom configure script is not customizable.
+	echo CC="$CC" > config.mk
+	echo CFLAGS+="$CFLAGS" >> config.mk
+	echo PKG_CONFIG="pkgconf" >> config.mk
+	echo IP_CONFIG_SETNS=y >> config.mk
+	echo LDLIBS+="$LIBS" >> config.mk
+	echo TC_CONFIG_NO_XT=y >> config.mk
+
+	if [ "$CAP" = "yes" ]; then
+		echo HAVE_CAP=y >> config.mk
+	fi
+	if [ "$MNL" = "yes" ]; then
+		echo HAVE_MNL=y >> config.mk
+	fi
+
+	patch -p0 < ../musl.patch
+	make CC="$CC"
+	make SBINDIR=/usr/sbin DESTDIR=$DESTDIR install
+
+	popd
+	rm -rf $PKGNAME-$PKGVERSION
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/network/iproute2/musl.patch	Sat Mar 16 10:28:48 2019 +0100
@@ -0,0 +1,15 @@
+Upstream: No
+Reason: FTBFS
+
+diff --git tc/f_flower.c tc/f_flower.c
+index 65fca04..5043907 100644
+--- tc/f_flower.c
++++ tc/f_flower.c
+@@ -19,6 +19,7 @@
+ #include <linux/ip.h>
+ #include <linux/tc_act/tc_vlan.h>
+ #include <linux/mpls.h>
++#include <linux/limits.h>
+ 
+ #include "utils.h"
+ #include "tc_util.h"