summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dcf2d6f405f55c945e130f427b890e167efa94ee (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
# Maintainer: Alfredo Ramos <alfredo.ramos@skiff.com>
# Contributor: Sorah Fukumori <sorah@cookpad.com>

_pkgname=pigpio
pkgname=${_pkgname}-git
pkgver=76.0.g30e6b35
pkgrel=1
pkgdesc='A C library to control the Raspberry Pi GPIOs. Development version.'
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url='https://github.com/joan2937/pigpio'
license=('custom:UNLICENCE')
depends=('glibc')
makedepends=('git')
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}" "python-${_pkgname}")

source=("git+https://github.com/joan2937/${_pkgname}.git")
sha512sums=('SKIP')

pkgver() {
	cd "${srcdir}"/${_pkgname}
	git describe --long --tags 2>/dev/null | sed -r 's/^v//;s/-/./g'
}

prepare() {
	cd "${srcdir}"
	cp -a ${_pkgname} build/

	cd build
	sed -ri '/which python/d' Makefile
	sed -ri '/\/opt/d' Makefile
	sed -ri 's|\$\(prefix\)/man|\$\(prefix\)/share/man|' Makefile
	sed -ri 's|/usr/bin/pigpiod|/usr/bin/pigpiod -g|' util/pigpiod.service
}

build() {
	cd "${srcdir}"/build
	make
}

package() {
	cd "${srcdir}"/build
	make prefix=/usr DESTDIR="${pkgdir}" install

	mkdir -p "${pkgdir}"/usr/lib/systemd/system
	cp -a util/pigpiod.service "${pkgdir}"/usr/lib/systemd/system/

	mkdir -p "${pkgdir}"/usr/share/licenses/$pkgname
	cp -a UNLICENCE "${pkgdir}"/usr/share/licenses/$pkgname/
}