summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fa37a83a8618a07457f6519161c79854bd2e2ac6 (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
# Maintainer: Manuel Coenen <manuel dot coenen at gmail dot com>
_pkgbase=c2_gpio
pkgname=c2_gpio-dkms-git
pkgver=r62.2bc8b52
pkgrel=1
pkgdesc="Linux GPIO C2 Bus Master Implementation"
arch=('any')
url="https://github.com/dimhoff/si4010prog"
license=('GPL2')
depends=('dkms')
makedepends=('git'
'make'
'gcc')
provides=("${pkgname%-git}")
conflicts=("${_pkgbase}")
install=${pkgname}.install
source=("${pkgname}::git+git://github.com/dimhoff/si4010prog.git"
'dkms.conf'
)
md5sums=('SKIP'
         '76a06cf15c98143494aefa819533f959')

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

build() {
	cd "$srcdir/${pkgname}/drivers/c2_gpio"
	make
}

package() {

	# Copy dkms.conf
	install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

	# Set name and version
	sed -e "s/@_PKGBASE@/${_pkgbase}/" \
		-e "s/@PKGVER@/${pkgver}/" \
		-i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf

	# Copy sources (including Makefile)
	cd "$srcdir/${pkgname}/drivers/c2_gpio"
	cp -r * "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/

	install -Dm644 99-c2_bus.rules "${pkgdir}"/usr/lib/udev/rules.d/99-c2_bus.rules
}