From: Jeroen Roovers Date: Sun, 4 Dec 2011 06:43:08 +0000 (+0000) Subject: Restore dependency on dev-libs/libnl:1.1, remove faulty patch (bug #385875, comment... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=fe0c26e45b8154d54a64d94265edee5883cad804;p=gentoo.git Restore dependency on dev-libs/libnl:1.1, remove faulty patch (bug #385875, comment #1). Package-Manager: portage-2.2.0_alpha79/cvs/Linux x86_64 --- diff --git a/net-libs/libpcap/ChangeLog b/net-libs/libpcap/ChangeLog index 3ec4775f598d..3aedc018918b 100644 --- a/net-libs/libpcap/ChangeLog +++ b/net-libs/libpcap/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-libs/libpcap # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/ChangeLog,v 1.152 2011/11/22 19:02:26 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/ChangeLog,v 1.153 2011/12/04 06:43:07 jer Exp $ + + 04 Dec 2011; Jeroen Roovers libpcap-1.1.1-r1.ebuild, + -files/libpcap-1.1.1-libidn2.patch: + Restore dependency on dev-libs/libnl:1.1, remove faulty patch (bug #385875, + comment #1). 22 Nov 2011; Jeroen Roovers libpcap-1.1.1-r1.ebuild: Add IUSE=static-libs thanks to Piotr Karbowski (bug #391375). diff --git a/net-libs/libpcap/Manifest b/net-libs/libpcap/Manifest index 7458c83a9086..978d30704ab3 100644 --- a/net-libs/libpcap/Manifest +++ b/net-libs/libpcap/Manifest @@ -3,16 +3,15 @@ Hash: SHA1 AUX libpcap-1.1-cross-linux.patch 1050 RMD160 ca856c3f295752de47f3d813c324720960ba5fd0 SHA1 7b33a9ec9c65f5e108cbcb3855f0b954cfb75210 SHA256 b1b6375abe00207c4ea69d0e7150eb2ed080eff4b7a1112e69af587f2004474a AUX libpcap-1.1.1-ignore-ENODEV.patch 1363 RMD160 ddbd33d8aa610d9f3653bfaa9bad5c29ae3097ca SHA1 40532cee84b5838c57468e02056b42e2a1721e5a SHA256 1fa73b0ce9552352df0024af5172433fbdd3fb856b6aa53b90ceb8a31fded00c -AUX libpcap-1.1.1-libidn2.patch 8526 RMD160 03e1a6f455d61556a5d4c1b2ea0afe8744548dee SHA1 b74a071d6c032ebabd801c90225daaf03cbea37d SHA256 3ab0c44a84d11353a0d4445a459fbdb8700c2fdb86f6cef8468f619256a63432 DIST libpcap-1.1.1.tar.gz 581984 RMD160 760159c594cc995c9e05c0cd8637a02a3b2725e2 SHA1 18581af5e78a40b7b2c9a6cd8ce40e7cb1cd9c63 SHA256 508cca15547e55d1318498b838456a21770c450beb2dc7d7d4a96d90816e5a85 -EBUILD libpcap-1.1.1-r1.ebuild 1547 RMD160 a4374d1e30810b5db5d61591708d34a142e4582b SHA1 7e60c5a996a5873a63bf1c8a9ec1a5451626c485 SHA256 8b6f2f26003b36f383bd30e667a7ad30ede2fa7c3377032612bbb44abfda1075 +EBUILD libpcap-1.1.1-r1.ebuild 1514 RMD160 cebf42d049777d91d23e775fc6c71cd1b8f179fc SHA1 6965e53ca42648cded4ec099c7b6f3e3b0e23bb8 SHA256 18b6cc2f60f74f60602fae5d55fd8fbaea79646696bbaf12895bee020f2072b1 EBUILD libpcap-1.1.1.ebuild 1599 RMD160 08504e5a914345e82329af0fece2a406347360fa SHA1 989100de9cbe05bff48f1f0e46343f7f6491a314 SHA256 a416ceb0e4429e7ef2363618bc1e383cff88503e7afc9636641688b023871fb7 -MISC ChangeLog 20876 RMD160 cc2742112d07b6114d8a1622d923d550ac928be2 SHA1 12228e86c9de305e70033c6f74cf138bcaceae03 SHA256 ccc88569d9048fcdff84424d40903a75a042845afdf472a19d08c0a944a921df +MISC ChangeLog 21080 RMD160 8fbecadf31f14ae5c3c6f6dc2b955c98bc300a98 SHA1 2efc8b3108d55a08e0c06a934de97f71102c4903 SHA256 df2ca7ccf5a6269c3597a108e0c7f2f83db4c2eb173de1887849aa56f3bc56a8 MISC metadata.xml 388 RMD160 3b1443ce61438e34f2f95c0f5cc30a084d6f0449 SHA1 2a2b22d69ff3531819eb0fb9878bb43ee2ca93fd SHA256 0b03dfcc45267fcf74372c8a6cebe9df940147c62c8c4fb6ef47fc9e34e7dce0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) -iEYEARECAAYFAk7L8c0ACgkQVWmRsqeSphPRJACfWBQb4WGsdVrg6zLLuxk+zDgT -/6QAnRqfLeBNguvApoobhUExKUERD7qZ -=SlLX +iEYEARECAAYFAk7bFoEACgkQVWmRsqeSphNJrgCdGnBpgwzjDZ8sByTxbfGG+TGx +JroAn09+7wDhBi1R6AK450YabLxhmkDw +=46Mo -----END PGP SIGNATURE----- diff --git a/net-libs/libpcap/files/libpcap-1.1.1-libidn2.patch b/net-libs/libpcap/files/libpcap-1.1.1-libidn2.patch deleted file mode 100644 index 04293562dc42..000000000000 --- a/net-libs/libpcap/files/libpcap-1.1.1-libidn2.patch +++ /dev/null @@ -1,329 +0,0 @@ -diff --git a/config.h.in b/config.h.in -index f988e8f..3b9ce3c 100644 ---- a/config.h.in -+++ b/config.h.in -@@ -52,6 +52,9 @@ - /* if libnl exists */ - #undef HAVE_LIBNL - -+/* if libnl exists and is version 2.x */ -+#undef HAVE_LIBNL_2_x -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_LIMITS_H - -diff --git a/configure b/configure -index c99c1ab..7338dee 100755 ---- a/configure -+++ b/configure -@@ -7340,7 +7340,93 @@ fi - - - if test x$with_libnl != xno ; then -- { echo "$as_me:$LINENO: checking for nl_handle_alloc in -lnl" >&5 -+ # -+ # Try libnl 2.x first. -+ # -+ { echo "$as_me:$LINENO: checking for nl_socket_alloc in -lnl" >&5 -+echo $ECHO_N "checking for nl_socket_alloc in -lnl... $ECHO_C" >&6; } -+if test "${ac_cv_lib_nl_nl_socket_alloc+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lnl $LIBS" -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char nl_socket_alloc (); -+int -+main () -+{ -+return nl_socket_alloc (); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (ac_try="$ac_link" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 -+ (eval "$ac_link") 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { -+ test -z "$ac_c_werror_flag" || -+ test ! -s conftest.err -+ } && test -s conftest$ac_exeext && -+ $as_test_x conftest$ac_exeext; then -+ ac_cv_lib_nl_nl_socket_alloc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_cv_lib_nl_nl_socket_alloc=no -+fi -+ -+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ echo "$as_me:$LINENO: result: $ac_cv_lib_nl_nl_socket_alloc" >&5 -+echo "${ECHO_T}$ac_cv_lib_nl_nl_socket_alloc" >&6; } -+if test $ac_cv_lib_nl_nl_socket_alloc = yes; then -+ -+ # -+ # Yes, we have libnl 2.x. -+ # -+ LIBS="-lnl-genl -lnl $LIBS" -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LIBNL 1 -+_ACEOF -+ -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LIBNL_2_x 1 -+_ACEOF -+ -+ -+else -+ -+ # -+ # No, we don't; do we have libnl 1.x? -+ # -+ { echo "$as_me:$LINENO: checking for nl_handle_alloc in -lnl" >&5 - echo $ECHO_N "checking for nl_handle_alloc in -lnl... $ECHO_C" >&6; } - if test "${ac_cv_lib_nl_nl_handle_alloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -@@ -7402,18 +7488,30 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_lib_nl_nl_handle_alloc" >&5 - echo "${ECHO_T}$ac_cv_lib_nl_nl_handle_alloc" >&6; } - if test $ac_cv_lib_nl_nl_handle_alloc = yes; then -- LIBS="-lnl $LIBS" -+ -+ # -+ # Yes. -+ # -+ LIBS="-lnl $LIBS" - - cat >>confdefs.h <<\_ACEOF - #define HAVE_LIBNL 1 - _ACEOF - -+ - else -- if test x$with_libnl = xyes ; then -- { { echo "$as_me:$LINENO: error: libnl support requested but libnl not found" >&5 -+ -+ # -+ # No, we don't have libnl at all. -+ # -+ if test x$with_libnl = xyes ; then -+ { { echo "$as_me:$LINENO: error: libnl support requested but libnl not found" >&5 - echo "$as_me: error: libnl support requested but libnl not found" >&2;} - { (exit 1); exit 1; }; } -- fi -+ fi -+ -+fi -+ - - fi - -diff --git a/configure.in b/configure.in -index 16eadf9..ef801ed 100644 ---- a/configure.in -+++ b/configure.in -@@ -445,13 +445,39 @@ linux) - with_libnl=$withval,,) - - if test x$with_libnl != xno ; then -- AC_CHECK_LIB(nl, nl_handle_alloc, -- LIBS="-lnl $LIBS" -- AC_DEFINE(HAVE_LIBNL,1,[if libnl exists]), -- if test x$with_libnl = xyes ; then -- AC_MSG_ERROR([libnl support requested but libnl not found]) -- fi -- ) -+ # -+ # Try libnl 2.x first. -+ # -+ AC_CHECK_LIB(nl, nl_socket_alloc, -+ [ -+ # -+ # Yes, we have libnl 2.x. -+ # -+ LIBS="-lnl-genl -lnl $LIBS" -+ AC_DEFINE(HAVE_LIBNL,1,[if libnl exists]) -+ AC_DEFINE(HAVE_LIBNL_2_x,1,[if libnl exists and is version 2.x]) -+ ], -+ [ -+ # -+ # No, we don't; do we have libnl 1.x? -+ # -+ AC_CHECK_LIB(nl, nl_handle_alloc, -+ [ -+ # -+ # Yes. -+ # -+ LIBS="-lnl $LIBS" -+ AC_DEFINE(HAVE_LIBNL,1,[if libnl exists]) -+ ], -+ [ -+ # -+ # No, we don't have libnl at all. -+ # -+ if test x$with_libnl = xyes ; then -+ AC_MSG_ERROR([libnl support requested but libnl not found]) -+ fi -+ ]) -+ ]) - fi - - AC_LBL_TPACKET_STATS -diff --git a/pcap-linux.c b/pcap-linux.c -index f8b3f10..deabbc4 100644 ---- a/pcap-linux.c -+++ b/pcap-linux.c -@@ -527,8 +527,37 @@ get_mac80211_phydev(pcap_t *handle, const char *device, char *phydev_path, - return 1; - } - -+#ifndef HAVE_LIBNL_2_x -+/* libnl 2.x compatibility code */ -+ -+#define nl_sock nl_handle -+ -+static inline struct nl_handle * -+nl_socket_alloc(void) -+{ -+ return nl_handle_alloc(); -+} -+ -+static inline void -+nl_socket_free(struct nl_handle *h) -+{ -+ nl_handle_destroy(h); -+} -+ -+static inline int -+__genl_ctrl_alloc_cache(struct nl_handle *h, struct nl_cache **cache) -+{ -+ struct nl_cache *tmp = genl_ctrl_alloc_cache(h); -+ if (!tmp) -+ return -ENOMEM; -+ *cache = tmp; -+ return 0; -+} -+#define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache -+#endif /* !HAVE_LIBNL_2_x */ -+ - struct nl80211_state { -- struct nl_handle *nl_handle; -+ struct nl_sock *nl_sock; - struct nl_cache *nl_cache; - struct genl_family *nl80211; - }; -@@ -536,23 +565,26 @@ struct nl80211_state { - static int - nl80211_init(pcap_t *handle, struct nl80211_state *state, const char *device) - { -- state->nl_handle = nl_handle_alloc(); -- if (!state->nl_handle) { -+ int err; -+ -+ state->nl_sock = nl_socket_alloc(); -+ if (!state->nl_sock) { - snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, - "%s: failed to allocate netlink handle", device); - return PCAP_ERROR; - } - -- if (genl_connect(state->nl_handle)) { -+ if (genl_connect(state->nl_sock)) { - snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, - "%s: failed to connect to generic netlink", device); - goto out_handle_destroy; - } - -- state->nl_cache = genl_ctrl_alloc_cache(state->nl_handle); -- if (!state->nl_cache) { -+ err = genl_ctrl_alloc_cache(state->nl_sock, &state->nl_cache); -+ if (err < 0) { - snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, -- "%s: failed to allocate generic netlink cache", device); -+ "%s: failed to allocate generic netlink cache: %s", -+ device, strerror(-err)); - goto out_handle_destroy; - } - -@@ -568,7 +600,7 @@ nl80211_init(pcap_t *handle, struct nl80211_state *state, const char *device) - out_cache_free: - nl_cache_free(state->nl_cache); - out_handle_destroy: -- nl_handle_destroy(state->nl_handle); -+ nl_socket_free(state->nl_sock); - return PCAP_ERROR; - } - -@@ -577,7 +609,7 @@ nl80211_cleanup(struct nl80211_state *state) - { - genl_family_put(state->nl80211); - nl_cache_free(state->nl_cache); -- nl_handle_destroy(state->nl_handle); -+ nl_socket_free(state->nl_sock); - } - - static int -@@ -605,7 +637,7 @@ add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, - NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, mondevice); - NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, NL80211_IFTYPE_MONITOR); - -- err = nl_send_auto_complete(state->nl_handle, msg); -+ err = nl_send_auto_complete(state->nl_sock, msg); - if (err < 0) { - if (err == -ENFILE) { - /* -@@ -626,7 +658,7 @@ add_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, - return PCAP_ERROR; - } - } -- err = nl_wait_for_ack(state->nl_handle); -+ err = nl_wait_for_ack(state->nl_sock); - if (err < 0) { - if (err == -ENFILE) { - /* -@@ -685,7 +717,7 @@ del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, - 0, NL80211_CMD_DEL_INTERFACE, 0); - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, ifindex); - -- err = nl_send_auto_complete(state->nl_handle, msg); -+ err = nl_send_auto_complete(state->nl_sock, msg); - if (err < 0) { - if (err == -ENFILE) { - /* -@@ -706,7 +738,7 @@ del_mon_if(pcap_t *handle, int sock_fd, struct nl80211_state *state, - return PCAP_ERROR; - } - } -- err = nl_wait_for_ack(state->nl_handle); -+ err = nl_wait_for_ack(state->nl_sock); - if (err < 0) { - if (err == -ENFILE) { - /* diff --git a/net-libs/libpcap/libpcap-1.1.1-r1.ebuild b/net-libs/libpcap/libpcap-1.1.1-r1.ebuild index 5c90f2cf484e..450620b7c3aa 100644 --- a/net-libs/libpcap/libpcap-1.1.1-r1.ebuild +++ b/net-libs/libpcap/libpcap-1.1.1-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/libpcap-1.1.1-r1.ebuild,v 1.6 2011/11/22 19:02:26 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-libs/libpcap/libpcap-1.1.1-r1.ebuild,v 1.7 2011/12/04 06:43:07 jer Exp $ EAPI=4 inherit autotools eutils multilib toolchain-funcs @@ -16,7 +16,7 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~spar IUSE="bluetooth ipv6 libnl static-libs" RDEPEND="bluetooth? ( net-wireless/bluez ) - libnl? ( dev-libs/libnl )" + libnl? ( dev-libs/libnl:1.1 )" DEPEND="${RDEPEND} sys-devel/flex virtual/yacc" @@ -26,8 +26,7 @@ DOCS=( CREDITS CHANGES VERSION TODO README{,.dag,.linux,.macosx,.septel} ) src_prepare() { epatch \ "${FILESDIR}/${PN}-1.1-cross-linux.patch" \ - "${FILESDIR}/${P}-ignore-ENODEV.patch" \ - "${FILESDIR}/${P}-libidn2.patch" + "${FILESDIR}/${P}-ignore-ENODEV.patch" eautoreconf }