aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-feedparser/APKBUILD
blob: 270f49169eb4a35ef6e4298a559850e93f5eae29 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua-feedparser
_rockname=feedparser
pkgver=0.71
pkgrel=1
pkgdesc="A decent RSS and Atom XML feed parser"
url="https://github.com/slact/lua-feedparser"
arch="noarch"
license="BSD"
depends="lua lua-expat"
provides="$pkgname-common=$pkgver-r$pkgrel"  # for backward compatibility
replaces="$pkgname-common"  # for backward compatibility
source="$pkgname-$pkgver.tar.gz::https://github.com/slact/$pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

# luajit is not available for selected arches
case "$CARCH" in
	s390x) _luajit="";;
	*) checkdepends="$checkdepends luajit" _luajit="jit";;
esac

_luaversions="5.1 5.2 5.3"
for _v in $_luaversions; do
	checkdepends="$checkdepends lua$_v"
	provides="$provides lua$_v-${pkgname#lua-}=$pkgver-r$pkgrel"  # for backward compatibility
done

check() {
	cd "$builddir"

	local lver; for lver in $_luaversions $_luajit; do
		msg "Testing on Lua $lver"
		make test LUA_BIN=lua$lver
	done
}

package() {
	local lmod_dir="$pkgdir/usr/share/lua/common"
	local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$pkgver-3"

	cd "$builddir"

	mkdir -p "$lmod_dir"
	make LUA_DIR="$lmod_dir" install

	mkdir -p "$rockdir"
	echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
}

sha512sums="8a65947b5472321fc162ec325c31e4d92e52e6cba6952c01c9941a7596403ed495ee464bfc32f5fdda3c58d33fae3a3b38882f7f22ecc16360c6603cd7ab4d4d  lua-feedparser-0.71.tar.gz"