2012-12-15 02:14:36 +00:00
|
|
|
# $Id$
|
2013-02-19 20:07:36 +00:00
|
|
|
# Maintainer: Sébastien Luttringer
|
2012-07-23 23:25:09 +00:00
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
2015-05-14 14:19:46 +00:00
|
|
|
# - removed x86_energy_perf_policy and turbostat build/package, uses x86 asm
|
2014-01-21 01:48:34 +00:00
|
|
|
# - removed numactl dep
|
2015-11-03 00:33:56 +00:00
|
|
|
# - use tarball source
|
2012-07-23 23:25:09 +00:00
|
|
|
|
|
|
|
pkgbase=linux-tools
|
2014-01-21 01:36:06 +00:00
|
|
|
pkgname=(
|
|
|
|
'cgroup_event_listener'
|
|
|
|
'cpupower'
|
|
|
|
'libtraceevent'
|
|
|
|
'linux-tools-meta'
|
|
|
|
'perf'
|
|
|
|
'tmon'
|
|
|
|
'usbip'
|
|
|
|
)
|
2016-07-28 21:48:50 +00:00
|
|
|
pkgver=4.7
|
2016-08-18 00:59:10 +00:00
|
|
|
pkgrel=2
|
2012-07-23 23:25:09 +00:00
|
|
|
license=('GPL2')
|
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
url='http://www.kernel.org'
|
|
|
|
options=('!strip')
|
2015-11-03 00:33:56 +00:00
|
|
|
makedepends=('git')
|
2012-07-23 23:25:09 +00:00
|
|
|
# split packages need all package dependencies set manually in makedepends
|
2012-08-09 13:40:15 +00:00
|
|
|
# kernel source deps
|
2015-11-03 00:33:56 +00:00
|
|
|
makedepends+=('asciidoc' 'xmlto')
|
2012-08-09 13:40:15 +00:00
|
|
|
# perf deps
|
2015-07-26 19:03:09 +00:00
|
|
|
makedepends+=('perl' 'python2' 'libnewt' 'elfutils' 'libunwind' 'audit' 'gtk2')
|
2012-08-09 13:40:15 +00:00
|
|
|
# cpupower deps
|
|
|
|
makedepends+=('pciutils')
|
|
|
|
# usbip deps
|
2014-07-30 22:17:35 +00:00
|
|
|
makedepends+=('glib2' 'sysfsutils' 'udev')
|
2014-01-21 01:36:06 +00:00
|
|
|
# tmon deps
|
|
|
|
makedepends+=('ncurses')
|
2012-08-09 13:40:15 +00:00
|
|
|
groups=("$pkgbase")
|
2015-11-03 00:33:56 +00:00
|
|
|
source=("https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${pkgver}.tar.xz"
|
2013-02-19 20:07:36 +00:00
|
|
|
'cpupower.default'
|
2012-08-07 16:11:48 +00:00
|
|
|
'cpupower.systemd'
|
2012-08-09 13:40:15 +00:00
|
|
|
'cpupower.service'
|
2014-01-21 01:36:06 +00:00
|
|
|
'usbipd.service'
|
2016-08-18 00:59:10 +00:00
|
|
|
'01-cpupower-governor-fix.patch'
|
2014-07-30 22:17:35 +00:00
|
|
|
'02-archlinux-paths.patch'
|
2014-10-06 01:22:49 +00:00
|
|
|
'04-fix-usip-h-path.patch')
|
2015-11-03 00:33:56 +00:00
|
|
|
md5sums=('SKIP'
|
|
|
|
'56883c159381ba89e50ab8ea65efec77'
|
2016-04-17 12:40:18 +00:00
|
|
|
'34f5ecc19770a1abbcd0fd65bfd1f065'
|
|
|
|
'86c4e419e4ba80835c330d49ba3f56ad'
|
2015-11-03 00:33:56 +00:00
|
|
|
'bb35634f480325a78b943f7e10165e86'
|
2016-08-18 00:59:10 +00:00
|
|
|
'33c871519adfd4e5575643c4579d019b'
|
2015-11-03 00:33:56 +00:00
|
|
|
'1bc4f8c7a21a30e1a873d07e69fb698b'
|
|
|
|
'a73ea3ea6d9c9ecb1cc910871eead3ff')
|
2014-01-21 01:36:06 +00:00
|
|
|
|
|
|
|
prepare() {
|
2016-03-16 01:23:43 +00:00
|
|
|
cd linux-$pkgver
|
2016-08-18 00:59:10 +00:00
|
|
|
# apply stable kernel patch
|
|
|
|
#xz -kcd "$srcdir"/patch-4.7.1.xz | patch -p1 -N
|
2016-03-16 01:23:43 +00:00
|
|
|
# apply patch from the source array (should be a pacman feature)
|
|
|
|
local filename
|
|
|
|
for filename in "${source[@]}"; do
|
|
|
|
if [[ "$filename" =~ \.patch$ ]]; then
|
|
|
|
msg2 "Applying patch $filename"
|
|
|
|
patch -p1 -N -i "$srcdir/$filename"
|
|
|
|
fi
|
2015-05-14 14:19:46 +00:00
|
|
|
done
|
2014-01-21 01:36:06 +00:00
|
|
|
}
|
|
|
|
|
2013-07-01 23:50:42 +00:00
|
|
|
build() {
|
2014-01-21 01:36:06 +00:00
|
|
|
msg2 'libtraceevent'
|
2012-12-15 02:14:36 +00:00
|
|
|
pushd linux-$pkgver/tools/lib/traceevent
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
|
2014-01-21 01:36:06 +00:00
|
|
|
msg2 'perf'
|
2012-07-23 23:25:09 +00:00
|
|
|
pushd linux-$pkgver/tools/perf
|
|
|
|
make \
|
2016-04-17 12:40:18 +00:00
|
|
|
prefix=/usr \
|
|
|
|
DESTDIR="$pkgdir" \
|
2012-07-23 23:25:09 +00:00
|
|
|
WERROR=0 \
|
|
|
|
PYTHON=python2 \
|
2014-01-21 01:36:06 +00:00
|
|
|
PYTHON_CONFIG=python2-config \
|
2012-07-23 23:25:09 +00:00
|
|
|
PERF_VERSION=$pkgver-$pkgrel \
|
|
|
|
all man
|
|
|
|
popd
|
|
|
|
|
2014-01-21 01:36:06 +00:00
|
|
|
msg2 'cpupower'
|
2012-07-23 23:25:09 +00:00
|
|
|
pushd linux-$pkgver/tools/power/cpupower
|
|
|
|
# we cannot use --as-needed
|
2014-01-21 01:36:06 +00:00
|
|
|
#LDFLAGS=${LDFLAGS:+"$LDFLAGS,--no-as-needed"}
|
2012-07-23 23:25:09 +00:00
|
|
|
make VERSION=$pkgver-$pkgrel
|
|
|
|
popd
|
2012-08-09 13:40:15 +00:00
|
|
|
|
2014-01-21 01:36:06 +00:00
|
|
|
msg2 'usbip'
|
2014-10-06 01:22:49 +00:00
|
|
|
pushd linux-$pkgver/tools/usb/usbip
|
2012-08-09 13:40:15 +00:00
|
|
|
./autogen.sh
|
2013-05-13 00:01:34 +00:00
|
|
|
./configure --prefix=/usr --sbindir=/usr/bin
|
2012-08-09 13:40:15 +00:00
|
|
|
make
|
|
|
|
popd
|
2014-01-21 01:36:06 +00:00
|
|
|
|
|
|
|
msg2 'tmon'
|
|
|
|
pushd linux-$pkgver/tools/thermal/tmon
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
|
|
|
|
msg2 'cgroup_event_listener'
|
|
|
|
pushd linux-$pkgver/tools/cgroup
|
|
|
|
make
|
|
|
|
popd
|
2012-07-23 23:25:09 +00:00
|
|
|
}
|
|
|
|
|
2013-02-05 16:24:00 +00:00
|
|
|
package_linux-tools-meta() {
|
|
|
|
pkgdesc='Linux kernel tools meta package'
|
|
|
|
groups=()
|
2014-01-21 01:36:06 +00:00
|
|
|
depends=(
|
|
|
|
'cgroup_event_listener'
|
|
|
|
'cpupower'
|
|
|
|
'libtraceevent'
|
|
|
|
'perf'
|
|
|
|
'tmon'
|
|
|
|
'usbip'
|
|
|
|
)
|
2015-05-14 17:53:51 +00:00
|
|
|
conflicts=(
|
|
|
|
'acpidump'
|
|
|
|
)
|
2013-02-05 16:24:00 +00:00
|
|
|
}
|
|
|
|
|
2012-12-15 02:14:36 +00:00
|
|
|
package_libtraceevent() {
|
|
|
|
pkgdesc='Linux kernel trace event library'
|
2012-12-19 05:09:53 +00:00
|
|
|
depends=('glibc')
|
2012-12-15 02:14:36 +00:00
|
|
|
|
|
|
|
cd linux-$pkgver/tools/lib/traceevent
|
|
|
|
install -dm 755 "$pkgdir/usr/lib"
|
2014-10-06 01:22:49 +00:00
|
|
|
install -m 644 libtraceevent.so "$pkgdir/usr/lib"
|
2012-12-15 02:14:36 +00:00
|
|
|
}
|
|
|
|
|
2012-07-23 23:25:09 +00:00
|
|
|
package_perf() {
|
|
|
|
pkgdesc='Linux kernel performance auditing tool'
|
2014-10-06 01:22:49 +00:00
|
|
|
depends=('perl' 'python2' 'libnewt' 'elfutils' 'libunwind' 'binutils'
|
|
|
|
'audit')
|
2015-07-26 18:03:25 +00:00
|
|
|
optdepends=('gtk2: support GTK2 browser for perf report')
|
2012-07-23 23:25:09 +00:00
|
|
|
|
|
|
|
cd linux-$pkgver/tools/perf
|
|
|
|
make \
|
2016-04-17 12:40:18 +00:00
|
|
|
prefix=/usr \
|
|
|
|
DESTDIR="$pkgdir" \
|
2012-07-23 23:25:09 +00:00
|
|
|
WERROR=0 \
|
|
|
|
PYTHON=python2 \
|
2014-01-21 01:36:06 +00:00
|
|
|
PYTHON_CONFIG=python2-config \
|
2012-07-23 23:25:09 +00:00
|
|
|
PERF_VERSION=$pkgver-$pkgrel \
|
|
|
|
install install-man
|
2013-02-05 16:24:00 +00:00
|
|
|
cd "$pkgdir"
|
2016-04-17 12:40:18 +00:00
|
|
|
# move completion in new directory
|
|
|
|
install -Dm644 etc/bash_completion.d/perf usr/share/bash-completion/completions/perf
|
|
|
|
rm -r etc
|
|
|
|
# no exec on usr/share
|
|
|
|
find usr/share -type f -exec chmod a-x {} \;
|
2012-07-23 23:25:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_cpupower() {
|
|
|
|
pkgdesc='Linux kernel tool to examine and tune power saving related features of your processor'
|
2013-02-19 20:07:36 +00:00
|
|
|
backup=('etc/default/cpupower')
|
2012-08-09 13:40:15 +00:00
|
|
|
depends=('bash' 'pciutils')
|
2012-07-23 23:25:09 +00:00
|
|
|
conflicts=('cpufrequtils')
|
2012-10-01 12:41:07 +00:00
|
|
|
replaces=('cpufrequtils')
|
2013-01-26 20:29:24 +00:00
|
|
|
install=cpupower.install
|
2012-07-23 23:25:09 +00:00
|
|
|
|
|
|
|
pushd linux-$pkgver/tools/power/cpupower
|
|
|
|
make \
|
|
|
|
DESTDIR="$pkgdir" \
|
2013-05-13 00:01:34 +00:00
|
|
|
sbindir='/usr/bin' \
|
2012-07-23 23:25:09 +00:00
|
|
|
mandir='/usr/share/man' \
|
|
|
|
docdir='/usr/share/doc/cpupower' \
|
|
|
|
install install-man
|
|
|
|
popd
|
2012-08-23 12:33:46 +00:00
|
|
|
# install startup scripts
|
2013-02-19 20:07:36 +00:00
|
|
|
install -Dm 644 $pkgname.default "$pkgdir/etc/default/$pkgname"
|
2012-08-07 16:11:48 +00:00
|
|
|
install -Dm 644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
|
|
|
|
install -Dm 755 $pkgname.systemd "$pkgdir/usr/lib/systemd/scripts/$pkgname"
|
2012-07-23 23:25:09 +00:00
|
|
|
}
|
2012-08-07 16:11:48 +00:00
|
|
|
|
2012-08-09 13:40:15 +00:00
|
|
|
package_usbip() {
|
|
|
|
pkgdesc='An USB device sharing system over IP network'
|
2014-07-30 22:17:35 +00:00
|
|
|
depends=('glib2' 'sysfsutils' 'libsystemd')
|
2012-08-09 13:40:15 +00:00
|
|
|
|
2014-10-06 01:22:49 +00:00
|
|
|
pushd linux-$pkgver/tools/usb/usbip
|
2012-08-09 13:40:15 +00:00
|
|
|
make install DESTDIR="$pkgdir"
|
|
|
|
popd
|
|
|
|
# module loading
|
|
|
|
install -Dm 644 /dev/null "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
|
|
|
|
printf 'usbip-core\nusbip-host\n' > "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
|
2013-02-19 20:07:36 +00:00
|
|
|
# systemd
|
2012-08-09 13:40:15 +00:00
|
|
|
install -Dm 644 usbipd.service "$pkgdir/usr/lib/systemd/system/usbipd.service"
|
|
|
|
}
|
|
|
|
|
2014-01-21 01:36:06 +00:00
|
|
|
package_tmon() {
|
|
|
|
pkgdesc='Monitoring and Testing Tool for Linux kernel thermal subsystem'
|
|
|
|
depends=('glibc' 'ncurses')
|
|
|
|
|
|
|
|
cd linux-$pkgver/tools/thermal/tmon
|
|
|
|
make install INSTALL_ROOT="$pkgdir"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_cgroup_event_listener() {
|
|
|
|
pkgdesc='Simple listener of cgroup events'
|
|
|
|
depends=('glibc')
|
|
|
|
|
|
|
|
cd linux-$pkgver/tools/cgroup
|
|
|
|
install -Dm755 cgroup_event_listener "$pkgdir/usr/bin/cgroup_event_listener"
|
|
|
|
}
|
|
|
|
|
2012-12-15 02:14:36 +00:00
|
|
|
# vim:set ts=2 sw=2 et:
|