summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 84798325b8bc056a4f04dee1ee33fb911bc64672 (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
44
45
46
47
48
49
50
51
52
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Jakub Luzny <limoto94@gmail.com>

pkgname=x86info-git
pkgver=0.r954.g061ea35
pkgrel=1
pkgdesc='A CPU identification utility. Provides more info than /proc/cpuinfo - git checkout'
arch=('i686' 'x86_64')
depends=('pciutils')
url='https://github.com/kernelslacker/x86info'
license=('GPL')
install=x86info.install
makedepends=('git')
provides=('x86info')
conflicts=('x86info')
source=('git+https://github.com/kernelslacker/x86info.git')
sha256sums=('SKIP')

pkgver() {
	cd x86info/

	if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
		printf '%s.r%s.g%s' \
			"$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG})" \
			"$(git rev-list --count ${GITTAG}..)" \
			"$(git rev-parse --short HEAD)"
	else
		printf '0.r%s.g%s' \
			"$(git rev-list --count master)" \
			"$(git rev-parse --short HEAD)"
	fi
}

build() {
	cd x86info/

	make

	cd lsmsr/

	make
}

package() {
	cd x86info/

	install -D -m0775 x86info "${pkgdir}/usr/bin/x86info"
	install -D -m0775 lsmsr/lsmsr "${pkgdir}/usr/bin/lsmsr"
	install -D -m0644 x86info.1 "${pkgdir}/usr/share/man/man1/x86info.1"
	install -D -m0644 lsmsr/lsmsr.8 "${pkgdir}/usr/share/man/man8/lsmsr.8"
}