aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-cqueues-pushy/APKBUILD
blob: e288fda81ea9a59511c5753bd932f219e85fc62b (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
66
67
68
69
70
71
72
73
74
# Maintainer: Timo Teräs <timo.teras@iki.fi>
_luaversions="5.2 5.3"
pkgname=lua-cqueues-pushy
pkgver=0.20161205.1
_commitid=f06ead2661e1e58d54ecbff26fe164fa6b2f6c2e
pkgrel=0
pkgdesc="Framework for logic control (based on cqueues)"
url="https://github.com/rameplayerorg/lua-cqueues-pushy"
arch="all"
license="GPLv2"
install=""
depends=""
makedepends="linux-headers"
subpackages=""
for _i in $_luaversions; do
        makedepends="$makedepends lua$_i-dev"
        subpackages="$subpackages lua$_i-cqueues-pushy:split_${_i/./_}"
done
source="$pkgname-$pkgver.tar.gz::https://github.com/rameplayerorg/$pkgname/archive/$_commitid.tar.gz
	cqpushy.initd
	"

_sdir="$srcdir"/$pkgname-$_commitid

prepare() {
	local i
	cd "$_srcdir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	for _v in $_luaversions; do
		cp -r "$_sdir" "$srcdir"/build-$_v
	done
}

build() {
	for _v in $_luaversions; do
		cd "$srcdir"/build-$_v
		make LUA_VERSION=$_v
	done
}

package() {
	for _v in $_luaversions; do
		cd "$srcdir"/build-$_v
		make LUA_VERSION=$_v install DESTDIR="$pkgdir" || return 1
	done
	install -m755 -D "$srcdir"/cqpushy.initd \
		"$pkgdir"/etc/init.d/cqpushy || return 1
}

_split() {
	local _ver=$1
	pkgdesc="$pkgdesc - Lua $_ver"
	depends="lua$_ver-cqueues>=20150616 lua$_ver-struct lua$_ver-posix lua$_ver-ldbus lua$_ver-socket lua$_ver-cjson lua$_ver-penlight"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"

	mkdir -p "$subpkgdir"/usr/share/lua "$subpkgdir"/usr/lib/lua
	mv "$pkgdir"/usr/share/lua/$_ver "$subpkgdir"/usr/share/lua
	mv "$pkgdir"/usr/lib/lua/$_ver "$subpkgdir"/usr/lib/lua
}

for _i in $_luaversions; do
	eval "split_${_i/./_}() { _split $_i; }"
done

md5sums="e7d2271c5d44565029c8652436e4878a  lua-cqueues-pushy-0.20161205.1.tar.gz
f585d5983128ccb9b9d33a6019107158  cqpushy.initd"
sha256sums="f50e8ea01996ad936511cefff011e375dad9bdbca55617661a3dd2e4a30ef5e3  lua-cqueues-pushy-0.20161205.1.tar.gz
4ebdbd3299c4b18b7224edc202bd9a4d5a97f325a474ec222901dbedf7f3bc58  cqpushy.initd"
sha512sums="f735ab9304caddf2c457cdd6f17311dfd7964c27bea24064173abe14677f700f7de8c53eed3cfcace44e1d2bd901b7e97200e5c5e162016dd9052dc3134e166f  lua-cqueues-pushy-0.20161205.1.tar.gz
9599db364c3a2e77a7fee61304182961cb6132ce9cb58e9b6837312f52a582e838fdb54eb932c3204b558e3db7228a0412870d0a02125d1017f3402155647bd0  cqpushy.initd"