aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lua-net-url
diff options
context:
space:
mode:
authorGuilherme Felipe da Silva <gfsilva.eng@gmail.com>2019-11-21 18:20:34 +0100
committerLeo <thinkabit.ukim@gmail.com>2019-11-25 17:43:34 +0100
commit2b42e5b7ded29e2939c9cb7781ba9ea3ed2ea92a (patch)
tree79fe4f1388a6e3bc9a5bf275c3497425407f3a40 /testing/lua-net-url
parent05e97e0cbd0ea6fe4930df7cf2718aa296a25e1c (diff)
downloadaports-2b42e5b7ded29e2939c9cb7781ba9ea3ed2ea92a.tar.bz2
aports-2b42e5b7ded29e2939c9cb7781ba9ea3ed2ea92a.tar.xz
testing/lua-net-url: new aport
URL and Query string parser, builder, normalizer for Lua Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Diffstat (limited to 'testing/lua-net-url')
-rw-r--r--testing/lua-net-url/APKBUILD55
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/lua-net-url/APKBUILD b/testing/lua-net-url/APKBUILD
new file mode 100644
index 0000000000..c37a7b3433
--- /dev/null
+++ b/testing/lua-net-url/APKBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
+pkgname=lua-net-url
+_rockname=${pkgname#lua-}
+pkgver=0.9
+pkgrel=0
+pkgdesc="URL and Query string parser, builder, normalizer for Lua"
+url="https://github.com/golgote/neturl"
+license="MIT"
+arch="noarch"
+makedepends="luarocks"
+subpackages="${pkgname}-doc"
+options="!check" #test dependencies not available
+source="${_rockname}-${pkgver}.tar.gz::https://github.com/golgote/neturl/archive/${pkgver}-1.tar.gz"
+builddir="${srcdir}/neturl-${pkgver}-1"
+
+_luaversions="5.1 5.2 5.3"
+for _luaversion in $_luaversions; do
+ makedepends="${makedepends} lua${_luaversion}-dev"
+ subpackages="${subpackages} lua${_luaversion}-${_rockname}:_subpackage"
+done
+
+build() {
+ for _luaversion in ${_luaversions}; do
+ msg "Building for Lua ${_luaversion}"
+ "luarocks-${_luaversion}" \
+ CC="$CC" \
+ CFLAGS="$CFLAGS -fPIC" \
+ LUA_INCDIR="$(pkg-config --variable=includedir "lua${_luaversion}")" \
+ LUA_LIBDIR="$(pkg-config --variable=libdir "lua${_luaversion}")" \
+ LUA_VERSION="${_luaversion}" \
+ make --tree="./build-${_luaversion}" \
+ "rockspec/${_rockname}-${pkgver}-"*".rockspec"
+ done
+}
+
+package() {
+ mkdir -p "${pkgdir}/usr/share/doc/${pkgname}/"
+ cp -r "docs/" "${pkgdir}/usr/share/doc/${pkgname}/"
+}
+
+_subpackage() {
+ _luaversion="${subpkgname%-${_rockname}}"
+ _luaversion="${_luaversion#lua*}"
+ pkgdesc="${pkgdesc} - for Lua ${_luaversion}"
+ depends="${depends} lua${_luaversion}"
+ install_if="lua${_luaversion} ${pkgname}=${pkgver}-r${pkgrel}"
+
+ for _luascript in "${builddir}/build-${_luaversion}/share/lua/${_luaversion}/${_rockname%-url}/"*.lua; do
+ install -D -m 644 \
+ -t "${subpkgdir}/usr/share/lua/${_luaversion}/${_rockname%-url}" \
+ "${_luascript}"
+ done
+}
+
+sha512sums="c9a9742d3158e81edc20a972764dc8e85721f9cfa37a430ffce519db9ea3293adc3124f95aa27c380f55eeae36ef398f6c78df285a02eb0896683f53ca369f8e net-url-0.9.tar.gz"