#!/bin/bash # Slackware build script for torcs # Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20260731 bkw: update for v1.3.9. # 20260102 bkw: update for v1.3.8. # 20211102 bkw: BUILD=2, new-style icons # 20170704 bkw: fix build on -current cd $(dirname $0) ; CWD=$(pwd) PRGNAM=torcs VERSION=${VERSION:-1.3.9} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 cd $PRGNAM-$VERSION chown -R root:root . find . ! -type l -a \ \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \ \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS -fpermissive" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBDIRSUFFIX \ --sysconfdir=/etc \ --localstatedir=/var \ --bindir=/usr/games \ --mandir=/usr/man \ --build=$ARCH-slackware-linux make -j1 make -j1 install DESTDIR=$PKG make -j1 datainstall DESTDIR=$PKG # For some reason `make install' creates all the dirs 0777 find $PKG -type d | xargs chmod 0755 strip $PKG/usr/lib*/$PRGNAM/{*-bin,*/*.so,*/*/*.so} chmod 755 $PKG/usr/lib*/$PRGNAM/{*-bin,*/*.so,*/*/*.so} # Tenemos una pagina de man en espaƱol... but I finally got around # to looking at it, and it's almost content-free. The one piece of # 'useful information' is "This program doesn't have any option", # which (a) isn't in Spanish, and (b) is *wrong*. So ditch it. mkdir -p $PKG/usr/man/man6 rm -f doc/man/$PRGNAM.es.6 cp doc/man/*.6 $PKG/usr/man/man6 rm -rf doc/man gzip $PKG/usr/man/man6/*.6 # Docs are a bit of a mess... PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a README doc/changelogs doc/tutorials doc/userman doc/history cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/usr/share/applications cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop for px in 16 32 48 64; do size=${px}x${px} dir=$PKG/usr/share/icons/hicolor/$size/apps mkdir -p $dir convert -resize $size Ticon.png $dir/$PRGNAM.png done mkdir -p $PKG/usr/share/pixmaps ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE