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

pkgname=ubus-lua-git
_gitname=ubus
pkgver=r257.053be7d
pkgrel=1
pkgdesc='An embedded bus system developed for OpenWrt. It is like dbus but simple and small.'
url='http://git.openwrt.org/?p=project/ubus.git;a=summary'
arch=('i686' 'x86_64' 'armv7h')
license=('LGPLv2.1')
depends=('libubox-lua-git' 'json-c' 'lua51')
makedepends=('git' 'cmake' 'gcc' 'make' 'patch' 'pkg-config')
conflicts=('ubus' 'ubus-git')
provides=('ubus')
source=('git://git.openwrt.org/project/ubus.git' '001-lua-version.patch' '002-ubusd-location.patch')
md5sums=('SKIP' 'SKIP' 'SKIP')

pkgver() {
	cd "$_gitname"

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

prepare() {
	cd "$_gitname"

	patch -p1 -i "$srcdir/001-lua-version.patch"
	patch -p1 -i "$srcdir/002-ubusd-location.patch"
}

build() {
	cd "$_gitname"

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

	make
}

package() {
	cd "$_gitname"

	make DESTDIR="$pkgdir" install
}