File indexing completed on 2024-12-22 03:52:33

0001 #!/bin/sh
0002 # Heavily based on the Slackware 10.2 SlackBuild
0003 # https://gna.org/projects/ksirk
0004 # Packagers Andrea Sciucca Gohanz ( gohanz@infinito.it)
0005 # http://www.slacky.it
0006 
0007 CWD=`pwd`
0008 if [ "$TMP" = "" ]; then
0009   TMP=/tmp
0010 fi
0011 
0012 PKG=$TMP/package-ksirk
0013 NAME=ksirk
0014 VERSION=1.6
0015 TARGET=i486
0016 ARCH=i486
0017 BUILD=1as
0018 
0019 if [ "$ARCH" = "i486" ]; then
0020   SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
0021 elif [ "$ARCH" = "i686" ]; then
0022   SLKCFLAGS="-O2 -march=i686 -mcpu=i686"
0023 elif [ "$ARCH" = "x86_64" ]; then
0024   SLKCFLAGS="-O2"
0025 elif [ "$ARCH" = "athlonxp" ]; then 
0026   SLKCFLAGS="-O3 -march=athlon-xp -mcpu=athlon-xp -pipe -fomit-frame-pointer -ffast-math -mmmx -m3dnow -msse -mfpmath=sse"
0027 
0028 fi
0029 
0030 if [ ! -d $TMP ]; then
0031   mkdir -p $TMP
0032 fi
0033 if [ ! -d $PKG ]; then
0034   mkdir -p $PKG
0035 fi
0036 
0037 cd $TMP
0038 tar xjvf $CWD/$NAME-$VERSION.tar.bz2
0039 
0040 echo "+----------------------------+"
0041 echo "| Start SlackBuild $NAME-$VERSION |"
0042 echo "+----------------------------+"
0043 
0044 cd $NAME-$VERSION
0045 
0046 find . -perm 777 -exec chmod 755 {} \;
0047 find . -perm 775 -exec chmod 755 {} \;
0048 find . -perm 555 -exec chmod 755 {} \;
0049 find . -perm 666 -exec chmod 644 {} \;
0050 find . -perm 664 -exec chmod 644 {} \;
0051 find . -perm 444 -exec chmod 644 {} \;
0052 
0053 chown -R root.root .
0054 
0055 CFLAGS="$SLKCFLAGS" \
0056 ./waf.py --prefix=$PKG/opt/kde configure
0057 ./waf.py  build 
0058 ./waf.py install
0059 
0060 ( cd $PKG 
0061   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null 
0062   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
0063   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null
0064 )
0065 
0066 mkdir -p $PKG/usr/doc/$NAME-$VERSION
0067 cp -a AUTHORS COPYING ChangeLog INSTALL  README TODO $PKG/usr/doc/$NAME-$VERSION
0068 cd $CWD
0069 cp -a *.SlackBuild slack-desc $PKG/usr/doc/$NAME-$VERSION
0070 chown -R root.root $PKG/usr/doc/$NAME-$VERSION
0071 
0072 mkdir -p $PKG/install
0073 cat $CWD/slack-desc > $PKG/install/slack-desc
0074 
0075 cd $PKG
0076 requiredbuilder -v -y -s $CWD $PKG
0077 makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz
0078 
0079 if [ "$1" = "--cleanup" ]; then
0080   rm -rf $TMP/$NAME-$VERSION
0081   rm -rf $PKG
0082 fi