void-packages/srcpkgs/lua51/template
2020-10-30 22:41:26 +07:00

68 lines
1.9 KiB
Bash

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