Package: powertop
Version: 1.97-2
Severity: wishlist
Tags: patch

Hi,

with more and more applications switching from libnl1 and libnl2 to
libnl3 (most notably network-manager and wpasupplicant), it would be
great if powertop could switch to the latest version of libnl as well.
It is currently the only application on my system which is pulling in
libnl2 as dependency.

With the attached patch I could successfully build powertop against
libnl3 3.2. I've done some basic tests and it seems to work fine, but of
course I'd appreciate further review.

Cheers,
Michael

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages powertop depends on:
ii  libc6             2.13-24
ii  libgcc1           1:4.6.2-11
ii  libncursesw5      5.9-4
ii  libnl-3-200       3.2.3-2
ii  libnl-genl-3-200  3.2.3-2
ii  libpci3           1:3.1.8-2
ii  libstdc++6        4.6.2-11
ii  libtinfo5         5.9-4
ii  zlib1g            1:1.2.3.4.dfsg-3

powertop recommends no packages.

Versions of packages powertop suggests:
pn  cpufrequtils       007-2
pn  laptop-mode-tools  <none>

-- no debconf information
diff -Nru powertop-1.97/debian/control powertop-1.97/debian/control
--- powertop-1.97/debian/control	2011-03-17 16:25:01.000000000 +0100
+++ powertop-1.97/debian/control	2012-01-19 09:11:25.000000000 +0100
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Patrick Winnertz <win...@debian.org>
 Uploaders: Jose Luis Rivas <ghostba...@gmail.com>
-Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, libncurses5-dev, libnl2-dev, pkg-config, libpci-dev
+Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, libncurses5-dev, libnl-3-dev, libnl-genl-3-dev, pkg-config, libpci-dev
 Standards-Version: 3.9.1
 Homepage: http://www.linuxpowertop.org
 
diff -Nru powertop-1.97/debian/patches/libnl3.patch powertop-1.97/debian/patches/libnl3.patch
--- powertop-1.97/debian/patches/libnl3.patch	1970-01-01 01:00:00.000000000 +0100
+++ powertop-1.97/debian/patches/libnl3.patch	2012-01-19 09:12:35.000000000 +0100
@@ -0,0 +1,24 @@
+diff --git a/Makefile b/Makefile
+index 0382fea..60f23d7 100644
+--- a/Makefile
++++ b/Makefile
+@@ -24,6 +24,7 @@ OBJS += tuning/cpufreq.o tuning/ethernet.o tuning/iw.o tuning/wifi.o
+ 
+ NL1FOUND := $(shell $(PKG_CONFIG) --atleast-version=1 libnl-1 && echo Y)
+ NL2FOUND := $(shell $(PKG_CONFIG) --atleast-version=2 libnl-2.0 && echo Y)
++NL3FOUND := $(shell $(PKG_CONFIG) --atleast-version=3.2 libnl-3.0 && echo Y)
+ 
+ ifeq ($(NL1FOUND),Y)
+ NLLIBNAME = libnl-1
+@@ -35,6 +36,11 @@ LIBS += -lnl-genl
+ NLLIBNAME = libnl-2.0
+ endif
+ 
++ifeq ($(NL3FOUND),Y)
++CFLAGS += -DCONFIG_LIBNL20
++NLLIBNAME = libnl-3.0 libnl-genl-3.0
++endif
++
+ ifeq ($(NLLIBNAME),)
+ $(error Cannot find development files for any supported version of libnl)
+ endif
diff -Nru powertop-1.97/debian/patches/series powertop-1.97/debian/patches/series
--- powertop-1.97/debian/patches/series	2011-03-17 16:25:01.000000000 +0100
+++ powertop-1.97/debian/patches/series	2012-01-19 09:12:39.000000000 +0100
@@ -1,3 +1,4 @@
 fix_prefix_in_manpage.patch
 fix_NR_perf_event_open_on_ia64.patch
 fix_csstoh_on_sparc
+libnl3.patch

Reply via email to