summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d9ad3550f71de8f1eae55823f8e3ba48ea1ec3f8 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Maintainer: Luka Perkov <luka.perkov@sartura.hr>

pkgname=ubus-git
pkgver=r324.ad0cd11
pkgrel=1
pkgdesc='OpenWrt ubus library'
url='https://git.openwrt.org/project/ubus.git'
arch=('i686' 'x86_64' 'armv7h')
license=('LGPL 2.1')

depends=(
	'libubox'
	'lua'
)
makedepends=(
	'git'
	'cmake'
	'gcc'
	'make'
	'pkg-config'
	'patch'
)
provides=(
	'libubus'
	'ubus'
)
conflicts=(
	'libubus'
	'ubus'
)

gitbranch="master"

source=("${pkgname}::git+https://git.openwrt.org/project/ubus.git#branch=${gitbranch}" "001-lua-5_4.patch")
md5sums=('SKIP' 'SKIP')

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

prepare() {
	cd "${pkgname}"

	patch -p1 -i "$srcdir/001-lua-5_4.patch"
}

build() {
	cd "${pkgname}"

	cmake CMakeLists.txt \
		-DCMAKE_INSTALL_PREFIX=/usr

	make
}

package() {
	cd "${pkgname}"

	make DESTDIR="$pkgdir" install

	install -d ${pkgdir}/usr/bin
	mv ${pkgdir}/usr/sbin/* ${pkgdir}/usr/bin/
	rm -Rf ${pkgdir}/usr/sbin/
}