From 54ec78c1c12278557c3db093de805b5fbb35bbe5054894b333ab7dbe7f1d8557 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 25 Oct 2013 14:07:20 +0000 Subject: [PATCH] Accepting request 204792 from home:namtrac:bugfix - Add libnl3.patch to build with libnl3 open openSUSE 13.1+, this fixes bnc#845540 OBS-URL: https://build.opensuse.org/request/show/204792 OBS-URL: https://build.opensuse.org/package/show/network:utilities/netcontrol?expand=0&rev=14 --- libnl3.patch | 50 ++++++++++++++++++++++++++++++++++++++++++++++ netcontrol.changes | 6 ++++++ netcontrol.spec | 18 +++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 libnl3.patch diff --git a/libnl3.patch b/libnl3.patch new file mode 100644 index 0000000..d79830a --- /dev/null +++ b/libnl3.patch @@ -0,0 +1,50 @@ +Index: netcontrol-0.2.8/src/nlutils.c +=================================================================== +--- netcontrol-0.2.8.orig/src/nlutils.c ++++ netcontrol-0.2.8/src/nlutils.c +@@ -55,7 +55,7 @@ nc_netlink_close(nc_netlink_t **nl) + return; + + if((*nl)->handle) +- nl_handle_destroy((*nl)->handle); ++ nl_socket_free((*nl)->handle); + if((*nl)->cb) + nl_cb_put((*nl)->cb); + free(*nl); +@@ -80,7 +80,7 @@ nc_netlink_open() + nc_netlink_close(&nl); + } + +- nl->handle = nl_handle_alloc_cb(nl->cb); ++ nl->handle = nl_socket_alloc_cb(nl->cb); + if(!nl->handle) { + nc_error("Cannot allocate netlink handle: %m"); + nc_netlink_close(&nl); +Index: netcontrol-0.2.8/configure.ac +=================================================================== +--- netcontrol-0.2.8.orig/configure.ac ++++ netcontrol-0.2.8/configure.ac +@@ -36,7 +36,8 @@ if test "X$ax_pthread_ok" = "Xyes" ; the + elif test "X$enable_pthreads" = "Xyes" ; then + AC_MSG_ERROR([unable to detect pthread support]) + fi +-PKG_CHECK_MODULES([LIBNL], [libnl-1]) ++PKG_CHECK_MODULES([LIBNL], [libnl-3.0]) ++PKG_CHECK_MODULES([LIBNL_ROUTE], [libnl-route-3.0]) + + AC_ARG_ENABLE(network-service, + [AS_HELP_STRING([--enable-network-service], +Index: netcontrol-0.2.8/src/Makefile.am +=================================================================== +--- netcontrol-0.2.8.orig/src/Makefile.am ++++ netcontrol-0.2.8/src/Makefile.am +@@ -17,7 +17,8 @@ nctest_DEPENDENCIES = $(nctest_LDADD) + + lib_LTLIBRARIES = libnetcontrol.la + +-libnetcontrol_la_LDFLAGS = $(LIBNL_LIBS) \ ++libnetcontrol_la_CFLAGS = $(LIBNL_CFLAGS) ++libnetcontrol_la_LDFLAGS = $(LIBNL_LIBS) $(LIBNL_ROUTE_LIBS) \ + -Wl,--version-script=$(builddir)/netcontrol.syms \ + -version-info $(LIBNETCONTROL_VERSION_INFO) + libnetcontrol_la_DEPENDENCIES = netcontrol.syms diff --git a/netcontrol.changes b/netcontrol.changes index 11fc443..5f4848e 100644 --- a/netcontrol.changes +++ b/netcontrol.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 25 09:41:22 UTC 2013 - idonmez@suse.com + +- Add libnl3.patch to build with libnl3 open openSUSE 13.1+, this + fixes bnc#845540 + ------------------------------------------------------------------- Tue Mar 26 15:01:02 UTC 2013 - mt@suse.de diff --git a/netcontrol.spec b/netcontrol.spec index bc24f73..a114f21 100644 --- a/netcontrol.spec +++ b/netcontrol.spec @@ -31,12 +31,21 @@ Group: Productivity/Networking/System # Source0: %{name}-%{version}.tar.bz2 Source1: baselibs.conf +# PATCH-FIX-UPSTREAM libnl3.patch -- Fixes bnc#845540 +Patch1: libnl3.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +%if 0%{?suse_version} >= 1310 +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libnl3-devel +BuildRequires: libtool +%else %if 0%{?suse_version} >= 1210 BuildRequires: libnl-1_1-devel %else BuildRequires: libnl-devel %endif +%endif BuildRequires: pkg-config %if 0%{?suse_version} >= 1230 Requires: sysconfig >= 0.80.0 @@ -95,9 +104,18 @@ Authors: %prep %setup -q +%if 0%{?suse_version} >= 1310 +%patch1 -p1 +%endif %build export CFLAGS="-W -Wall $RPM_OPT_FLAGS" + +# patch1 modifies configure.ac +%if 0%{?suse_version} >= 1310 +autoreconf -fi +%endif + %configure \ %if 0%{?suse_version} >= 1230 --enable-network-service \