#!/bin/sh CWD=`pwd` PKG=/tmp/package-gnuchess VERGNUCHESS=5.07 VERSJENG=11.2 VEREBOARD=0.9.5 VERXBOARD=4.2.7 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-3} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi rm -rf $PKG mkdir -p $PKG ### gnuchess cd /tmp rm -rf gnuchess-$VERGNUCHESS tar xjvf $CWD/gnuchess-$VERGNUCHESS.tar.bz2 cd gnuchess-$VERGNUCHESS chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ $ARCH-slackware-linux make -j3 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/gnuchess-$VERGNUCHESS cp -a \ doc/README \ AUTHORS COPYING INSTALL NEWS TODO \ $PKG/usr/doc/gnuchess-$VERGNUCHESS ### Sjeng cd /tmp rm -rf Sjeng-Free-$VERSJENG tar xjvf $CWD/Sjeng-Free-$VERSJENG.tar.bz2 cd Sjeng-Free-$VERSJENG chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ $ARCH-slackware-linux make -j3 make install DESTDIR=$PKG mkdir -p $PKG/usr/doc/Sjeng-Free-$VERSJENG cp -a \ AUTHORS BUGS COPYING NEWS README THANKS TODO \ $PKG/usr/doc/Sjeng-Free-$VERSJENG ### eboard cd /tmp rm -rf eboard-$VEREBOARD tar xjvf $CWD/eboard-$VEREBOARD.tar.bz2 cd eboard-$VEREBOARD chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; # Make eboard not crash on x86_64 when openning a new gtk window, nor when # eboard connects to a server after a previous disconnection. zcat $CWD/eboard.fix-x86_64-crashes.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr make -j3 #make install DESTDIR=$PKG install -d $PKG/usr/bin install -m 0755 eboard $PKG/usr/bin/eboard install -m 0755 eboard-config $PKG/usr/bin/eboard-config install -m 0755 eboard-addtheme $PKG/usr/bin/eboard-addtheme install -d $PKG/usr/man/man1 install -d $PKG/usr/man/man6 install -m 0644 eboard.6 $PKG/usr/man/man6 install -m 0644 eboard-addtheme.1 $PKG/usr/man/man1 install -m 0644 eboard-config.1 $PKG/usr/man/man1 install -d $PKG/usr/share/eboard install -m 0644 classic.png $PKG/usr/share/eboard/classic.png install -m 0644 ghouls.png $PKG/usr/share/eboard/ghouls.png install -m 0644 plastic.png $PKG/usr/share/eboard/plastic.png install -m 0644 eboard_themes.conf $PKG/usr/share/eboard/eboard_themes.conf install -m 0644 NAG.en.txt $PKG/usr/share/eboard/NAG.en.txt ( cd multilang install -d $PKG/usr/share/eboard install -m 0644 eboard.cs.dict eboard.de.dict eboard.es.dict eboard.it.dict eboard.pt_BR.dict $PKG/usr/share/eboard ) mkdir -p $PKG/usr/doc/eboard-$VEREBOARD cp -a \ AUTHORS COPYING README TODO \ $PKG/usr/doc/eboard-$VEREBOARD ### XBoard cd /tmp rm -rf xboard-$VERXBOARD tar xjvf $CWD/xboard-$VERXBOARD.tar.bz2 cd xboard-$VERXBOARD chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; # --infodir is fubar. zcat $CWD/xboard.infodir.diff.gz | patch -p1 --verbose --backup --suffix=.orig # Taken from Debian to fix CVE-2004-2552 zcat $CWD/xboard.buffer_overflow_fix.diff.gz | patch --verbose --backup --suffix=.orig || exit 1 CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --infodir=/usr/info \ --enable-zippy \ $ARCH-slackware-linux make -j3 install -c -s xboard $PKG/usr/bin/xboard install -c -s zic2xpm $PKG/usr/bin/zic2xpm install -c cmail $PKG/usr/bin/cmail install -c ./pxboard $PKG/usr/bin/pxboard install -c -m 644 ./xboard.man $PKG/usr/man/man6/xboard.6 install -c -m 644 ./zic2xpm.man $PKG/usr/man/man6/zic2xpm.6 mkdir -p $PKG/usr/info install -c -m 644 xboard.info $PKG/usr/info/xboard.info mkdir -p $PKG/usr/doc/xboard-$VERXBOARD cp -a \ AUTHORS COPYING COPYRIGHT FAQ FAQ.html NEWS READ_ME \ $PKG/usr/doc/xboard-$VERXBOARD ### Finish up... ( 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 ) # Compress and link manpages, if any: if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man for manpagedir in $(find . -type d -name "man*") ; do ( cd $manpagedir for eachpage in $( find . -type l -maxdepth 1) ; do ln -s $( readlink $eachpage ).gz $eachpage.gz rm $eachpage done gzip -9 *.? ) done ) fi # Compress info files, if any: if [ -d $PKG/usr/info ]; then ( cd $PKG/usr/info rm -f dir gzip -9 * ) fi mkdir -p $PKG/usr/share/pixmaps cat $CWD/chess.png > $PKG/usr/share/pixmaps/chess.png mkdir -p $PKG/usr/share/applications cat $CWD/eboard.desktop > $PKG/usr/share/applications/eboard.desktop cat $CWD/xboard.desktop > $PKG/usr/share/applications/xboard.desktop mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n ../gnuchess-$VERGNUCHESS-$ARCH-$BUILD.tgz