9c9d25136d
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
114 lines
2.8 KiB
Bash
Executable file
114 lines
2.8 KiB
Bash
Executable file
#!/bin/sh
|
|
set -x
|
|
|
|
PRGNAM=love
|
|
VERSION=$(date +%Y.%m.%d_%H.%M) #0.7.0
|
|
RELEASE_ID=20091214-301312c82b00
|
|
|
|
|
|
BUILD=1
|
|
|
|
ARCH=$(uname -m)
|
|
LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)")
|
|
|
|
CWD=$(pwd)
|
|
TAG=cyco
|
|
OUTPUT=/tmp
|
|
TMP=/tmp/$TAG
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
PREFIX=/usr
|
|
|
|
REPOSITORIES=/home/cycojesus/projets/packages/repositories/
|
|
|
|
# Cleaning
|
|
( cd $TMP
|
|
rm -fr $PRGNAM-$VERSION
|
|
rm -fr $PKG
|
|
)
|
|
|
|
# Fetching sources
|
|
( cd $TMP
|
|
if [ -e $CWD/$PRGNAM-$VERSION-linux-src.tar.?z* ]; then
|
|
tar xvf $CWD/$PRGNAM-$VERSION-linux-src.tar.?z*
|
|
find . -type d -name "$PRGNAM-*-*" -exec mv {} $PRGNAM-$VERSION \;
|
|
else
|
|
[ ! -e $REPOSITORIES ] && mkdir -p $REPOSITORIES
|
|
if [ -e $REPOSITORIES/$PRGNAM ]; then
|
|
( cd $REPOSITORIES/$PRGNAM
|
|
hg pull -u
|
|
)
|
|
else
|
|
hg clone http://bitbucket.org/rude/love $REPOSITORIES/$PRGNAM
|
|
fi
|
|
cp -R $REPOSITORIES/$PRGNAM $TMP/$PRGNAM-$VERSION
|
|
fi
|
|
)
|
|
|
|
# Preparation
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find . \
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
-exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
-exec chmod 644 {} \;
|
|
)
|
|
|
|
# Configuration
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
[ ! -e ./configure ] && ./platform/unix/automagic
|
|
./configure \
|
|
--prefix=$PREFIX \
|
|
--mandir=$PREFIX/man \
|
|
--libdir=$PREFIX/lib64
|
|
)
|
|
|
|
# Building
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
make
|
|
)
|
|
|
|
# Installation
|
|
mkdir -p $PKG$PREFIX/{bin,lib$LIBSUFFIX/$PRGNAM,man/man1}
|
|
( cd $TMP/$PRGNAM-$VERSION
|
|
make install DESTDIR=$PKG
|
|
# cleaning empty directories
|
|
rm -fr $PKG$PREFIX/man $PKG$PREFIX/lib64
|
|
)
|
|
|
|
# Cleaning
|
|
( 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
|
|
|
|
find ./man -type f -name "*.?" -exec gzip -9 {} \;
|
|
|
|
chown -R root:root .
|
|
find . \
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
-exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
-exec chmod 644 {} \;
|
|
)
|
|
|
|
# Packaging
|
|
( cd $PKG
|
|
mkdir install
|
|
cat <<EOF > install/slack-desc
|
|
$PRGNAM: $PRGNAM (lua 2D game engine)
|
|
$PRGNAM:
|
|
$PRGNAM: LÖVE is an unquestionably awesome 2D game engine, which allows rapid game
|
|
$PRGNAM: development and prototyping in Lua.
|
|
$PRGNAM:
|
|
$PRGNAM: Requires a lot of libraries: mpg123-1.x, OpenAL, libmodplug, DevIL, PhysicsFS
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM:
|
|
$PRGNAM: http://love2d.org/
|
|
$PRGNAM:
|
|
EOF
|
|
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz
|
|
)
|
|
|