void-packages/srcpkgs/lua52/template

69 lines
1.8 KiB
Bash

# Template file for 'lua52'
pkgname=lua52
version=5.2.4
revision=11
wrksrc=lua-${version}
makedepends="ncurses-devel readline-devel"
short_desc="Powerful, fast, lightweight, embeddable scripting language (5.2.x)"
maintainer="q66 <daniel@octaforge.org>"
license="MIT"
homepage="https://www.lua.org"
distfiles="https://www.lua.org/ftp/lua-$version.tar.gz"
checksum=b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b
alternatives="
lua:lua:/usr/bin/lua5.2
lua:luac:/usr/bin/luac5.2
lua:lua.1:/usr/share/man/man1/lua5.2.1
lua:luac.1:/usr/share/man/man1/luac5.2.1
"
do_build() {
sed -i src/Makefile -r \
-e '/^LUA_(SO|A|T)=/ s;lua;lua5.2;' \
-e '/^LUAC_T=/ s;luac;luac5.2;'
make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" \
CC="$CC" RANLIB="$RANLIB" \
INSTALL_DATA="cp -d" LUA_SO=liblua5.2.so ${makejobs} linux
}
do_install() {
make INSTALL_DATA="cp -d" INSTALL_TOP="${DESTDIR}/usr" \
TO_BIN="lua5.2 luac5.2" \
TO_LIB="liblua5.2.a liblua5.2.so liblua5.2.so.${version%.*} liblua5.2.so.${version}" \
INSTALL_INC="${DESTDIR}/usr/include/lua5.2" \
INSTALL_MAN="${DESTDIR}/usr/share/man/man1" install
sed ${FILESDIR}/lua.pc \
-e "s;%VER%;${version%.*};g;s;%REL%;${version};g" \
> lua5.2.pc
vinstall lua5.2.pc 644 usr/lib/pkgconfig
# Install the documentation
rm -f doc/*.1
vmkdir usr/share/doc/lua5.2
cp -R doc/* ${DESTDIR}/usr/share/doc/lua5.2
vlicense doc/readme.html
# Rename man pages
mv ${DESTDIR}/usr/share/man/man1/lua{,5.2}.1
mv ${DESTDIR}/usr/share/man/man1/luac{,5.2}.1
}
lua52-devel_package() {
depends="${makedepends} lua52>=${version}_${revision}"
short_desc+=" - development files"
alternatives="
lua-devel:lua:/usr/share/doc/lua5.2
lua-devel:lua.pc:/usr/lib/pkgconfig/lua5.2.pc
"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/lib/pkgconfig
vmove usr/share/doc
}
}