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

[PATCH 2/2] 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 | 25 +++++++++++++
 debian/changelog                           |  7 ++++
 debian/libcpupower-dev.install             |  2 ++
 debian/libcpupower0.install                |  1 +
 debian/libcpupower0.symbols                | 44 +++++++++++++++++++++++
 debian/linux-cpupower.install              |  3 ++
 debian/rules.real                          | 57 ++++++++++++++++++++++++++++++
 debian/templates/control.main.in           | 32 +++++++++++++++++
 debian/templates/control.source.in         |  2 +-
 10 files changed, 173 insertions(+), 1 deletion(-)
 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..29800ec
--- /dev/null
+++ b/debian/build/tools/power/cpupower/Makefile
@@ -0,0 +1,25 @@
+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)))
+	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=${MANDIR} 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 b375ed2..3f27a0b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+linux-tools (4.4-1~exp2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add linux-cpupower.
+
+ -- Mattia Dongili <malattia@debian.org>  Sun, 14 Feb 2016 19:33:51 -0800
+
 linux-tools (4.4-1~exp2) experimental; urgency=medium
 
   * linux-perf: Fix FTBFS with gcc 6 (used on hppa, sparc64)
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..71f8549 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -3,6 +3,7 @@ export KBUILD_BUILD_TIMESTAMP := $(shell dpkg-parsechangelog | sed -ne 's,^Date:
 
 include debian/rules.defs
 
+binary-arch: install-linux-cpupower install-libcpupower0 install-libcpupower-dev
 binary-arch: install-kbuild install-usbip install-liblockdep
 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
@@ -43,6 +44,62 @@ install-kbuild: $(STAMPS_DIR)/build
 	dh_md5sums
 	dh_builddeb
 
+
+install-cpupower: $(STAMPS_DIR)/build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	$(MAKE) -C $(BUILD_DIR)/tools/power/cpupower install MANDIR=/usr/share/man top_srcdir=$(CURDIR) DESTDIR=$(DIR)
+
+install-linux-cpupower: PACKAGE_NAME = linux-cpupower
+install-linux-cpupower: DH_OPTIONS = -p$(PACKAGE_NAME)
+install-linux-cpupower: DIR = $(CURDIR)/debian/cpupower-tmp
+install-linux-cpupower: install-cpupower install-libcpupower0 $(STAMPS_DIR)/build
+	dh_install --sourcedir=$(DIR)
+	dh_installchangelogs
+	dh_installdocs
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+install-libcpupower-dev: PACKAGE_NAME = libcpupower-dev
+install-libcpupower-dev: DH_OPTIONS = -p$(PACKAGE_NAME)
+install-libcpupower-dev: DIR = $(CURDIR)/debian/cpupower-tmp
+install-libcpupower-dev: install-cpupower install-libcpupower0 $(STAMPS_DIR)/build
+	dh_install --sourcedir=$(DIR)
+	dh_installchangelogs
+	dh_installdocs
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+install-libcpupower0: PACKAGE_NAME = libcpupower0
+install-libcpupower0: DH_OPTIONS = -p$(PACKAGE_NAME)
+install-libcpupower0: DIR = $(CURDIR)/debian/cpupower-tmp
+install-libcpupower0: install-cpupower $(STAMPS_DIR)/build
+	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..dbb50d5 100644
--- a/debian/templates/control.main.in
+++ b/debian/templates/control.main.in
@@ -5,6 +5,38 @@ 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: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: CPU frequency and voltage scaling tools for Linux
+ This package contains the 'power/cpupower' tools for Linux
+ kernel version @version@.
+ .
+ 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: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: CPU frequency and voltage scaling tools for Linux (libraries)
+ This package contains the runtime shared library for Linux kernel
+ version @version@.
+
+Package: libcpupower-dev
+Section: libdevel
+Architecture: 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
+ for Linux kernel version @version@.
+
 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: