blob: 79bc6f9d7f1546fad6553e0032c35d980d09f5d9 (
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: Leo <thinkabit.ukim@gmail.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=linux-tools
pkgver=4.18.13
_kernver=${pkgver%.*}
pkgrel=1
pkgdesc="Linux kernel tools meta package"
url="https://www.kernel.org/"
arch="all !aarch64 !armhf !armv7"
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 findutils"
subpackages="perf perf-bash-completion:bashcomp:noarch 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
disable-Werror.patch
"
builddir="$srcdir"/linux-$_kernver
prepare() {
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 WERROR=0 \
prefix=/usr libdir=/usr/lib lib=lib mandir=/usr/share/man \
"$@"
}
build() {
_make_tools perf cpupower
}
package() {
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/
}
bashcomp() {
replaces="$pkgname-bash-completion" # Backward compatibility
pkgdesc="Bash autocompletion for $pkgname"
install_if="perf=$pkgver-r$pkgrel bash-completion"
mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
mv "$pkgdir"/etc/bash_completion.d "$subpkgdir"/usr/share/bash-completion/completions
}
sha512sums="950eb85ac743b291afe9f21cd174d823e25f11883ee62cecfbfff8fe8c5672aae707654b1b8f29a133b1f2e3529e63b9f7fba4c45d6dacccc8000b3a9a9ae038 linux-4.18.tar.xz
169c232c1799eae10b5fa399fc2cb0567536681e8e17f59fe0c489c6186d368261ba45baf1b6f71a0d111895cbf4a44d93f7ee3e20d4842b699f75f5372c8d38 patch-4.18.13.xz
a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch
a0b90cead5f80a7e785b2fdd8ac9faed1234f4aa5eebf658af8d8b4d3b8593147ff43810d0b28a95b057bb7781113a48723b9cf9432ec8d9510451b51416e3de disable-Werror.patch"
|