summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d81ee7b1162180b84660d0c0421e745732c1e805 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Maintainer: Troy Engel <troyengel+arch@gmail.com>
# Contributor: Adrian Perez de Castro <aperez@igalia.com>

pkgname='perf-tools-git'
pkgdesc='Performance analysis tools based on Linux perf_events (aka perf) and ftrace'
pkgver=r200.98d42a2
pkgrel=1
arch=('any')
url='https://github.com/brendangregg/perf-tools'
depends=('perf')
makedepends=('git')
conflicts=('perf-tools')
license=('GPL')
source=("${pkgname}::git+${url}")
sha512sums=('SKIP')

pkgver () {
  cd "${pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package () {
  cd "${pkgname}"

  local file
  for file in bin/*
  do
    if [[ -L ${file} ]] ; then
      file=$(readlink -f "${file}")
    fi
    local basename=${file##*/}
    install -Dm755 "${file}" "${pkgdir}/usr/bin/${basename}"
    if [[ -r man/man8/${basename}.8 ]]
    then
      install -Dm644 "man/man8/${basename}.8" \
        "${pkgdir}/usr/share/man/man8/${basename}.8"
    fi
  done

  install -m755 -d "${pkgdir}/usr/share/doc/${pkgname}"
  install -m644 -t "${pkgdir}/usr/share/doc/${pkgname}" \
    README.md examples/*
}