aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-lustache/APKBUILD
blob: 8c4860294bce349f18931bc55794b5c23ceddeaa (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
_pkgname=lustache
pkgname=lua-$_pkgname
pkgver=1.3.1
_pkgver=$pkgver-0
pkgrel=1
pkgdesc="Logic-less {{mustache}} templates with Lua"
url="http://olivinelabs.com/lustache/"
arch="noarch"
license="MIT"
depends=""
makedepends=""
subpackages="$pkgname-common"
for _v in $_luaversions; do
	makedepends="$makedepends lua$_v-dev"
	subpackages="$subpackages lua$_v-${pkgname#lua-}:_package"
done
source="$pkgname-$pkgver.tar.gz::https://github.com/Olivine-Labs/$_pkgname/archive/v$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$_pkgver"

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

common() {
	cd "$builddir"

	mkdir -p "$subpkgdir"/usr/share/lua/common/$_pkgname
	install -m644 src/lustache/*.lua \
		"$subpkgdir"/usr/share/lua/common/$_pkgname/ || return 1
	install -m644 src/lustache.lua \
		"$subpkgdir"/usr/share/lua/common/
}

_package() {
	local lver="${subpkgname:3:3}"
	pkgdesc="$pkgdesc $lver"
	depends="$pkgname-common lua$lver"
	install_if="$pkgname=$pkgver-r$pkgrel lua$lver"
	local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$lver/$_pkgname/$_pkgver"

	mkdir -p "$subpkgdir"/usr/share/lua/$lver
	local path; for path in lustache lustache.lua; do
		ln -s ../common/$path "$subpkgdir"/usr/share/lua/$lver/$path \
			|| return 1
	done

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

md5sums="e4416abe1a822c1b2d4b3a9e702d5795  lua-lustache-1.3.1.tar.gz"
sha256sums="540bd5e1f6d32aa44d5be946d1772910fb73b62fa909ca5a026c115ece4170f0  lua-lustache-1.3.1.tar.gz"
sha512sums="f1ba0bdd38e60957df1995f32a73a16d1b430072af4e14cce530345c74d542021223c0ef41b0f997f88d762bb194fff7119701cd289e16e3e38dfe3f10d0d9d8  lua-lustache-1.3.1.tar.gz"