blob: cb718ec737a8ef3ae844149cc56cd63c8fff57c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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"
|