| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | # SlackBuild for guake-0.3.1 / Slamd64 |
|---|
| 4 | # Written by Georg Michelitsch <gm_ail at gmx dot at> |
|---|
| 5 | # Comes with absolutely no warranty, free to modify/distribute |
|---|
| 6 | |
|---|
| 7 | CWD=$(pwd) |
|---|
| 8 | if [ "$TMP" = ""]; then |
|---|
| 9 | TMP=/tmp |
|---|
| 10 | else |
|---|
| 11 | TMP=/tmp/SB64 |
|---|
| 12 | fi |
|---|
| 13 | |
|---|
| 14 | APP=guake |
|---|
| 15 | VERSION=0.3.1 |
|---|
| 16 | ARCH=${ARCH:-x86_64} |
|---|
| 17 | BUILD=${BUILD:-1_gsm} |
|---|
| 18 | DISTRO=${DISTRO:-slamd64} |
|---|
| 19 | PKG=$TMP/package-$APP |
|---|
| 20 | |
|---|
| 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" |
|---|
| 27 | fi |
|---|
| 28 | |
|---|
| 29 | rm -rf $PKG |
|---|
| 30 | mkdir -p $TMP $PKG |
|---|
| 31 | rm -rf $TMP/$APP-$VERSION |
|---|
| 32 | cd $TMP || exit 1 |
|---|
| 33 | tar -zxvf $CWD/$APP-$VERSION.tar.gz || exit 1 |
|---|
| 34 | cd $APP-$VERSION || exit 1 |
|---|
| 35 | chown -R root:root . |
|---|
| 36 | chmod -R u+w,go+r-w,a-s . |
|---|
| 37 | |
|---|
| 38 | CFLAGS="$SLKCFLAGS" \ |
|---|
| 39 | ./configure \ |
|---|
| 40 | --prefix=/usr \ |
|---|
| 41 | --sysconfdir=/etc \ |
|---|
| 42 | --localstatedir=/var \ |
|---|
| 43 | --build=$ARCH-slamd64-linux \ |
|---|
| 44 | --host=$ARCH-slamd64-linux \ |
|---|
| 45 | --libdir=/usr/lib64 |
|---|
| 46 | |
|---|
| 47 | make || exit |
|---|
| 48 | make install DESTDIR=$PKG || exit |
|---|
| 49 | |
|---|
| 50 | mkdir -p $PKG/usr/doc/$APP-$VERSION |
|---|
| 51 | cp -a NEWS ChangeLog AUTHORS INSTALL COPYING README TODO $PKG/usr/doc/$APP-$VERSION |
|---|
| 52 | find $PKG/usr/doc/$APP-$VERSION -type f -exec chmod 664 {} \; |
|---|
| 53 | cat $CWD/$APP.SlackBuild > $PKG/usr/doc/$APP-$VERSION/$APP.SlackBuild |
|---|
| 54 | |
|---|
| 55 | mkdir -p $PKG/install |
|---|
| 56 | cat $CWD/slack-desc > $PKG/install/slack-desc |
|---|
| 57 | |
|---|
| 58 | if [ -e $CWD/doinst.sh.gz ]; then |
|---|
| 59 | zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh |
|---|
| 60 | fi |
|---|
| 61 | |
|---|
| 62 | ( cd $PKG |
|---|
| 63 | find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
|---|
| 64 | find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
|---|
| 65 | ) |
|---|
| 66 | |
|---|
| 67 | if [ -d $PKG/usr/man ]; then |
|---|
| 68 | ( cd $PKG/usr/man |
|---|
| 69 | find . -type f -exec gzip -9 {} \; |
|---|
| 70 | for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done |
|---|
| 71 | ) |
|---|
| 72 | fi |
|---|
| 73 | |
|---|
| 74 | if [ -d $PKG/usr/info ]; then |
|---|
| 75 | gzip -9 $PKG/usr/info/*.info |
|---|
| 76 | rm -f $PKG/usr/info/dir |
|---|
| 77 | fi |
|---|
| 78 | |
|---|
| 79 | cd $PKG |
|---|
| 80 | /sbin/makepkg -l y -c n $TMP/$APP-$VERSION-$ARCH-$BUILD.tgz |
|---|