misc changes
[grissiom.SlackBuilds.git] / qstardict / qstardict.SlackBuild
blobb2a6961e4fdca1465bfadd7a761a4da58dcbfb4d
1 #!/bin/sh
3 # Slackware build script for qstardict
5 # Written by grissiom chaos.proton@gmail.com
7 PRGNAM=qstardict
8 VERSION=${VERSION:-0.12.7}
9 ARCH=${ARCH:-i486}
10 BUILD=${BUILD:-1}
11 TAG=${TAG:-_SBo}
13 CWD=$(pwd)
14 TMP=${TMP:-/tmp/SBo}
15 PKG=$TMP/package-$PRGNAM
16 OUTPUT=${OUTPUT:-/tmp}
18 JOBS=${JOBS:-3}
19 MAKEOPT="-s -j $JOBS"
21 if [ "$ARCH" = "i486" ]; then
22 SLKCFLAGS="-O2 -march=i486 -mtune=i686"
23 elif [ "$ARCH" = "i686" ]; then
24 SLKCFLAGS="-O2 -march=i686 -mtune=i686"
25 elif [ "$ARCH" = "x86_64" ]; then
26 SLKCFLAGS="-O2 -fPIC"
29 set -e
31 rm -rf $PKG
32 mkdir -p $TMP $PKG $OUTPUT
33 cd $TMP
34 rm -rf $PRGNAM-$VERSION
35 tar jxvf $CWD/$PRGNAM-$VERSION.tar.bz2
36 cd $PRGNAM-$VERSION
37 chown -R root:root .
38 find . \
39 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
40 -exec chmod 755 {} \; -o \
41 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
42 -exec chmod 644 {} \;
44 qmake-qt4 \
45 QMAKE_CXXFLAGS="$SLKCFLAGS"
47 make $MAKEOPT
48 make install INSTALL_ROOT=$PKG
50 ( cd $PKG
51 find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
52 find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
55 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
56 cp -a AUTHORS ChangeLog COPYNG INSTALL README THANKS $PKG/usr/doc/$PRGNAM-$VERSION
57 cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
59 mkdir -p $PKG/install
60 cat $CWD/slack-desc > $PKG/install/slack-desc
62 cd $PKG
63 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz