aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-29 13:01:08 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-29 13:32:25 +0000
commit7cd5b51b363757743d2d200e56651f6e3d3c7dfd (patch)
tree30dbfc0e799397bc0d18aa9b9fd8dc16c21e659d
parent347df81939c6a90347e4bb45bd79f61fd279c146 (diff)
downloadaports-7cd5b51b363757743d2d200e56651f6e3d3c7dfd.tar.bz2
aports-7cd5b51b363757743d2d200e56651f6e3d3c7dfd.tar.xz
main/lua5.1: improve abuild
-rw-r--r--main/lua5.1/APKBUILD64
1 files changed, 31 insertions, 33 deletions
diff --git a/main/lua5.1/APKBUILD b/main/lua5.1/APKBUILD
index 803558bb7..49136fd93 100644
--- a/main/lua5.1/APKBUILD
+++ b/main/lua5.1/APKBUILD
@@ -1,32 +1,28 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lua5.1
-pkgver=5.1.5
-_ver=$pkgver
+_pkgname=lua
+_majorver=${pkgname#lua}
+pkgver="$_majorver.5"
+_pkgver=$pkgver
pkgrel=1
pkgdesc="A powerful light-weight programming language designed for extending applications."
url="http://www.lua.org/"
arch="all"
license="MIT"
-depends=
+depends=""
makedepends="libtool autoconf automake"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
-source="http://www.lua.org/ftp/lua-$_ver.tar.gz
+source="http://www.lua.org/ftp/lua-$_pkgver.tar.gz
lua-5.1-make.patch
lua-5.1-module_paths.patch
lua-5.1-readline.patch
"
+builddir="$srcdir/lua-$_pkgver"
-_builddir="$srcdir"/lua-$_ver
prepare() {
- cd "$_builddir"
- for i in $source; do
- case $i in
- patch*|*.patch)
- msg "Applying $i"
- patch -p1 -i "$srcdir"/$i || return 1
- ;;
- esac
- done
+ default_prepare || return 1
+
+ cd "$builddir"
# we want packages to find our things
sed -i -e 's:/usr/local:/usr:' etc/lua.pc
@@ -35,25 +31,26 @@ prepare() {
sed -i -e 's/\(LIB_VERSION = \).*/\16:4:1/' src/Makefile
# we use libtool
- cat >configure.ac <<EOF
-top_buildir=.
+ cat > configure.ac <<-EOF
+ top_buildir=.
+
+ AC_INIT(src/luaconf.h)
+ AC_PROG_LIBTOOL
+ AC_OUTPUT()
+ EOF
-AC_INIT(src/luaconf.h)
-AC_PROG_LIBTOOL
-AC_OUTPUT()
-EOF
libtoolize --force --install && aclocal && autoconf
}
build() {
- cd "$_builddir"
+ cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
|| return 1
- cd "$_builddir"/src
+ cd "$builddir"/src
make CFLAGS=" -DLUA_USE_LINUX $CFLAGS" \
RPATH="/usr/lib" \
LIB_LIBS="-lpthread -lm -ldl" \
@@ -62,35 +59,36 @@ build() {
}
package() {
- cd "$_builddir"
+ cd "$builddir"
+
make V=$pkgver \
- INSTALL_TOP="$pkgdir"/usr \
- INSTALL_INC="$pkgdir"/usr/include \
- INSTALL_LIB="$pkgdir"/usr/lib \
+ INSTALL_TOP="$pkgdir/usr" \
+ INSTALL_INC="$pkgdir/usr/include" \
+ INSTALL_LIB="$pkgdir/usr/lib" \
alpine_install || return 1
- for i in "$pkgdir"/usr/bin/*; do
- mv $i ${i}5.1
+ local i; for i in "$pkgdir"/usr/bin/*; do
+ mv $i ${i}$_majorver || return 1
done
- install -D -m 644 etc/lua.pc "$pkgdir"/usr/lib/pkgconfig/lua5.1.pc
- install -D -m 644 doc/lua.1 "$pkgdir"/usr/share/man/man1/lua5.1.1
- install -D -m 644 doc/luac.1 "$pkgdir"/usr/share/man/man1/luac5.1.1
+ install -D -m 644 etc/lua.pc "$pkgdir"/usr/lib/pkgconfig/lua$_majorver.pc
+ install -D -m 644 doc/lua.1 "$pkgdir"/usr/share/man/man1/lua$_majorver.1
+ install -D -m 644 doc/luac.1 "$pkgdir"/usr/share/man/man1/luac$_majorver.1
}
dev() {
- default_dev
+ default_dev || return 1
replaces="lua-dev"
}
libs() {
pkgdesc="Lua dynamic library runtime"
replaces="lua lua-libs"
+
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
}
-
md5sums="2e115fe26e435e33b0d5c022e4490567 lua-5.1.5.tar.gz
7fa6ce1f09e18415f2ba00db437f2804 lua-5.1-make.patch
e60ef15deefb72a5930c498f1184aced lua-5.1-module_paths.patch