slackbuilds/xap/UNUSED/aqemu/aqemu.SlackBuild
Gwenhael Le Moine 0da671b6e8 big spring cleanup, putting aside currently unused scripts
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
2013-03-25 22:41:45 +01:00

103 lines
2.3 KiB
Bash
Executable file

#!/bin/sh -x
# variables
CWD=$(pwd)
PRGNAM=$(basename $CWD)
BRANCH=master
VERSION=${VERSION:-${BRANCH}_$(date +"%Y.%m.%d_%H.%M")}
ARCH=${ARCH:-$(uname -m)}
BUILD=1
TAG=cyco
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
REPOSITORIES=/home/installs/SlackBuilds/repositories
PREFIX=/usr
SLCKFLAGS=""
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
mkdir -p $PKG
# mise en place
cd $TMP
SRC_PATH=$REPOSITORIES/$PRGNAM
if [ -e $CWD/$PRGNAM-$VERSION.tar.?z* ] ; then
tar xf $CWD/$PRGNAM-$VERSION.tar.?z*
SRC_PATH=.
cd $TMP/$PRGNAM-$VERSION
else
if [ ! -e $REPOSITORIES/$PRGNAM ]; then
git clone git://aqemu.git.sourceforge.net/gitroot/aqemu/aqemu $REPOSITORIES/$PRGNAM
else
( cd $REPOSITORIES/$REPO_NAME
git pull
)
fi
rm -fr $TMP/$PRGNAM-$VERSION
mkdir -p $TMP/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
fi
sed -i "s|/usr/local|$PREFIX|g" main.cpp
# configuration
cmake \
-DPREFIX=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DSYSCONFDIR=/etc \
-DMAN_PAGE_COMPRESSOR=gzip \
$SRC_PATH
# compilation
make -j3 PREFIX=$PREFIX
# installation
make install PREFIX=$PREFIX DESTDIR=$PKG
# correction
cd $PKG
chown -R root:root *
find $PKG -name \.git\* -exec rm -fr {} \;
[ -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 <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Graphic frontend for qemu)
$PRGNAM:
$PRGNAM: AQEMU is GUI to QEMU and KVM emulators, written in Qt4. The program have
$PRGNAM: user-friendly interface and allows to set up the majority of QEMU and KVM
$PRGNAM: options.
$PRGNAM:
$PRGNAM:
$PRGNAM: http://aqemu.sourceforge.net/
$PRGNAM: see /usr/doc/$PRGNAM-$VERSION for more details
$PRGNAM:
EOF
if [ $INCLUDE_OBVIOUS == 1 ] ; then
echo "$PRGNAM: [ include obvious ( http://$PRGNAM.naquadah.org/wiki/Obvious ) ]" >> $PKG/install/slack-desc
else
echo "$PRGNAM:" >> $PKG/install/slack-desc
fi
# empaquetage
cd $PKG
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz