#!/bin/bash # gnuchess.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 28-Dec-2004 # Record toolchain & other info for the build log: slackbuildinfo # Versions of bundled stuff: VERGNUCHESS=$VERSION VERSJENG=11.2 VEREBOARD=0.9.5 VERXBOARD=4.2.7 # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PACKAGE export PORTCWD=$PWD # Temporary build locations: export TMPBUILD=$TMP/build-$PACKAGE export PKG=$TMP/package-$PACKAGE mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD # Determine the CFLAGS for the known architectures: case $PORTARCH in arm) export SLKCFLAGS="-march=armv3 -mtune=xscale" export SLK_OPTIMS="-O2" ;; powerpc) export SLKCFLAGS="" export SLK_OPTIMS="-O2" ;; sparc) export SLKCFLAGS="" export SLK_OPTIMS="-O2" ;; *) export SLKCFLAGS="" export SLK_OPTIMS="-O2" ;; esac ############ Build GNUchess ##################################### # Extract source: tar jxvvf $CWD/$PACKAGE-$VERGNUCHESS.tar.bz2 cd $PACKAGE-* slackhousekeeping # Configure: CFLAGS="$SLKCFLAGS $SLK_OPTIMS" \ ./configure \ --prefix=/usr \ $ARCH-slackware-linux || failconfig # Build: make || failmake # Install into package: make install DESTDIR=$PKG || failinstall # Copy docs: mkdir -p $PKG/usr/doc/$PACKAGE-$VERGNUCHESS cp -a doc/README AUTHORS COPYING INSTALL NEWS TODO \ $PKG/usr/doc/$PACKAGE-$VERGNUCHESS ############ Build Sjeng ######################################### # Extract source: cd $TMPBUILD tar jxvvf $CWD/Sjeng-Free-$VERSJENG.tar.bz2 cd Sjeng-Free-* slackhousekeeping # Configure: CFLAGS="$SLK_OPTIMS $SLKCFLAGS" \ ./configure \ --prefix=/usr \ $ARCH-slackware-linux || failconfig # Build: make CXX="c++ $SLKCFLAGS" || failmake # Install into package: make install DESTDIR=$PKG || failinstall # Copy docs: mkdir -p $PKG/usr/doc/Sjeng-Free-$VERSJENG cp -a AUTHORS BUGS COPYING NEWS README THANKS TODO \ $PKG/usr/doc/Sjeng-Free-$VERSJENG ############ Build eboard ######################################### # Extract source: cd $TMPBUILD tar jxvvf $CWD/eboard-$VEREBOARD.tar.bz2 cd eboard-* slackhousekeeping # Configure (CXXFLAGS has -O6 by default): CFLAGS="$SLK_OPTIMS $SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr || failconfig # Build: make CXX="c++ $SLKCFLAGS" || failmake # Install into package: mkdir -p $PKG/usr/{bin,man/man{1,6},share/eboard} # Binaries: install -m755 eboard eboard-config eboard-addtheme \ $PKG/usr/bin # Man pages: install -m644 eboard.6 $PKG/usr/man/man6 install -m644 eboard-config.1 eboard-addtheme.1 $PKG/usr/man/man1 # Images & theme stuff: install -m644 ghouls.png plastic.png classic.png $PKG/usr/share/eboard 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 -m644 eboard.cs.dict eboard.de.dict eboard.es.dict eboard.it.dict eboard.pt_BR.dict \ $PKG/usr/share/eboard ) # Copy docs: mkdir -p $PKG/usr/doc/eboard-$VEREBOARD cp -a AUTHORS COPYING README TODO \ $PKG/usr/doc/eboard-$VEREBOARD ############ Build Xboard ######################################### # Extract source: cd $TMPBUILD tar jxvvf $CWD/xboard-$VERXBOARD.tar.bz2 cd xboard-* slackhousekeeping # --infodir is fubar. zcat $CWD/xboard.infodir.diff.gz | patch -p1 --verbose --backup --suffix=.orig # Configure: CFLAGS="$SLK_OPTIMS $SLKCFLAGS" \ ./configure \ --prefix=/usr \ --infodir=/usr/info \ --enable-zippy \ $ARCH-slackware-linux || failconfig # Build: make || failmake # Install: install -m755 pxboard xboard zic2xpm cmail $PKG/usr/bin install -m644 xboard.man $PKG/usr/man/man6/xboard.6 install -m644 zic2xpm.man $PKG/usr/man/man6/zic2xpm.6 install -m644 xboard.info $PKG/usr/info/xboard.info # Copy docs: mkdir -p $PKG/usr/doc/xboard-$VERXBOARD cp -a AUTHORS COPYING COPYRIGHT FAQ FAQ.html NEWS READ_ME \ $PKG/usr/doc/xboard-$VERXBOARD # Install desktop stuff: 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 ####################################################################### # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown (root:bin), slack644docs slackdesc # install slack-desc and doinst.sh # Build the package: if [ $PORTARCH = arm ]; then slackmp # run makepkg else makepkg -l y -c n $PKGSTORE/$PKGSERIES/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz fi # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links