73 lines
2 KiB
Text
73 lines
2 KiB
Text
|
#!/bin/sh
|
||
|
|
||
|
CWD=$(pwd)
|
||
|
|
||
|
PRGNAM=$(basename $CWD)
|
||
|
VERSION=git$(date +%F | tr -d -)
|
||
|
BUILD=1
|
||
|
PACKAGER=cyco
|
||
|
ARCH=$(uname -m)
|
||
|
|
||
|
REPOSITORIES=/home/cycojesus/projets/packages/repositories
|
||
|
|
||
|
TMP=/tmp/$PACKAGER
|
||
|
PKG=$TMP/pkg-$PRGNAM
|
||
|
OUTPUT=/tmp
|
||
|
|
||
|
PREFIX=/usr
|
||
|
|
||
|
# cleaning
|
||
|
rm -fr $PKG
|
||
|
|
||
|
# get sources
|
||
|
[ ! -e $REPOSITORIES ] && mkdir -p $REPOSITORIES
|
||
|
( cd $REPOSITORIES
|
||
|
if [ -e $REPOSITORIES/$PRGNAM ] ; then
|
||
|
( cd $REPOSITORIES/$PRGNAM
|
||
|
git pull
|
||
|
)
|
||
|
else
|
||
|
git clone http://luajit.org/git/luajit-2.0.git $REPOSITORIES/$PRGNAM
|
||
|
fi
|
||
|
)
|
||
|
|
||
|
( cd $TMP
|
||
|
rm -fr $PRGNAM-$VERSION && cp -R $REPOSITORIES/$PRGNAM $PRGNAM-$VERSION
|
||
|
( cd $PRGNAM-$VERSION
|
||
|
sed -i "s|/usr/local|$PREFIX|g" Makefile src/luaconf.h
|
||
|
sed -i 's|$(INSTALL_SHARE)/man/man1|$(DPREFIX)/man/man1|g' Makefile
|
||
|
echo "$ARCH" | grep -q 64 && sed -i "s|/lib|/lib64|g" Makefile src/luaconf.h
|
||
|
echo "$ARCH" | grep -q 64 && sed -i "s|lib/|lib64/|g" Makefile src/luaconf.h
|
||
|
make
|
||
|
make DESTDIR=$PKG install
|
||
|
)
|
||
|
)
|
||
|
|
||
|
( cd $PKG
|
||
|
mkdir -p install
|
||
|
cat <<EOF > install/slack-desc
|
||
|
$PRGNAM: $PRGNAM (a Just-In-Time Compiler for Lua.)
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: LuaJIT implements the full set of language features defined by Lua 5.1.
|
||
|
$PRGNAM: The virtual machine (VM) is API- and ABI-compatible to the standard Lua
|
||
|
$PRGNAM: interpreter and can be deployed as a drop-in replacement.
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: LuaJIT offers more performance, at the expense of portability. It currently
|
||
|
$PRGNAM: runs on all popular operating systems based on x86 or x64 CPUs
|
||
|
$PRGNAM:
|
||
|
$PRGNAM: http://luajit.org/luajit.html
|
||
|
$PRGNAM:
|
||
|
EOF
|
||
|
|
||
|
chown -R root:root *
|
||
|
|
||
|
[ -d $PKG/usr/man ] && find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
|
||
|
|
||
|
( 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
|
||
|
)
|
||
|
|
||
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$PACKAGER.txz
|
||
|
)
|