void-packages/srcpkgs/linux-tools/template
Juan RP 1c5f4690e6 xbps-src: always require current srcpkgs version in build dependencies.
That means that version comparators are not supported anymore in
hostmakedepends and makedepends.

This will ensure that a pkg is always built with the same build dependencies
everywhere, if the srcpkgs tree is uptodate.
2015-03-27 10:59:58 +01:00

166 lines
4.5 KiB
Bash

# Template file for 'linux-tools'
pkgname=linux-tools
version=3.19.1
revision=1
wrksrc="linux-${version}"
short_desc="Linux kernel tools meta-pkg"
hostmakedepends="flex perl asciidoc xmlto python automake libtool"
makedepends="pciutils-devel python-devel libglib-devel libsysfs-devel
elfutils-devel libunwind-devel binutils-devel zlib-devel slang-devel
libudev-devel"
depends="cpupower>=${version} perf>=${version} usbip>=${version}"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-2"
homepage="http://www.kernel.org"
distfiles="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-${version}.tar.xz"
checksum=717f36a65735bdd7afcb452578cc221c7fde8f6a0073e2feb62473466bdfa763
subpackages="cpupower libcpupower libcpupower-devel libusbip libusbip-devel usbip perf"
if [ "$XBPS_TARGET_MACHINE" = "i686" -o "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
makedepends+=" libnuma-devel"
depends+=" x86_energy_perf_policy>=${version}"
subpackages+=" x86_energy_perf_policy"
fi
nocross=yes
build_options="systemd"
do_build() {
cd ${wrksrc}/tools/perf
make ${makejobs} CC=$CC \
WERROR=0 \
DESTDIR=$DESTDIR \
perfexecdir='lib/perf' \
NO_GTK2=1 \
PERF_VERSION=${version}_${revision} \
all man
cd ${wrksrc}/tools/power/cpupower
# Disable --as-needed.
unset LDFLAGS
make CC=$CC VERSION=${version}_${revision}
if [ "$XBPS_TARGET_MACHINE" = "i686" -o "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
cd ${wrksrc}/tools/power/x86/x86_energy_perf_policy
make ${makejobs}
fi
cd ${wrksrc}/tools/usb/usbip
# fix missing man page
sed -i 's/usbip_bind_driver.8//' Makefile.am
./autogen.sh
./configure --prefix=/usr --sbindir=/usr/bin
make ${makejobs}
}
do_install() {
# cpupower
cd ${wrksrc}/tools/power/cpupower
make DESTDIR=${DESTDIR} \
sbindir='/usr/bin' \
mandir='/usr/share/man' \
docdir='/usr/share/doc/cpupower' \
install install-man
# perf
cd ${wrksrc}/tools/perf
make WERROR=0 DESTDIR=${DESTDIR}/usr \
perfexecdir='lib/perf' \
NO_GTK2=1 \
PERF_VERSION=${version}_${revision} \
install install-man
# move completion in new directory
vmkdir usr/share/bash-completion/completions
mv ${DESTDIR}/usr/etc/bash_completion.d/perf \
${DESTDIR}/usr/share/bash-completion/completions
# usbip
cd ${wrksrc}/tools/usb/usbip
make install DESTDIR=${DESTDIR}
vmkdir usr/lib/modules-load.d
printf 'usbip-core\nusbip-host\n' > \
${DESTDIR}/usr/lib/modules-load.d/usbip.conf
if [ "$XBPS_TARGET_MACHINE" = "i686" -o "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
# x86_energy_perf_policy
cd ${wrksrc}/tools/power/x86/x86_energy_perf_policy
vinstall x86_energy_perf_policy 755 usr/bin
vinstall x86_energy_perf_policy.8 644 usr/share/man/man8
fi
if [ -d ${DESTDIR}/usr/lib64 ]; then
mv ${DESTDIR}/usr/lib64/* ${DESTDIR}/usr/lib/
fi
}
cpupower_package() {
short_desc="Linux kernel tool to set CPU power features"
conf_files="/etc/cpufreq-bench.conf"
pkg_install() {
vmove "usr/bin/cpu*"
vmove "usr/share/man/man1/cpu*"
vmove usr/share/doc/cpupower
vmove usr/share/locale
vmove etc/cpufreq-bench.conf
}
}
libcpupower_package() {
short_desc="Linux kernel tool to set CPU power features - runtime library"
pkg_install() {
vmove "usr/lib/libcpupower.so.*"
}
}
libcpupower-devel_package() {
short_desc="Linux kernel tool to set CPU power features - development files"
depends="libcpupower-${version}_${revision}"
pkg_install() {
vmove usr/include/cpufreq.h
vmove usr/lib/libcpupower.so
}
}
libusbip_package() {
short_desc="An USB device sharing system over IP network - runtime library"
pkg_install() {
vmove "usr/lib/libusbip.so.*"
}
}
libusbip-devel_package() {
short_desc="An USB device sharing system over IP network - development files"
depends="libusbip-${version}_${revision}"
pkg_install() {
vmove usr/include/usbip
vmove usr/lib/libusbip.a
vmove usr/lib/libusbip.so
}
}
perf_package() {
short_desc="Linux kernel performance auditing tool"
pkg_install() {
vmove usr/bin/perf
vmove usr/bin/trace
vmove usr/lib/traceevent
vmove usr/libexec/perf-core
vmove usr/share/bash-completion
vmove "usr/share/man/man1/perf*"
}
}
x86_energy_perf_policy_package() {
short_desc="Read or write MSR_IA32_ENERGY_PERF_BIAS"
pkg_install() {
vmove usr/bin/x86_energy_perf_policy
vmove usr/share/man/man8/x86_energy_perf_policy.8
}
}
usbip_package() {
short_desc="An USB device sharing system over IP network"
pkg_install() {
vmove "usr/bin/usbip*"
vmove "usr/share/man/man8/usbip*"
vmove usr/lib/modules-load.d/usbip.conf
vsv usbipd
if [ "$build_option_systemd" ]; then
vinstall ${FILESDIR}/usbipd.service 644 usr/lib/systemd/system
fi
}
}