diff options
Diffstat (limited to 'main/lua-md5')
-rw-r--r-- | main/lua-md5/APKBUILD | 63 |
1 files changed, 52 insertions, 11 deletions
diff --git a/main/lua-md5/APKBUILD b/main/lua-md5/APKBUILD index 9901639ea4..07f275c90f 100644 --- a/main/lua-md5/APKBUILD +++ b/main/lua-md5/APKBUILD @@ -1,25 +1,66 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> +_luaversions="5.1 5.2" pkgname="lua-md5" _name="md5" -pkgver=1.1.2 -pkgrel=2 +pkgver=1.2 +pkgrel=1 pkgdesc="Basic cryptographic facilities for Lua" url="http://www.keplerproject.org/md5/" arch="all" license="MIT" -depends="lua" -makedepends="lua-dev" -source="http://luaforge.net/frs/download.php/3355/$_name-$pkgver.tar.gz" -replaces="md5" +depends="lua5.1-md5" +makedepends="" +subpackages="" +for _i in $_luaversions; do + makedepends="$makedepends lua$_i-dev" + subpackages="$subpackages lua$_i-md5:split_${_i/./_}" +done +source="lua-md5-$pkgver.tar.gz::https://github.com/keplerproject/md5/archive/v$pkgver.tar.gz" + +_sdir="$srcdir"/md5-$pkgver +prepare() { + cd "$_sdir" + sed -i -e "s:^PREFIX.*=.*:PREFIX =/usr:" \ + config || return 1 + rm src/*.o + + for _i in $_luaversions; do + cp -r "$_sdir" "$srcdir"/build-$_i + sed -i -e "s/5.1/$_i/" "$srcdir"/build-$_i/config || return 1 + done +} build() { - cd "$srcdir/$_name-$pkgver" - make CFLAGS="$CFLAGS" || return 1 + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + make CFLAGS="$CFLAGS $(pkg-config --cflags lua$_i)" || return 1 + done } package() { - cd "$srcdir/$_name-$pkgver" - make PREFIX="$pkgdir"/usr install + for _i in $_luaversions; do + cd "$srcdir"/build-$_i + make PREFIX="$pkgdir"/usr install + done } -md5sums="68874cff64547f2157d5ecdc3572b544 md5-1.1.2.tar.gz" +_split() { + local d= _ver=$1 + pkgdesc="Basic cryptographic facilities for Lua $_ver" + replaces="$pkgname" + depends= + for d in usr/lib/lua usr/share/lua; do + if [ -d "$pkgdir"/$d/$_ver ]; then + mkdir -p "$subpkgdir"/$d + mv "$pkgdir"/$d/$_ver "$subpkgdir"/$d/ || return 1 + fi + done +} + +for _i in $_luaversions; do + eval "split_${_i/./_}() { _split $_i; }" +done + +md5sums="c166f8a983401802a86655a8c733441e lua-md5-1.2.tar.gz" +sha256sums="3c016da2cf0cfeb5dfdcf3bea82b64935c4faa6eec32ae164c48d870b4583ffa lua-md5-1.2.tar.gz" +sha512sums="1d0925351b4b774581f78147b7dd44df649eec2bc8397db991149feaf1f16c8f26d4b0fce6d8463be656115cebf605339ba8da851bc50d1ae1da8033d4ed564d lua-md5-1.2.tar.gz" |