From e44e6fa3f74bb9956491c3267abf0a953c889c8e Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Mon, 16 Nov 2009 08:49:46 +0700 Subject: [PATCH] merge Signed-off-by: Gwenhael Le Moine --- d/luarocks/luarocks.SlackBuild | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 d/luarocks/luarocks.SlackBuild diff --git a/d/luarocks/luarocks.SlackBuild b/d/luarocks/luarocks.SlackBuild new file mode 100755 index 00000000..91976bfb --- /dev/null +++ b/d/luarocks/luarocks.SlackBuild @@ -0,0 +1,93 @@ +#!/bin/sh -x + +# variables +TMP=/tmp +CWD=$(pwd) + +APP_NAME=luarocks +PKG=$TMP/package-$APP_NAME + +VERSION=1.0.1 + +EXT=tar.gz + +DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO" + +ARCH=i686 +BUILD=2cyco + +PREFIX=/usr + +SLCKFLAGS="-fPIC -O2" + +# nettoyage préalable +rm -fr $PKG $TMP/$APP_NAME-$VERSION + +mkdir -p $PKG + +# mise en place +cd $TMP +tar xf $CWD/$APP_NAME-$VERSION.$EXT +cd $APP_NAME-$VERSION + +# configuration +CFLAGS=$SLCKFLAGS \ +CPPFLAGS=$SLCKFLAGS \ +./configure \ + --prefix=$PREFIX + +# compilation +make -j3 PREFIX=$PREFIX + +# installation +make install DESTDIR=$PKG ROCKS_TREE=$PREFIX/lib64/luarocks #LUADIR=$PREFIX/lib64/lua/5.1 + +mkdir -p $PKG/etc/profile.d/ +cat < $PKG/etc/profile.d/luarocks.sh +#!/bin/sh + +export PATH=$PATH:$PREFIX/lib64/luarocks/bin +EOF +cat < $PKG/etc/profile.d/luarocks.csh +#!/bin/csh + +setenv PATH $PATH:$PREFIX/lib64/luarocks/bin +EOF +chmod +x $PKG/etc/profile.d/* + +# correction +cd $PKG +chown -R root:root * + +mkdir -p $PKG/usr/doc/$APP_NAME-$VERSION +cd $TMP/$APP_NAME-$VERSION +cp -R $DOCS $PKG/usr/doc/$APP_NAME-$VERSION + +[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; + +# Strip binaries +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + + +# embaumement +mkdir -p $PKG/install +cat < $PKG/install/slack-desc +$APP_NAME: $APP_NAME (one line description here) +$APP_NAME: +$APP_NAME: More verbose description here, usually from the README file. +$APP_NAME: +$APP_NAME: +$APP_NAME: +$APP_NAME: +$APP_NAME: +$APP_NAME: +$APP_NAME: see /usr/doc/$APP_NAME-$VERSION for more details +$APP_NAME: +EOF + +# empaquetage +cd $PKG +makepkg -l y -c n $TMP/$APP_NAME-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD.txz