aboutsummaryrefslogtreecommitdiffstats
path: root/testing/linux-tools/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-04-17 16:48:08 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-04-17 16:52:06 +0000
commit59050d431b87d3fdd23c30cfe2cbd48819dd09af (patch)
tree770d47a4f0a883c7eea77b2151286e78ce556ca8 /testing/linux-tools/APKBUILD
parent48ad71a2a59fb93342a24d9f8c8722c94054ff56 (diff)
downloadaports-59050d431b87d3fdd23c30cfe2cbd48819dd09af.tar.bz2
aports-59050d431b87d3fdd23c30cfe2cbd48819dd09af.tar.xz
testing/linux-tools: new aport for cpupower and perf
Diffstat (limited to 'testing/linux-tools/APKBUILD')
-rw-r--r--testing/linux-tools/APKBUILD86
1 files changed, 86 insertions, 0 deletions
diff --git a/testing/linux-tools/APKBUILD b/testing/linux-tools/APKBUILD
new file mode 100644
index 0000000000..cb718ec737
--- /dev/null
+++ b/testing/linux-tools/APKBUILD
@@ -0,0 +1,86 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=linux-tools
+pkgver=4.14.34
+_kernver=${pkgver%.*}
+pkgrel=0
+pkgdesc="Linux kernel tools meta package"
+url="http://www.kernel.org"
+arch="all"
+license="GPL-2.0-only"
+depends="cpupower perf"
+depends_dev="pciutils-dev readline-dev gettext-dev"
+makedepends="$depends_dev elfutils-dev bash linux-headers flex bison diffutils
+ zlib-dev"
+install=""
+subpackages="perf perf-bash-completions:perf_completions cpupower $pkgname-doc $pkgname-dev"
+source="https://kernel.org/pub/linux/kernel/v4.x/linux-$_kernver.tar.xz
+ https://kernel.org/pub/linux/kernel/v4.x/patch-$pkgver.xz
+ cpupower-libs.patch
+ "
+
+builddir="$srcdir"/linux-$_kernver
+
+prepare() {
+ local _patch_failed=
+ cd "$srcdir"/linux-$_kernver
+ if [ "${pkgver%.0}" = "$pkgver" ]; then
+ msg "Applying patch-$pkgver.xz"
+ unxz -c < "$srcdir"/patch-$pkgver.xz | patch -p1 -N
+ fi
+ default_prepare
+}
+
+_make_tools() {
+ make -C "$builddir"/tools \
+ VERSION=$pkgver-$pkgrel NLS=false LIBINTL_LIBS=-lintl \
+ prefix=/usr lib=lib mandir=/usr/share/man \
+ "$@"
+}
+
+build() {
+ cd "$builddir"
+ _make_tools perf cpupower
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"
+ _make_tools DESTDIR="$pkgdir" \
+ perf_install cpupower_install
+}
+
+cpupower() {
+ pkgdesc="Linux kernel tool to set CPU power features"
+ mkdir -p "$subpkgdir"/usr/sbin \
+ "$subpkgdir"/usr/bin \
+ "$subpkgdir"/usr/lib \
+ "$subpkgdir"/etc
+
+ mv "$pkgdir"/usr/bin/cpu* "$subpkgdir"/usr/bin/
+ mv "$pkgdir"/usr/sbin/cpu* "$subpkgdir"/usr/sbin/
+ mv "$pkgdir"/usr/lib/libcpu*.so.* "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/etc/cpu* "$subpkgdir"/etc/
+}
+
+perf() {
+ pkgdesc="Linux kernel performance auditing tool"
+ mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/bin/perf \
+ "$pkgdir"/usr/bin/trace \
+ "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/lib/traceevent \
+ "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/libexec "$subpkgdir"/usr/
+}
+
+perf_completions() {
+ pkgdesc="bash autocompletion for perf"
+ install_if="perf=$pkgver-r$pkgrel bash"
+ mkdir -p "$subpkgdir"/etc
+ mv "$pkgdir"/etc/bash_completion.d "$subpkgdir"/etc/
+}
+
+sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8 linux-4.14.tar.xz
+1aff1ad1294e0d22ae1de0bbcb1d05269a9cc7bfeb6bc885bd9ee445198b30951d7d7918bf33152579415db2a4afe018d4b21c1fea5dd4d5e5014662fd870acf patch-4.14.34.xz
+a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch"