[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 1/1] Build tools from power/cpupower



From: Mattia Dongili <malattia@linux.it>

They'll eventually replace cpufrequtils and libcpufreq{0,-dev} so the
structure of the packages is the same.
---
 debian/build/tools/Makefile                |  1 +
 debian/build/tools/power/cpupower/Makefile | 27 ++++++++++++++++++
 debian/changelog                           |  2 ++
 debian/libcpupower-dev.install             |  2 ++
 debian/libcpupower0.install                |  1 +
 debian/libcpupower0.symbols                | 44 ++++++++++++++++++++++++++++++
 debian/linux-cpupower.install              |  3 ++
 debian/rules.real                          | 23 +++++++++++++++-
 debian/templates/control.main.in           | 29 ++++++++++++++++++++
 debian/templates/control.source.in         |  2 +-
 10 files changed, 132 insertions(+), 2 deletions(-)
 create mode 100644 debian/build/tools/power/cpupower/Makefile
 create mode 100644 debian/libcpupower-dev.install
 create mode 100644 debian/libcpupower0.install
 create mode 100644 debian/libcpupower0.symbols
 create mode 100644 debian/linux-cpupower.install

diff --git a/debian/build/tools/Makefile b/debian/build/tools/Makefile
index a3cdd87..1ea9cf3 100644
--- a/debian/build/tools/Makefile
+++ b/debian/build/tools/Makefile
@@ -2,6 +2,7 @@ SUBDIRS = \
 	hv \
 	lib/lockdep \
 	perf \
+	power/cpupower \
 	usb/usbip
 
 include ../Makefile.inc
diff --git a/debian/build/tools/power/cpupower/Makefile b/debian/build/tools/power/cpupower/Makefile
new file mode 100644
index 0000000..b757d29
--- /dev/null
+++ b/debian/build/tools/power/cpupower/Makefile
@@ -0,0 +1,27 @@
+OUTDIR = tools/power/cpupower
+prefix = /usr/sbin
+
+include ../../../Makefile.inc
+
+DEBUG = false
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	DEBUG=true
+endif
+
+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	# this actually also disables removes -O2 in favour of -O1
+	# but it's as close as we can get to honouring nostrip.
+	DEBUG=true
+endif
+
+all:
+	mkdir out
+	$(MAKE) -C $(top_srcdir)/tools/power/cpupower -f Makefile O=$(CURDIR)/out DEBUG=$(DEBUG)
+
+install:
+	$(MAKE) -C $(top_srcdir)/tools/power/cpupower -f Makefile O=$(CURDIR)/out install mandir=/usr/share/man DESTDIR=$(DESTDIR)
+
+clean:
+	mkdir -p out
+	$(MAKE) -C $(top_srcdir)/tools/power/cpupower -f Makefile O=$(CURDIR)/out clean
+	rm -rf out
diff --git a/debian/changelog b/debian/changelog
index 6132e47..65f559f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ linux-tools (4.5~rc4-1~exp1) UNRELEASED; urgency=medium
 
   [ Ben Hutchings ]
   * lockdep: Add missing macros
+  [ Mattia Dongili ]
+  * Build linux-cpupower.
 
  -- Ben Hutchings <ben@decadent.org.uk>  Thu, 18 Feb 2016 03:19:14 +0000
 
