aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-discount/APKBUILD
blob: 249bdca876bcb54a71a488bb9883ca357260d9d8 (plain) (blame)
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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-discount
pkgver=1.2.10.1
pkgrel=3
pkgdesc="Lua binding to discount, a Markdown implementation in C"
url="http://asbradbury.org/projects/lua-discount"
arch="all"
license="BSD"
depends="lua5.1-discount lua5.2-discount"
makedepends="lua5.1-dev lua5.2-dev"
install=
subpackages="lua5.1-discount:_lua51 lua5.2-discount:_lua52"

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

build() {
	cd "$srcdir"

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

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

_split() {
	pkgdesc="Lua $1 binding to discount, a Markdown implementation in C"
	mkdir -p "$subpkgdir"/usr/lib/lua/
	mv "$pkgdir"/usr/lib/lua/$1 "$subpkgdir"/usr/lib/lua/ || return 1
}

_lua51() { _split 5.1; }
_lua52() { _split 5.2; }

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