#!/bin/bash # # lua.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # lua.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="lua" PACKAGE_EXT="gz" VERSION=${VERSION:=5.3.4} BUILD=${BUILD:=2} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://www.lua.org/ftp/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # Fix up a to-be-installed header sed -i "s|lib/lua|lib$LIBDIRSUFFIX/lua|" src/luaconf.h _majorver=${VERSION%.*} patch -p1 -i $CWD/liblua.so.patch make \ MYCFLAGS="$SLKCFLAGS -fPIC -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" \ MYLDFLAGS="$SLKLDFLAGS" \ MYLIBS=-ltermcap \ linux make \ TO_LIB="liblua.a liblua.so liblua.so.$_majorver liblua.so.$VERSION" \ INSTALL_DATA='cp -d' \ INSTALL_TOP=$PKG/usr \ INSTALL_LIB=$PKG/usr/lib${LIBDIRSUFFIX} \ INSTALL_CMOD=$PKG/usr/lib${LIBDIRSUFFIX}/lua/5.3 \ INSTALL_MAN=$PKG/usr/man/man1 \ install # and install the pkgconfig file mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig cat $CWD/lua.pc > $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/lua53.pc sed -i \ -e "s|prefix}/lib|prefix}/lib${LIBDIRSUFFIX}|g" \ -e "s:^V=.*:V= 5.3:" \ -e "s:^R=.*:R= ${VERSION}:" \ $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/lua53.pc ln -sf /usr/lib${LIBDIRSUFFIX}/pkgconfig/lua53.pc $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/lua.pc mkdir -p $DOCS/html cp -a README $DOCS cp -a doc/*.html doc/logo.gif doc/lua.css $DOCS/html fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi