APKBUILD 1.99 KB
Newer Older
1
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
2
pkgname=lua-penlight
3
pkgver=1.3.1
Natanael Copa's avatar
Natanael Copa committed
4
pkgrel=3
5
pkgdesc="Lua libraries for extended operations on tables, lists and strings"
6
url="http://stevedonovan.github.io/Penlight"
7
arch="noarch"
8 9
license="MIT"
depends="lua5.1-penlight lua5.2-penlight"
10
makedepends=""
11
install=
12 13 14
subpackages="$pkgname-doc $pkgname-shared
	lua5.1-penlight:_51
	lua5.2-penlight:_52"
15
source="penlight-$pkgver.tar.gz::https://github.com/stevedonovan/Penlight/archive/$pkgver.tar.gz"
16

17
_builddir="$srcdir"/Penlight-$pkgver
18 19

build() {
20 21 22
	cd  "$_builddir"
	# fix permissions of scripts
	chmod -x lua/pl/*.lua
23 24 25 26
}

package() {
	cd "$_builddir"
27 28
	mkdir -p "$pkgdir"/usr/share/lua/common/ \
		"$pkgdir"/usr/share/lua/5.1/ \
29
		"$pkgdir"/usr/share/lua/5.2/ \
30
		"$pkgdir"/usr/share/doc/$pkgname
31
	cp -r lua/pl "$pkgdir"/usr/share/lua/common/ || return 1
32
	cp -r examples "$pkgdir"/usr/share/doc/$pkgname/
33 34 35 36 37 38 39 40 41
	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/
42 43 44
}

_52() {
45
	pkgdesc="Lua 5.2 libraries for extended operations on tables, lists and strings"
Natanael Copa's avatar
Natanael Copa committed
46
	depends="lua-penlight-shared lua5.2-filesystem"
47 48 49 50 51
	mkdir -p "$subpkgdir"/usr/share/lua/
	mv "$pkgdir"/usr/share/lua/5.2 "$subpkgdir"/usr/share/lua/
}

_51() {
52
	pkgdesc="Lua 5.1 libraries for extended operations on tables, lists and strings"
53
	replaces="lua-penlight"
Natanael Copa's avatar
Natanael Copa committed
54
	depends="lua-penlight-shared lua5.1-filesystem"
55 56
	mkdir -p "$subpkgdir"/usr/share/lua/
	mv "$pkgdir"/usr/share/lua/5.1 "$subpkgdir"/usr/share/lua/
57 58
}

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