aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-discount/APKBUILD
blob: dd3699c91e161b08bef1244a0b9d9c490ca8e24b (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2 5.3"
pkgname=lua-discount
pkgver=1.2.10.1
pkgrel=4
pkgdesc="Markdown implementation in C for Lua"
url="http://asbradbury.org/projects/lua-discount"
arch="all"
license="BSD"
depends=""
subpackages=""
makedepends=""
for _i in $_luaversions; do
	makedepends="$makedepends lua$_i-dev"
	subpackages="$subpackages lua$_i-discount:split_${_i/./_}"
done
install=

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

build() {
	cd "$srcdir"
	for i in $_luaversions; do
		cp -r $pkgname-$pkgver $i
		(cd $i
		make INCS="$(pkg-config --cflags lua$i)"
		) || return 1
	done
}

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

_split() {
	local _ver=$1
	pkgdesc="$pkgdesc $_ver"
	install_if="lua$_ver $pkgname=$pkgver-r$pkgrel"
	depends=""
	mkdir -p "$subpkgdir"/usr/lib/lua/
	mv "$pkgdir"/usr/lib/lua/$_ver "$subpkgdir"/usr/lib/lua/ || return 1
}

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


md5sums="7dc7055816dc755aacb48bfd5eb2eb5b  lua-discount-1.2.10.1.tar.gz"