diff --git a/debian/libcpupower-dev.install b/debian/libcpupower-dev.install
new file mode 100644
index 0000000..b341905
--- /dev/null
+++ b/debian/libcpupower-dev.install
@@ -0,0 +1,2 @@
+usr/include/*
+usr/lib/lib*.so
diff --git a/debian/libcpupower0.install b/debian/libcpupower0.install
new file mode 100644
index 0000000..d0dbfd1
--- /dev/null
+++ b/debian/libcpupower0.install
@@ -0,0 +1 @@
+usr/lib/lib*.so.*
diff --git a/debian/libcpupower0.symbols b/debian/libcpupower0.symbols
new file mode 100644
index 0000000..a356760
--- /dev/null
+++ b/debian/libcpupower0.symbols
@@ -0,0 +1,44 @@
+libcpupower.so.0 libcpupower0 #MINVER#
+ cpufreq_cpu_exists@Base 4.4
+ cpufreq_get_affected_cpus@Base 4.4
+ cpufreq_get_available_frequencies@Base 4.4
+ cpufreq_get_available_governors@Base 4.4
+ cpufreq_get_driver@Base 4.4
+ cpufreq_get_freq_hardware@Base 4.4
+ cpufreq_get_freq_kernel@Base 4.4
+ cpufreq_get_hardware_limits@Base 4.4
+ cpufreq_get_policy@Base 4.4
+ cpufreq_get_related_cpus@Base 4.4
+ cpufreq_get_stats@Base 4.4
+ cpufreq_get_transition_latency@Base 4.4
+ cpufreq_get_transitions@Base 4.4
+ cpufreq_modify_policy_governor@Base 4.4
+ cpufreq_modify_policy_max@Base 4.4
+ cpufreq_modify_policy_min@Base 4.4
+ cpufreq_put_affected_cpus@Base 4.4
+ cpufreq_put_available_frequencies@Base 4.4
+ cpufreq_put_available_governors@Base 4.4
+ cpufreq_put_driver@Base 4.4
+ cpufreq_put_policy@Base 4.4
+ cpufreq_put_related_cpus@Base 4.4
+ cpufreq_put_stats@Base 4.4
+ cpufreq_set_frequency@Base 4.4
+ cpufreq_set_policy@Base 4.4
+ sysfs_cpu_exists@Base 4.4
+ sysfs_get_available_frequencies@Base 4.4
+ sysfs_get_freq_affected_cpus@Base 4.4
+ sysfs_get_freq_available_governors@Base 4.4
+ sysfs_get_freq_driver@Base 4.4
+ sysfs_get_freq_hardware@Base 4.4
+ sysfs_get_freq_hardware_limits@Base 4.4
+ sysfs_get_freq_kernel@Base 4.4
+ sysfs_get_freq_policy@Base 4.4
+ sysfs_get_freq_related_cpus@Base 4.4
+ sysfs_get_freq_stats@Base 4.4
+ sysfs_get_freq_transition_latency@Base 4.4
+ sysfs_get_freq_transitions@Base 4.4
+ sysfs_modify_freq_policy_governor@Base 4.4
+ sysfs_modify_freq_policy_max@Base 4.4
+ sysfs_modify_freq_policy_min@Base 4.4
+ sysfs_set_freq_policy@Base 4.4
+ sysfs_set_frequency@Base 4.4
diff --git a/debian/linux-cpupower.install b/debian/linux-cpupower.install
new file mode 100644
index 0000000..e79f8d1
--- /dev/null
+++ b/debian/linux-cpupower.install
@@ -0,0 +1,3 @@
+usr/bin
+usr/sbin
+usr/share/
diff --git a/debian/rules.real b/debian/rules.real
index 1eb2cf8..7167422 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -3,7 +3,7 @@ export KBUILD_BUILD_TIMESTAMP := $(shell dpkg-parsechangelog | sed -ne 's,^Date:
 
 include debian/rules.defs
 
-binary-arch: install-kbuild install-usbip install-liblockdep
+binary-arch: install-kbuild install-usbip install-liblockdep install-cpupower
 ifneq ($(filter alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64,$(DEB_BUILD_ARCH)),)
   binary-arch: install-perf
 endif
@@ -43,6 +43,27 @@ install-kbuild: $(STAMPS_DIR)/build
 	dh_md5sums
 	dh_builddeb
 
+
+install-cpupower: DH_OPTIONS = -plinux-cpupower -plibcpupower0 -plibcpupower-dev
+install-cpupower: DIR = $(CURDIR)/debian/cpupower-tmp
+install-cpupower: $(STAMPS_DIR)/build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	$(MAKE) -C $(BUILD_DIR)/tools/power/cpupower install top_srcdir=$(CURDIR) DESTDIR=$(DIR)
+	dh_install --sourcedir=$(DIR)
+	dh_installchangelogs
+	dh_installdocs
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
 install-perf: PACKAGE_NAME = linux-perf-$(VERSION)
 install-perf: DH_OPTIONS = -p$(PACKAGE_NAME)
 install-perf: DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
diff --git a/debian/templates/control.main.in b/debian/templates/control.main.in
index 6106752..d90d775 100644
--- a/debian/templates/control.main.in
+++ b/debian/templates/control.main.in
@@ -5,6 +5,35 @@ Multi-Arch: foreign
 Description: Kbuild infrastructure for Linux @version@
  This package provides the kbuild infrastructure for the headers packages for Linux kernel version @version@.
 
+Package: linux-cpupower
+Section: admin
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: CPU frequency and voltage scaling tools for Linux
+ This package contains the 'power/cpupower' tools for Linux.
+ .
+ This set of userspace tools allow inspection and control of cpufreq and
+ cpuidle tunables for hardware that support these features.
+ The "cpupower" command replaces "cpufreq-info" and "cpufreq-set" in
+ cpufrequtils.
+
+Package: libcpupower0
+Section: libs
+Architecture: linux-any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: CPU frequency and voltage scaling tools for Linux (libraries)
+ This package contains the shared library.
+
+Package: libcpupower-dev
+Section: libdevel
+Architecture: linux-any
+Depends: ${shlibs:Depends}
+Provides: libcpufreq-dev
+Conflicts: libcpufreq-dev
+Replaces: libcpufreq-dev
+Description: CPU frequency and voltage scaling tools for Linux (development files)
+ This package contains the 'power/cpupower' headers and library shared objects.
+
 Package: linux-perf-@version@
 Section: devel
 Architecture: alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64
diff --git a/debian/templates/control.source.in b/debian/templates/control.source.in
index 761bf9b..109be7b 100644
--- a/debian/templates/control.source.in
+++ b/debian/templates/control.source.in
@@ -7,7 +7,7 @@ Standards-Version: 3.9.6
 Build-Depends:
  debhelper (>> 7), python3,
  asciidoc, bison, flex, gcc-multilib [amd64 ppc64 s390x sparc64], libaudit-dev, libdw-dev, libelf-dev, libiberty-dev | binutils-dev (<< 2.23.91.20131123-1), libnewt-dev, libnuma-dev [amd64 arm64 hppa i386 mips mips64 mips64el mipsel powerpc powerpcspe ppc64 ppc64el sparc x32], libperl-dev, libunwind8-dev [amd64 armel armhf arm64 i386], python-dev, xmlto,
- autoconf, automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev,
+ autoconf, automake, libtool, libglib2.0-dev, libudev-dev, libwrap0-dev, libpci-dev,
  dh-systemd
 Vcs-Git: https://anonscm.debian.org/git/kernel/linux-tools.git
 Vcs-Browser: https://anonscm.debian.org/cgit/kernel/linux-tools.git
-- 
2.7.0


Reply to: