summaryrefslogtreecommitdiffstats
path: root/main/lua-penlight/APKBUILD
blob: 74b14acd1d62eebb1c44de33a8a53ba00d06ea76 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-penlight
pkgver=1.3.1
pkgrel=3
pkgdesc="Lua libraries for extended operations on tables, lists and strings"
url="http://stevedonovan.github.io/Penlight"
arch="noarch"
license="MIT"
depends="lua5.1-penlight lua5.2-penlight"
makedepends=""
install=
subpackages="$pkgname-doc $pkgname-shared
	lua5.1-penlight:_51
	lua5.2-penlight:_52"
source="penlight-$pkgver.tar.gz::https://github.com/stevedonovan/Penlight/archive/$pkgver.tar.gz"

_builddir="$srcdir"/Penlight-$pkgver

build() {
	cd  "$_builddir"
	# fix permissions of scripts
	chmod -x lua/pl/*.lua
}

package() {
	cd "$_builddir"
	mkdir -p "$pkgdir"/usr/share/lua/common/ \
		"$pkgdir"/usr/share/lua/5.1/ \
		"$pkgdir"/usr/share/lua/5.2/ \
		"$pkgdir"/usr/share/doc/$pkgname
	cp -r lua/pl "$pkgdir"/usr/share/lua/common/ || return 1
	cp -r examples "$pkgdir"/usr/share/doc/$pkgname/
	ln -s ../common/pl "$pkgdir"/usr/share/lua/5.1/pl
	ln -s ../common/pl "$pkgdir"/usr/share/lua/5.2/pl
}

shared() {
	pkgdesc="penlight files that are shared for all supported Lua versions"
	depends=
	mkdir -p "$subpkgdir"/usr/share/lua/
	mv "$pkgdir"/usr/share/lua/common "$subpkgdir"/usr/share/lua/
}

_52() {
	pkgdesc="Lua 5.2 libraries for extended operations on tables, lists and strings"
	depends="lua-penlight-shared lua5.2-filesystem"
	mkdir -p "$subpkgdir"/usr/share/lua/
	mv "$pkgdir"/usr/share/lua/5.2 "$subpkgdir"/usr/share/lua/
}

_51() {
	pkgdesc="Lua 5.1 libraries for extended operations on tables, lists and strings"
	replaces="lua-penlight"
	depends="lua-penlight-shared lua5.1-filesystem"
	mkdir -p "$subpkgdir"/usr/share/lua/
	mv "$pkgdir"/usr/share/lua/5.1 "$subpkgdir"/usr/share/lua/
}

md5sums="831f8ce7d3d5c872d129ad5db54a8424  penlight-1.3.1.tar.gz"
sha256sums="0f96ef033d9623ffd561a77088ac5adfd87b35a711fbf34815284d671cf4677c  penlight-1.3.1.tar.gz"
sha512sums="f37972beb6237b3a04ee3be80f43dd33b1f70cd821b05b88d0e3a8271927b32ab73fd4b51332b196e0f22fad4d929ae3024d64cc342f2c2c1032d982dbc2eecb  penlight-1.3.1.tar.gz"