aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-feedparser/APKBUILD
blob: 451f6ae76d2985dbc45541f7effbe9aba57503e3 (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
62
63
64
65
66
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
_luaversions="5.1 5.2"
pkgname=lua-feedparser
_name=feedparser
pkgver=0.7
pkgrel=0
pkgdesc="A decent RSS and Atom XML feed parser"
url="https://github.com/slact/lua-feedparser"
arch="noarch"
license="BSD"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-common"

for _i in $_luaversions; do
	makedepends="$makedepends lua${_i}-dev"
	subpackages="$subpackages lua${_i}-$_name:_split${_i/./}"
	depends="$depends lua${_i}-$_name"
done

source="http://dev.alpinelinux.org/archive/lua-feedparser/lua-feedparser-$pkgver.tar.gz"

_builddir="$srcdir"/lua-feedparser-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	return 0
}

package() {
	cd "$_builddir"
	mkdir -p "$pkgdir"/usr/share/lua/common
	make LUA_DIR="$pkgdir"/usr/share/lua/common install || return 1
}

common() {
	mkdir -p "$subpkgdir"
	mv "$pkgdir"/usr "$subpkgdir"/
}

_split() {
	pkgdesc="$pkgdesc for Lua $1"
	depends="lua$1-expat lua-feedparser-common"
	mkdir -p "$subpkgdir"/usr/share/lua/$1
	ln -s ../common/feedparser "$subpkgdir"/usr/share/lua/$1/
	ln -s ../common/feedparser.lua "$subpkgdir"/usr/share/lua/$1/
}

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

md5sums="0bd8d7711c8144df7a77a0c8e9a53d30  lua-feedparser-0.7.tar.gz"
sha256sums="c6a6f8123a680ad8a32122777eb3396bf9b26c6167086253827e7e24fcf90cd0  lua-feedparser-0.7.tar.gz"
sha512sums="dc901c5a17ddb6f3d0eccbf9c85a04e18491ef9ebbab9eec8440100fb7b2058d1f6bc568fa9a4ce2644a9e475410e8c21276f4a19a8f9f7ab68c4aff878e2195  lua-feedparser-0.7.tar.gz"