- Add turbostat utility (fate#315666):

Add turbostat-3.13.tar.bz2
  Add turbostat_fix_man_perm.patch

OBS-URL: https://build.opensuse.org/package/show/hardware/cpupower?expand=0&rev=29
This commit is contained in:
Thomas Renninger 2014-01-31 17:08:18 +00:00 committed by Git OBS Bridge
parent d4acf5bff8
commit 4c0962234c
6 changed files with 68 additions and 16 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b78a6ebc094d16693e5b4e06375275c18aa62ce2df8e2b5563bff546b0f11da
size 70434
oid sha256:e57739b412027a105539f8294b0972597858862722cae315152f4c22e014dc88
size 70424

View File

@ -10,6 +10,9 @@ Fri Jan 31 15:48:18 UTC 2014 - trenn@suse.de
Drop introduce_cpupower_idle_set.patch
Drop cpupower-haswell_support.patch
Drop cpupower_hsw_special.patch
- Add turbostat utility (fate#315666):
Add turbostat-3.13.tar.bz2
Add turbostat_fix_man_perm.patch
-------------------------------------------------------------------
Mon Jul 1 08:55:52 UTC 2013 - trenn@suse.de

View File

@ -24,11 +24,14 @@ Url: http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtil
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
Version: 3.13
Release: 0
%define tsversion 3.13
Summary: Tools to determine and set CPU Power related Settings
License: GPL-2.0
Group: System/Base
Source: %{name}-%{version}.tar.bz2
Source1: cpupower_export_tarball_from_git.sh
Source1: turbostat-%{tsversion}.tar.bz2
Source2: cpupower_export_tarball_from_git.sh
Patch1: turbostat_fix_man_perm.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gettext-tools
BuildRequires: pciutils
@ -72,16 +75,21 @@ For that purpose, it compares the performance governor to a configured
powersave module.
%prep
%setup -q
%setup -D -b 1
cd ../turbostat-%{tsversion}
%patch1 -p1
%build
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true STRIP=true VERSION=%{version}"
export CFLAGS="$RPM_OPT_FLAGS"
export CFLAGS="$RPM_OPT_FLAGS -I ."
make $CONF %{?_smp_mflags}
cd ../turbostat-%{tsversion}
make %{?_smp_mflags}
%install
export SUSE_ASNEEDED=0
CONF="PACKAGE_BUGREPORT=http://bugs.opensuse.org mandir=%_mandir libdir=%_libdir CPUFRQ_BENCH=true DESTDIR=$RPM_BUILD_ROOT sbindir=/usr/sbin docdir=%{_docdir}/%{name} confdir=/etc VERSION=%{version}"
@ -92,6 +100,9 @@ mkdir -p $RPM_BUILD_ROOT/%{_docdir}/%{name}/examples
mv $RPM_BUILD_ROOT/%{_docdir}/%{name}/cpufreq-bench_script.sh $RPM_BUILD_ROOT/%{_docdir}/%{name}/examples
%find_lang %{name}
cd ../turbostat-%{tsversion}
make install -e DESTDIR="$RPM_BUILD_ROOT"
%post -n libcpupower0 -p /sbin/ldconfig
%postun -n libcpupower0 -p /sbin/ldconfig
@ -99,7 +110,9 @@ mv $RPM_BUILD_ROOT/%{_docdir}/%{name}/cpufreq-bench_script.sh $RPM_BUILD_ROOT/%{
%files -f %{name}.lang
%defattr (-,root,root)
%{_mandir}/man1/cpupower*
%{_mandir}/man8/turbostat*
/usr/bin/cpupower
/usr/bin/turbostat
%files bench
%defattr (-,root,root)

View File

@ -5,19 +5,21 @@
# the General Public Licence v2
function usage(){
echo "$(basename $0) [ git_tag ]"
echo "$(basename $0) [ git_tag [ tag_to_use ] ]"
echo
echo "git_tag must be a valid kernel git tag, for example v3.1"
echo " if git_tag is not passed HEAD will be used which"
echo " may produce a package incompatible tarball name"
echo " BEST ALWAYS PASS AN EXISTING TAG"
echo " cpupower got introduced in 3.1-rc1"
echo "git_tag Must be a valid kernel git tag, for example v3.1"
echo " if git_tag is not passed HEAD will be used which"
echo " may produce a package incompatible tarball name"
echo " BEST ALWAYS PASS AN EXISTING TAG"
echo " cpupower got introduced in 3.1-rc1"
echo "tag_to_use obs does not like -rcX as a version tag. Pass a verion"
echo " tag you like to use (e.g. 3.13 instead of 3.13-rc7"
echo
echo "export GIT_DIR= environment variable if the git repo is not the current directory"
echo "For example: GIT_DIR=/path_to_git_repo/.git"
}
if [ $# -eq 1 ];then
if [ $# -gt 0 ];then
if [ "$1" = "-h" ] || [ "$1" == "--help" ];then
usage
exit 0
@ -25,9 +27,18 @@ if [ $# -eq 1 ];then
GIT_TAG="$1"
echo "Exporting cpupower from kernel version $GIT_TAG"
# convert - to . as package versions do not allow -
VERSION="${GIT_TAG/-/.}"
# remove leading v
VERSION="-${VERSION#v}"
if [ $# -eq 1 ];then
VERSION="${GIT_TAG/-/.}"
# remove leading v
VERSION="-${VERSION#v}"
elif [ $# -eq 2 ];then
VERSION="${2/-/.}"
# remove leading v
VERSION="-${VERSION#v}"
elif [ $# -gt 2 ];then
usage
exit 1
fi
else
GIT_TAG="HEAD"
VERSION=""
@ -43,7 +54,19 @@ git archive --format=tar $GIT_TAG tools/power/cpupower |tar -x
mv tools/power/cpupower cpupower${VERSION}
tar -cvjf cpupower${VERSION}.tar.bz2 cpupower${VERSION}
popd
TDIR=`mktemp -d`
pushd "$TDIR"
set -x
git archive --format=tar $GIT_TAG tools/power/x86/turbostat |tar -x
mv tools/power/x86/turbostat turbostat${VERSION}
mkdir turbostat${VERSION}/asm
cp "${GIT_DIR}"/../arch/x86/include/uapi/asm/msr-index.h turbostat${VERSION}/asm
tar -cvjf turbostat${VERSION}.tar.bz2 turbostat${VERSION}
popd
mv "$DIR/cpupower${VERSION}".tar.bz2 .
rm -rf "$DIR"
mv "$TDIR/turbostat${VERSION}".tar.bz2 .
rm -rf "$TDIR"
# set +x
echo cpupower${VERSION}.tar.bz2
echo cpupower${VERSION}.tar.bz2
echo turbostat${VERSION}.tar.bz2

3
turbostat-3.13.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:98aa5ffa5202cbca1836a69383d44ddba70224459bb40d2fc27ebfc6bafeef1a
size 21380

View File

@ -0,0 +1,10 @@
Index: turbostat-3.13/Makefile
===================================================================
--- turbostat-3.13.orig/Makefile
+++ turbostat-3.13/Makefile
@@ -19,4 +19,4 @@ install : turbostat
install -d $(DESTDIR)$(PREFIX)/bin
install $(BUILD_OUTPUT)/turbostat $(DESTDIR)$(PREFIX)/bin/turbostat
install -d $(DESTDIR)$(PREFIX)/share/man/man8
- install turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8
+ install -m 0644 turbostat.8 $(DESTDIR)$(PREFIX)/share/man/man8