mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-31 21:41:44 +01:00
127 lines
4.1 KiB
Plaintext
127 lines
4.1 KiB
Plaintext
# Contributor: Leo <thinkabit.ukim@gmail.com>
|
|
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
|
|
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
|
|
# Maintainer: Milan P. Stanić <mps@arvanta.net>
|
|
pkgname=linux-tools
|
|
pkgver=5.10.42
|
|
_kernver=${pkgver%.*}
|
|
pkgrel=0
|
|
pkgdesc="Linux kernel tools meta package"
|
|
url="https://www.kernel.org/"
|
|
arch="all"
|
|
license="GPL-2.0-only"
|
|
depends="perf cpupower $pkgname-gpio $pkgname-iio"
|
|
depends_dev="pciutils-dev readline-dev gettext-dev"
|
|
makedepends="$depends_dev elfutils-dev bash linux-headers flex bison diffutils
|
|
zlib-dev findutils python3 ncurses-dev"
|
|
subpackages="perf perf-bash-completion:bashcomp:noarch cpupower cpupower-openrc
|
|
$pkgname-gpio $pkgname-iio $pkgname-doc $pkgname-dev
|
|
tmon"
|
|
source="https://kernel.org/pub/linux/kernel/v5.x/linux-$_kernver.tar.xz
|
|
https://kernel.org/pub/linux/kernel/v5.x/patch-$pkgver.xz
|
|
tmon-musl-includes.patch
|
|
cpupower-libs.patch
|
|
cpupower.initd
|
|
cpupower.confd
|
|
"
|
|
|
|
builddir="$srcdir"/linux-$_kernver
|
|
|
|
[ "$CARCH" = "riscv64" ] && options="$options textrels"
|
|
|
|
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 gpio iio tmon
|
|
}
|
|
|
|
package() {
|
|
mkdir -p "$pkgdir"
|
|
_make_tools DESTDIR="$pkgdir" \
|
|
perf_install cpupower_install gpio_install iio_install
|
|
( cd tools/thermal/tmon;
|
|
make install INSTALL_ROOT="$pkgdir"; )
|
|
mv "$pkgdir"/etc/bash_completion.d "$pkgdir"/usr/share/bash-completion/completions
|
|
}
|
|
|
|
cpupower() {
|
|
pkgdesc="Linux kernel tool to set CPU power features"
|
|
depends=""
|
|
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/
|
|
install -Dm755 "$srcdir"/$subpkgname.initd \
|
|
"$pkgdir"/etc/init.d/$subpkgname
|
|
install -Dm644 "$srcdir"/$subpkgname.confd \
|
|
"$pkgdir"/etc/conf.d/$subpkgname
|
|
}
|
|
|
|
perf() {
|
|
pkgdesc="Linux kernel performance auditing tool"
|
|
depends=""
|
|
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/
|
|
}
|
|
|
|
gpio() {
|
|
pkgdesc="Linux kernel GPIO tools"
|
|
depends=""
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/*gpio* "$subpkgdir"/usr/bin
|
|
}
|
|
|
|
iio() {
|
|
pkgdesc="Linux kernel IIO tools"
|
|
depends=""
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/*iio* "$subpkgdir"/usr/bin
|
|
}
|
|
|
|
tmon() {
|
|
pkgdesc="Linux kernel thermal monitor tools"
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/tmon "$subpkgdir"/usr/bin
|
|
}
|
|
|
|
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/
|
|
mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share/
|
|
}
|
|
|
|
sha512sums="
|
|
95bc137d0cf9148da6a9d1f1a878698dc27b40f68e22c597544010a6c591ce1b256f083489d3ff45ff77753289b535135590194d88ef9f007d0ddab3d74de70e linux-5.10.tar.xz
|
|
ce17a528f5cad21f1221529c259529dd044b5d1d05a386a53945dbbfe3d6dd79ccbc93c8534c5a6456e1984fd911d34b7a81a9c15e0ca869bb6853ee0e6b4734 patch-5.10.42.xz
|
|
15d6d80e9ed2cdea3bb09574f1cf524007b088699204cfc9d326edd9cf461a38300cfafd82dae4a5a78a179944ef10f51ed7d51c3a8aeb8c08e7c6754d9e123b tmon-musl-includes.patch
|
|
a46e3a84b00a39a356618831d0ddfb7f0d10f0a3799d1307ba2cc832e73c01f8d637a4e801a6dd25025f6f13155c6ad8b836422ff72d365e51063ac0bf907f52 cpupower-libs.patch
|
|
97ecfeaaaa8efca7af585316b843bf7be885e88095bbdfbf52bc9a96b14dc862435482781e205ea022ab208978aaa4aabb317354fab890ed514a5088ae5045c8 cpupower.initd
|
|
63cd12a4d8782198c71662e9205e346e064b65bae5e3e175b5bc43bdf7ec6ddf675b60349750afe3c37c8a925f9ae9a93530671821342581bd282a69e0773b8c cpupower.confd
|
|
"
|