diff options
Diffstat (limited to 'libre/linux-libre-tools')
-rw-r--r-- | libre/linux-libre-tools/PKGBUILD | 209 |
1 files changed, 96 insertions, 113 deletions
diff --git a/libre/linux-libre-tools/PKGBUILD b/libre/linux-libre-tools/PKGBUILD index 5ff82d377..79a67a94d 100644 --- a/libre/linux-libre-tools/PKGBUILD +++ b/libre/linux-libre-tools/PKGBUILD @@ -1,42 +1,45 @@ # $Id: PKGBUILD 116876 2014-08-05 00:19:20Z seblu $ # Maintainer (Arch): Sébastien Luttringer <seblu@archlinux.org> # Maintainer: André Silva <emulatorman@parabola.nu> +# Contributor: Luke Shumaker <lukeshu@sbcglobal.net> pkgbase=linux-libre-tools -pkgname=( - 'acpidump-libre' - 'cgroup_event_listener-libre' - 'cpupower-libre' - 'libtraceevent-libre' - 'linux-libre-tools-meta' - 'perf-libre' - 'tmon-libre' - 'usbip-libre' - 'x86_energy_perf_policy-libre' +_pkgname=( + 'acpidump' + 'cgroup_event_listener' + 'cpupower' + 'libtraceevent' + 'perf' + 'tmon' + 'usbip' + 'x86_energy_perf_policy' ) -_basekernel=3.16 -#_sublevel=7 -#_pkgver=$_basekernel.$_sublevel -pkgver=$_basekernel +pkgname=("$pkgbase" "${_pkgname[@]/#/${pkgbase}-}") + +_pkgbasever=3.16-gnu +_pkgver=3.16-gnu + +_srcname=linux-${_pkgbasever%-*} +pkgver=${_pkgver//-/.} pkgrel=1 license=('GPL2') arch=('i686' 'x86_64' 'mips64el') url='http://linux-libre.fsfla.org/' options=('!strip') -# split packages need all package dependencies set manually in makedepends -# kernel source deps + makedepends=('asciidoc' 'xmlto') -# perf-libre deps -makedepends+=('perl' 'python2' 'libnewt' 'elfutils' 'libunwind' 'numactl') -# cpupower-libre deps -makedepends+=('pciutils') -# usbip-libre deps -makedepends+=('glib2' 'sysfsutils' 'udev') -# tmon-libre deps -makedepends+=('ncurses') +# split packages need all package dependencies set manually in makedepends +declare -A _depends +_depends[perf]='perl python2 libnewt elfutils libunwind numactl' +_depends[cpupower]='pciutils' +_depends[usbip]='glib2 sysfsutils libsystemd' +makedepends+=(systemd) # libsystemd for runtime, systemd for make. IDK, it's what Arch does +_depends[tmon]='ncurses' +makedepends+=(${_depends[@]}) + groups=("$pkgbase") -source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/$_basekernel-gnu/linux-libre-$_basekernel-gnu.tar.xz" - #"http://linux-libre.fsfla.org/pub/linux-libre/releases/$_pkgver-gnu/patch-$_basekernel-gnu-$_pkgver-gnu.xz" +source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz" + #"http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgver}/patch-${_pkgbasever}-${_pkgver}.xz" 'cpupower.default' 'cpupower.systemd' 'cpupower.service' @@ -54,25 +57,26 @@ sha256sums=('9c2a524c901febe0f0138f702bfdeb52d6f79f22c1fdbabaa37580bc70f16218' '7547815bb761d49d198b85f95011535713c2ed4a004f249a9cf6ba985af8c4ed') prepare() { - cd linux-$pkgver - # apply stable patching set - if (( NOEXTRACT == 0 )) && [[ -e "$srcdir"/patch-$_basekernel-gnu-$_pkgver-gnu ]]; then - msg2 'Applying stable patch set' - patch -Np1 -i "$srcdir"/patch-$_basekernel-gnu-$_pkgver-gnu + cd $_srcname + + # add upstream patch + if [ "${_pkgbasever}" != "${_pkgver}" ]; then + patch -p1 -i "${srcdir}/patch-${_pkgbasever}-${_pkgver}" fi + patch -N -p1 -i "$srcdir/01-fix-perf-python.patch" patch -N -p1 -i "$srcdir/02-parabola-paths.patch" patch -N -p1 -i "$srcdir/03-fix-tmon-ltinfo.patch" } build() { - msg2 'libtraceevent-libre' - pushd linux-$pkgver/tools/lib/traceevent + msg2 'libtraceevent' + pushd $_srcname/tools/lib/traceevent make popd - msg2 'perf-libre' - pushd linux-$pkgver/tools/perf + msg2 'perf' + pushd $_srcname/tools/perf make \ WERROR=0 \ DESTDIR="$pkgdir/usr" \ @@ -84,20 +88,20 @@ build() { all man popd - msg2 'cpupower-libre' - pushd linux-$pkgver/tools/power/cpupower + msg2 'cpupower' + pushd $_srcname/tools/power/cpupower # we cannot use --as-needed #LDFLAGS=${LDFLAGS:+"$LDFLAGS,--no-as-needed"} make VERSION=$pkgver-$pkgrel popd - msg2 'x86_energy_perf_policy-libre' - pushd linux-$pkgver/tools/power/x86/x86_energy_perf_policy + msg2 'x86_energy_perf_policy' + pushd $_srcname/tools/power/x86/x86_energy_perf_policy make popd - msg2 'usbip-libre' - pushd linux-$pkgver/drivers/staging/usbip/userspace + msg2 'usbip' + pushd $_srcname/drivers/staging/usbip/userspace # fix missing man page sed -i 's/usbip_bind_driver.8//' Makefile.am ./autogen.sh @@ -105,62 +109,45 @@ build() { make popd - msg2 'tmon-libre' - pushd linux-$pkgver/tools/thermal/tmon + msg2 'tmon' + pushd $_srcname/tools/thermal/tmon make popd - msg2 'acpidump-libre' - pushd linux-$pkgver/tools/power/acpi + msg2 'acpidump' + pushd $_srcname/tools/power/acpi make popd - msg2 'cgroup_event_listener-libre' - pushd linux-$pkgver/tools/cgroup + msg2 'cgroup_event_listener' + pushd $_srcname/tools/cgroup make popd } -package_linux-libre-tools-meta() { - pkgdesc='Linux kernel tools meta package' +_package_meta() { + pkgdesc='Linux-libre kernel tools meta package' groups=() - depends=( - 'acpidump-libre' - 'cgroup_event_listener-libre' - 'cpupower-libre' - 'libtraceevent-libre' - 'linux-libre-tools-meta' - 'perf-libre' - 'tmon-libre' - 'usbip-libre' - 'x86_energy_perf_policy-libre' - ) - replaces=('linux-tools-meta') - conflicts=('linux-tools-meta') - provides=("linux-tools-meta=$pkgver") + depends=("${_pkgname[@]/#/${pkgbase}-}") + replaces=( linux{,-libre}-tools-meta) + conflicts=(linux{,-libre}-tools-meta) + provides=( linux{,-libre}-tools-meta=$pkgver) } -package_libtraceevent-libre() { - pkgdesc='Linux kernel trace event library' +_package_libtraceevent() { + pkgdesc='Linux-libre kernel trace event library' depends=('glibc') - replaces=('libtraceevent') - conflicts=('libtraceevent') - provides=("libtraceevent=$pkgver") - cd linux-$pkgver/tools/lib/traceevent + cd $_srcname/tools/lib/traceevent install -dm 755 "$pkgdir/usr/lib" install -m 644 libtraceevent.a libtraceevent.so "$pkgdir/usr/lib" } -package_perf-libre() { - pkgdesc='Linux kernel performance auditing tool' - depends=('perl' 'python2' 'libnewt' 'elfutils' 'libunwind' 'binutils' - 'numactl') - replaces=('perf') - conflicts=('perf') - provides=("perf=$pkgver") +_package_perf() { + pkgdesc='Linux-libre kernel performance auditing tool' + depends=('binutils') - cd linux-$pkgver/tools/perf + cd $_srcname/tools/perf make \ WERROR=0 \ DESTDIR="$pkgdir/usr" \ @@ -176,16 +163,15 @@ package_perf-libre() { rm -r usr/etc } -package_cpupower-libre() { - pkgdesc='Linux kernel tool to examine and tune power saving related features of your processor' +_package_cpupower() { + pkgdesc='Linux-libre kernel tool to examine and tune power saving related features of your processor' backup=('etc/default/cpupower') - depends=('bash' 'pciutils') - replaces=('cpupower' 'cpufrequtils') - conflicts=('cpupower' 'cpufrequtils') - provides=("cpupower=$pkgver") + depends=('bash') + replaces=('cpufrequtils') + conflicts=('cpufrequtils') install=cpupower.install - pushd linux-$pkgver/tools/power/cpupower + pushd $_srcname/tools/power/cpupower make \ DESTDIR="$pkgdir" \ sbindir='/usr/bin' \ @@ -199,26 +185,19 @@ package_cpupower-libre() { install -Dm 755 cpupower.systemd "$pkgdir/usr/lib/systemd/scripts/cpupower" } -package_x86_energy_perf_policy-libre() { +_package_x86_energy_perf_policy() { pkgdesc='Read or write MSR_IA32_ENERGY_PERF_BIAS' depends=('glibc') - replaces=('x86_energy_perf_policy') - conflicts=('x86_energy_perf_policy') - provides=("x86_energy_perf_policy=$pkgver") - cd linux-$pkgver/tools/power/x86/x86_energy_perf_policy + cd $_srcname/tools/power/x86/x86_energy_perf_policy install -Dm 755 x86_energy_perf_policy "$pkgdir/usr/bin/x86_energy_perf_policy" install -Dm 644 x86_energy_perf_policy.8 "$pkgdir/usr/share/man/man8/x86_energy_perf_policy.8" } -package_usbip-libre() { - pkgdesc='An USB device sharing system over IP network' - depends=('glib2' 'sysfsutils' 'libsystemd') - replaces=('usbip') - conflicts=('usbip') - provides=("usbip=$pkgver") +_package_usbip() { + pkgdesc='A USB device sharing system over IP network' - pushd linux-$pkgver/drivers/staging/usbip/userspace + pushd $_srcname/drivers/staging/usbip/userspace make install DESTDIR="$pkgdir" popd # module loading @@ -228,39 +207,43 @@ package_usbip-libre() { install -Dm 644 usbipd.service "$pkgdir/usr/lib/systemd/system/usbipd.service" } -package_tmon-libre() { - pkgdesc='Monitoring and Testing Tool for Linux kernel thermal subsystem' - depends=('glibc' 'ncurses') - replaces=('tmon') - conflicts=('tmon') - provides=("tmon=$pkgver") +_package_tmon() { + pkgdesc='Monitoring and Testing Tool for Linux-libre kernel thermal subsystem' + depends=('glibc') - cd linux-$pkgver/tools/thermal/tmon + cd $_srcname/tools/thermal/tmon make install INSTALL_ROOT="$pkgdir" } -package_acpidump-libre() { +_package_acpidump() { pkgdesc='Dump system ACPI tables to an ASCII file' depends=('glibc') - replaces=('acpidump') - conflicts=('acpidump' 'iasl') - provides=("acpidump=$pkgver") + conflicts=('iasl') - cd linux-$pkgver/tools/power/acpi + cd $_srcname/tools/power/acpi make install sbindir=/usr/bin mandir=/usr/share/man DESTDIR="$pkgdir" #install -Dm755 acpidump "$pkgdir/usr/bin/acpidump" #install -Dm644 acpidump.8 "$pkgdir/usr/share/man/man8/acpidump.8" } -package_cgroup_event_listener-libre() { +_package_cgroup_event_listener() { pkgdesc='Simple listener of cgroup events' depends=('glibc') - replaces=('cgroup_event_listener') - conflicts=('cgroup_event_listener') - provides=("cgroup_event_listener=$pkgver") - cd linux-$pkgver/tools/cgroup + cd $_srcname/tools/cgroup install -Dm755 cgroup_event_listener "$pkgdir/usr/bin/cgroup_event_listener" } +eval "package_${pkgbase}() { _package_meta; }" +for _p in "${_pkgname[@]}"; do + eval " + package_${pkgbase}-${_p}() { + _package_${_p} + depends+=(${_depends[${_p}]}) + replaces+=( ${_p}{,-libre}) + conflicts+=(${_p}{,-libre}) + provides+=( ${_p}{,-libre}=${pkgver}) + }" +done + # vim:set ts=2 sw=2 et: |