summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 81a4a684720bee976e0921e376b0b47b10832111 (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
# Maintainer: Luka Perkov <luka.perkov@sartura.hr>

pkgname=libubox-git
_gitname=libubox
pkgver=r377.d3fa561
pkgrel=1
pkgdesc='A small utility library developed for OpenWrt containing a event loop, linked lists, blobmsg, stream buffer management, [...]'
url='http://git.openwrt.org/?p=project/libubox.git'
arch=('i686' 'x86_64' 'armv7h')
license=('ISC BSD-3c')
depends=('json-c')
makedepends=('git' 'cmake' 'gcc' 'make' 'patch' 'pkg-config')
conflicts=('libubox' 'libubox-lua-git')
provides=('libubox')
source=('git://git.openwrt.org/project/libubox.git' '002-json-c-include.patch')
md5sums=('SKIP' 'SKIP')

pkgver() {
	cd "$srcdir/$_gitname"

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

prepare() {
	cd "$srcdir/$_gitname"

	patch -p1 -i "$srcdir/002-json-c-include.patch"
}

build() {
	cd "$srcdir/$_gitname"

	cmake CMakeLists.txt \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_LUA=OFF

	make
}

package() {
	cd "$srcdir/$_gitname"

	make DESTDIR="$pkgdir" install
}