aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-date/APKBUILD
blob: b2c6c304acc7fc09cb5d949d1363ca9f6d10cfff (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=lua-date
_rockname=date
pkgver=2.1.2
pkgrel=0
pkgdesc="Date & Time module for Lua 5.x"
url="https://github.com/Tieske/date"
arch="noarch"
license="MIT"
depends="lua"
checkdepends="lua-busted"
source="https://github.com/Tieske/$_rockname/archive/version_$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/date-version_$pkgver"

case "$CARCH" in
	# luajit is not available for s390x
	s390x) _luajit="";;
	*) checkdepends="$checkdepends luajit" _luajit="jit";;
esac

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	checkdepends="$checkdepends lua$_v lua$_v-busted"
done

check() {
	local lver; for lver in $_luaversions $_luajit; do
		msg "Testing on lua$lver"
		lua$lver /usr/bin/busted
	done
}

package() {
	mkdir -p "$pkgdir"
}

package() {
	local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$pkgver-1"

	install -m 644 -D "$builddir"/date.lua \
		"$pkgdir"/usr/share/lua/common/date.lua

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="78b85b05e2d3b41af024baae83b29f4deadbf2501d6a8c50017f9bc4125c53c83c821e415536b4b9f35b6025051af3d8e24eb93e47b0f36eeec62444c03ed364  lua-date-2.1.2.tar.gz"