#!/bin/sh # Slackware build script for LeScienze500 - http://lescienze500.wordpress.com # Written by Michele Petrecca michelinux@alice.it PRGNAM=lescienze500 VERSION=${VERSION:-1.3.3} ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-sl} CWD=$(pwd) TMP=${TMP:-/tmp/txz} PKG=$TMP/package-$PRGNAM echo -e "\e[0;32m+----------------------------------------+" echo "| Starting SlackBuild $PRGNAM-$VERSION |" echo -e "+----------------------------------------+\e[0;0m" SOURCE=https://github.com/downloads/simon-r/LeScienze500/$PRGNAM'-'$VERSION.tar.gz/download if [ ! -e $PRGNAM'-'$VERSION.tar.gz ]; then echo "+--------------------+" echo "| Downloading source |" echo "+--------------------+" wget -c $SOURCE fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" fi set -e rm -rf $PKG mkdir -p $TMP $PKG cd $TMP rm -rf $PRGNAM-$VERSION tar xzvf $CWD/$PRGNAM'-'$VERSION.tar.gz cd $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 {} \; echo -e "\e[0;32m+-------------+" echo "| ./configure |" echo "+-------------+" # Configure qmake -unix PREFIX=/usr QMAKE_CFLAGS="$SLKCFLAGS" QMAKE_CXXFLAGS="$SLKCFLAGS" -o Makefile LeScienze500.pro echo -e "\e[0;33m+---------------+" echo "| Starting Make |" echo "+---------------+" # Compile the application and install it into the $PKG directory make echo -e "\e[0;31m+-----------------------+" echo "| Starting Make Install |" echo -e "+-----------------------+\e[0;0m" mkdir -p $PKG/usr/bin install -m 755 -p "LeScienze500" "$PKG/usr/bin/LeScienze500" # Strip binaries strip --strip-unneeded $PKG/usr/bin/* # Copy program documentation into the package # Also, include the SlackBuild script in the documentation directory mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ LEGGIMI.txt License_gpl.txt \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/usr/share/icons/hicolor/ cp -f -r src/icons/* $PKG/usr/share/icons/hicolor/ mkdir -p $PKG/usr/share/applications install -m 644 -p src/lescienze500.desktop $PKG/usr/share/applications/ # Copy the slack-desc (and a custom doinst.sh if necessary) into ./install mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc echo -e "\e[0;36m+------------------+" echo "| Make the package |" echo "+------------------+" # Make the package cd $PKG requiredbuilder -v -y -s $CWD $PKG /sbin/makepkg -l y -c n $CWD/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} #Clean up file temp if [ "$1" = "--cleanup" ]; then echo -e "\e[0;0m+-----------------------------------+" echo "| Clean up file temp and folder txz |" echo "+-----------------------------------+" rm -rf $TMP fi echo "+-----------------------------------------------------------------+" echo "| Package $PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} has been created! :-)) |" echo "+-----------------------------------------------------------------+"