APKBUILD 1.31 KB
Newer Older
1 2
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
3
_luaversions="5.1 5.2 5.3"
4 5
pkgname=lua-discount
pkgver=1.2.10.1
6 7
pkgrel=4
pkgdesc="Markdown implementation in C for Lua"
8
url="http://asbradbury.org/projects/lua-discount"
9
arch="all"
10
license="BSD"
11 12 13 14 15 16 17
depends=""
subpackages=""
makedepends=""
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-discount:split_${_i/./_}"
done
18
install=
19

20 21 22
source="http://luaforge.net/frs/download.php/3758/lua-discount-1.2.10.1.tar.gz"

build() {
23
	cd "$srcdir"
24
	for i in $_luaversions; do
25 26 27 28 29 30
		cp -r $pkgname-$pkgver $i
		(cd $i
		make INCS="$(pkg-config --cflags lua$i)"
		) || return 1
	done
}
31

32 33
package() {
	cd "$srcdir"
34
	for i in $_luaversions; do
35 36 37
		install -D -m644 $i/discount.so \
			"$pkgdir"/usr/lib/lua/$i/discount.so || return 1
	done
38 39
}

40
_split() {
41 42 43 44
	local _ver=$1
	pkgdesc="$pkgdesc $_ver"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=""
45
	mkdir -p "$subpkgdir"/usr/lib/lua/
46
	mv "$pkgdir"/usr/lib/lua/$_ver "$subpkgdir"/usr/lib/lua/ || return 1
47 48
}

49 50 51 52
for _v in $_luaversions; do
	eval "split_${_v/./_}() { _split $_v; }"
done

53

54
sha512sums="84c26a19d97ca085c785d1916b05bc0c78a2b5a0965d7feeef9a545c4b69c71627791c5d560bcb529c9ed414ed2ebe99f253879d6eae593a5b6f93291d66d5b1  lua-discount-1.2.10.1.tar.gz"