aboutsummaryrefslogblamecommitdiffstats
path: root/testing/linux-tools/APKBUILD
blob: cb718ec737a8ef3ae844149cc56cd63c8fff57c7 (plain) (tree)





















































































                                                                                                                                                               
# 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"