void-packages/srcpkgs/lua52/template

77 lines
2.2 KiB
Bash
Raw Normal View History

# Template file for 'lua52'
pkgname=lua52
version=5.2.4
2015-11-30 17:23:59 +00:00
revision=5
wrksrc=lua-${version}
makedepends="ncurses-devel readline-devel"
2015-11-30 17:23:59 +00:00
short_desc="Powerful, fast, lightweight, embeddable scripting language (5.2.x)"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.lua.org"
license="MIT"
distfiles="http://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
lua:lua:/usr/include/lua5.2
lua:/usr/include/lua.h:/usr/include/lua5.2/lua.h
lua:/usr/include/luaconf.h:/usr/include/lua5.2/luaconf.h
lua:/usr/include/lua.hpp:/usr/include/lua5.2/lua.hpp
lua:/usr/include/lualib.h:/usr/include/lua5.2/lualib.h
lua:/usr/include/lauxlib.h:/usr/include/lua5.2/lauxlib.h
lua:lua.pc:/usr/lib/pkgconfig/lua5.2.pc
lua:liblua.a:/usr/lib/liblua5.2.a
lua:liblua.so:/usr/lib/liblua5.2.so
lua:lua:/usr/share/doc/lua5.2
"
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" \
-e "s;llua;llua5.2;" \
-e "s;/include;/include/lua5.2;" \
> 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
2015-10-02 10:46:47 +00:00
# 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"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/lib/pkgconfig
vmove usr/share/doc
}
}