summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 14552abff00c74de01d251f4ab04707453fb1832 (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
# Maintainer: Furkan Kardame <tech@fkardame.com>
pkgname=cammus-ff-dkms
_pkgname="${pkgname%-*}"
pkgver=r28.2a2be93
pkgrel=2
pkgdesc='Enable Force Feedback for Cammus C5 Direct Drive Wheel'
arch=(any)
url="https://github.com/spikerguy/${_pkgname}"
license=(GPL2)
depends=(dkms)
install=${pkgname}.install
makedepends=(git joyutils)
source=("$_pkgname::git+${url}.git#branch=master"
		'cammus.rules'
		'cp5-pedal.sh')
b2sums=('SKIP'
        'b7c6687cf7737aebebed6a0c531b7f51042c7e0b920c3d2e5b6916277428c975759ccaf51b245c7e70dd7f6c4e54289559442f95b4168a889e6c358c48ff7485'
        'ec4dfd2fd6872ff16bd73fcf01e78d3e54413f3da6fcf5c0e0c686cec6e0eee0f302ee63d25bbd2e67622e3d85605ad48e6fae212037297b5b8483fd693859aa')

prepare() {
	local src
	for src in "${source[@]}"; do
		src="${src%%::*}"
		src="${src##*/)}"
		[[ $src = *.patch ]] || continue
		echo -e "Applying patch: \\033[1;36m$src\\033[0m"
		patch -Np1 < "$srcdir/$src"
	done
}

pkgver() {
	cd "$srcdir"/"$_pkgname"
	# Git, tags available
	# printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
	# Git, no tags available
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
	install -Dm 0644 -T cammus.rules "${pkgdir}/usr/lib/udev/rules.d/99-cammus.rules"
	install -Dm 0755  cp5-pedal.sh -t "${pkgdir}/usr/bin/"
	cd "$srcdir"/"$_pkgname"
	mkdir -p "$pkgdir/usr/src/$_pkgname-$pkgver"
	cp -r . "$pkgdir/usr/src/$_pkgname-$pkgver"

}