diff options
author | Jeroen Roovers <jer@gentoo.org> | 2016-08-08 15:09:23 +0200 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2016-08-08 15:10:01 +0200 |
commit | 3dadd237dced7b2750ddcebf7921a1011170e5f0 (patch) | |
tree | 36660152e9b542d8afab0f7b3539a07dd439d8bd /net-libs/libnet | |
parent | dev-go/ed25519: Fix version number. (diff) | |
download | gentoo-3dadd237dced7b2750ddcebf7921a1011170e5f0.tar.gz gentoo-3dadd237dced7b2750ddcebf7921a1011170e5f0.tar.bz2 gentoo-3dadd237dced7b2750ddcebf7921a1011170e5f0.zip |
net-libs/libnet: Fix building against sys-libs/musl by Petr Vaněk (bug #590738).
Package-Manager: portage-2.3.0
Diffstat (limited to 'net-libs/libnet')
-rw-r--r-- | net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch | 20 | ||||
-rw-r--r-- | net-libs/libnet/files/libnet-1.1.6-musl.patch | 29 | ||||
-rw-r--r-- | net-libs/libnet/files/libnet-1.2-_SOURCE.patch | 20 | ||||
-rw-r--r-- | net-libs/libnet/files/libnet-1.2-sizeof.patch | 11 | ||||
-rw-r--r-- | net-libs/libnet/files/libnet-1.2-socklen_t.patch | 11 | ||||
-rw-r--r-- | net-libs/libnet/libnet-1.1.6-r1.ebuild | 51 | ||||
-rw-r--r-- | net-libs/libnet/libnet-1.2_rc3-r1.ebuild | 51 |
7 files changed, 193 insertions, 0 deletions
diff --git a/net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch b/net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch new file mode 100644 index 000000000000..25ddbc7b1104 --- /dev/null +++ b/net-libs/libnet/files/libnet-1.1.6-_SOURCE.patch @@ -0,0 +1,20 @@ +--- a/configure.in ++++ b/configure.in +@@ -157,14 +157,14 @@ + case "$target_os" in + + *linux*) +- AC_DEFINE(_BSD_SOURCE, 1, ++ AC_DEFINE(_DEFAULT_SOURCE, 1, + [Define as necessary to "unhide" header symbols.]) +- AC_DEFINE(__BSD_SOURCE, 1, ++ AC_DEFINE(__DEFAULT_SOURCE, 1, + [Define as necessary to "unhide" header symbols.]) + AC_DEFINE(__FAVOR_BSD, 1, + [Define if we should favor the BSD APIs when possible in Linux.]) + +- LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD" ++ LIBNET_CONFIG_DEFINES="-D_DEFAULT_SOURCE -D__DEFAULT_SOURCE -D__FAVOR_BSD" + AC_CHECK_HEADERS(net/ethernet.h, \ + LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H") + ;; diff --git a/net-libs/libnet/files/libnet-1.1.6-musl.patch b/net-libs/libnet/files/libnet-1.1.6-musl.patch new file mode 100644 index 000000000000..238fb8acbef1 --- /dev/null +++ b/net-libs/libnet/files/libnet-1.1.6-musl.patch @@ -0,0 +1,29 @@ +--- a/src/libnet_link_linux.c ++++ b/src/libnet_link_linux.c +@@ -30,26 +30,15 @@ + #include <sys/time.h> + + #include <net/if.h> +-#if (__GLIBC__) + #include <netinet/if_ether.h> + #include <net/if_arp.h> +-#else +-#include <linux/if_arp.h> +-#include <linux/if_ether.h> +-#endif + + #if (HAVE_PACKET_SOCKET) + #ifndef SOL_PACKET + #define SOL_PACKET 263 + #endif /* SOL_PACKET */ +-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1 + #include <netpacket/packet.h> + #include <net/ethernet.h> /* the L2 protocols */ +-#else +-#include <asm/types.h> +-#include <linux/if_packet.h> +-#include <linux/if_ether.h> /* The L2 protocols */ +-#endif + #endif /* HAVE_PACKET_SOCKET */ + + #include "../include/libnet.h" diff --git a/net-libs/libnet/files/libnet-1.2-_SOURCE.patch b/net-libs/libnet/files/libnet-1.2-_SOURCE.patch new file mode 100644 index 000000000000..d9c74f40e300 --- /dev/null +++ b/net-libs/libnet/files/libnet-1.2-_SOURCE.patch @@ -0,0 +1,20 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -157,14 +157,14 @@ + case "$target_os" in + + *linux*) +- AC_DEFINE(_BSD_SOURCE, 1, ++ AC_DEFINE(_DEFAULT_SOURCE, 1, + [Define as necessary to "unhide" header symbols.]) +- AC_DEFINE(__BSD_SOURCE, 1, ++ AC_DEFINE(__DEFAULT_SOURCE, 1, + [Define as necessary to "unhide" header symbols.]) + AC_DEFINE(__FAVOR_BSD, 1, + [Define if we should favor the BSD APIs when possible in Linux.]) + +- LIBNET_CONFIG_DEFINES="-D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD" ++ LIBNET_CONFIG_DEFINES="-D_DEFAULT_SOURCE -D__DEFAULT_SOURCE -D__FAVOR_BSD" + AC_CHECK_HEADERS(net/ethernet.h, \ + LIBNET_CONFIG_DEFINES="$LIBNET_CONFIG_DEFINES -DHAVE_NET_ETHERNET_H") + ;; diff --git a/net-libs/libnet/files/libnet-1.2-sizeof.patch b/net-libs/libnet/files/libnet-1.2-sizeof.patch new file mode 100644 index 000000000000..e06dbb5bd704 --- /dev/null +++ b/net-libs/libnet/files/libnet-1.2-sizeof.patch @@ -0,0 +1,11 @@ +--- a/sample/sebek.c ++++ b/sample/sebek.c +@@ -167,7 +167,7 @@ + + if (payload_flag) + { +- memset(cmd, 0, sizeof(cmd)); ++ memset(cmd, 0, sizeof(*cmd)); + memcpy(cmd, payload, (payload_s < 12 ? payload_s : 12)); + length = payload_s; + } diff --git a/net-libs/libnet/files/libnet-1.2-socklen_t.patch b/net-libs/libnet/files/libnet-1.2-socklen_t.patch new file mode 100644 index 000000000000..bce36704477f --- /dev/null +++ b/net-libs/libnet/files/libnet-1.2-socklen_t.patch @@ -0,0 +1,11 @@ +--- a/src/libnet_raw.c ++++ b/src/libnet_raw.c +@@ -77,7 +77,7 @@ + #else + BOOL n; + #endif +- int len; ++ socklen_t len; + + #ifdef SO_SNDBUF + diff --git a/net-libs/libnet/libnet-1.1.6-r1.ebuild b/net-libs/libnet/libnet-1.1.6-r1.ebuild new file mode 100644 index 000000000000..0144fd40e3e6 --- /dev/null +++ b/net-libs/libnet/libnet-1.1.6-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 +inherit autotools eutils + +DESCRIPTION="library providing an API for commonly used low-level network functions" +HOMEPAGE="http://libnet-dev.sourceforge.net/" +SRC_URI="mirror://sourceforge/project/${PN}-dev/${P}.tar.gz" + +LICENSE="BSD BSD-2 HPND" +SLOT="1.1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc static-libs" + +DEPEND="sys-devel/autoconf" + +DOCS=( + README doc/{CHANGELOG,CONTRIB,DESIGN_NOTES,MIGRATION} + doc/{PACKET_BUILDING,PORTED,RAWSOCKET_NON_SEQUITUR,TODO} +) +PATCHES=( + "${FILESDIR}"/${PN}-1.1.6-_SOURCE.patch + "${FILESDIR}"/${PN}-1.1.6-musl.patch + "${FILESDIR}"/${PN}-1.2-sizeof.patch +) + +src_prepare() { + default + + mv configure{.in,.ac} || die + eautoreconf +} + +src_configure() { + econf $(use_enable static-libs static) +} + +src_install() { + default + + if use doc ; then + dodoc -r doc/html + + docinto sample + dodoc sample/*.[ch] + fi + + prune_libtool_files +} diff --git a/net-libs/libnet/libnet-1.2_rc3-r1.ebuild b/net-libs/libnet/libnet-1.2_rc3-r1.ebuild new file mode 100644 index 000000000000..305d02dcf5d5 --- /dev/null +++ b/net-libs/libnet/libnet-1.2_rc3-r1.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 +inherit autotools eutils + +DESCRIPTION="library providing an API for commonly used low-level network functions" +HOMEPAGE="http://libnet-dev.sourceforge.net/" +SRC_URI="mirror://sourceforge/project/${PN}-dev/${P/_/-}.tar.gz" + +LICENSE="BSD BSD-2 HPND" +SLOT="1.1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="doc static-libs" + +DOCS=( + README doc/{CHANGELOG,CONTRIB,DESIGN_NOTES,MIGRATION} + doc/{PACKET_BUILDING,PORTED,RAWSOCKET_NON_SEQUITUR,TODO} +) + +S=${WORKDIR}/${P/_/-} +PATCHES=( + "${FILESDIR}"/${PN}-1.1.6-musl.patch + "${FILESDIR}"/${PN}-1.2-_SOURCE.patch + "${FILESDIR}"/${PN}-1.2-rc.patch + "${FILESDIR}"/${PN}-1.2-sizeof.patch + "${FILESDIR}"/${PN}-1.2-socklen_t.patch +) + +src_prepare() { + default + + eautoreconf +} +src_configure() { + econf $(use_enable static-libs static) +} + +src_install() { + default + + if use doc ; then + docinto html + dodoc -r doc/html/* + docinto sample + dodoc sample/*.[ch] + fi + + prune_libtool_files +} |