#!/bin/sh # Slackware build script for fbreader # Originally written by Audrius Kazukauskas # Maintained as of version 0.12.1 by Niels Horn # revision date: 2010/02/23 PRGNAM=fbreader VERSION=0.12.5.1 ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # If you want to build the gtk interface instead, then change this # value to 'gtk' or run the script like this: # UI=gtk ./fbreader.SlackBuild UI=${UI:-qt4} if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" fi set -e # Exit on most errors rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-sources-$VERSION.tgz cd $PRGNAM-$VERSION chown -R root:root . chmod -R u+w,go+r-w,a-s . # We're building for desktop against Qt4 # If you want to build against GTK+2, just change UI_TYPE to gtk cat > makefiles/target.mk << EOF TARGET_ARCH = desktop UI_TYPE = $UI TARGET_STATUS = release EOF # Add SLKCFLAGS sed -i "s|CFLAGS =|CFLAGS = $SLKCFLAGS|" makefiles/arch/desktop.mk # Fix all Qt3 related flags (just in case) sed -i 's|moc-qt3|moc|' makefiles/arch/desktop.mk sed -i 's|-I /usr/include/qt3|$(shell pkg-config --cflags qt-mt)|' makefiles/arch/desktop.mk sed -i 's|-lqt-mt|$(shell pkg-config --libs qt-mt)|' makefiles/arch/desktop.mk # Fix all Qt4 related flags sed -i 's|moc-qt4|moc|' makefiles/arch/desktop.mk sed -i 's|-I /usr/include/qt4|$(shell pkg-config --cflags QtGui)|' makefiles/arch/desktop.mk sed -i 's|-lQtGui|$(shell pkg-config --libs QtGui)|' makefiles/arch/desktop.mk make LIBDIR=/usr/lib${LIBDIRSUFFIX} make install LIBDIR=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG ( 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 ) # Fix .desktop file sed -i 's|^Name=E-book reader|Name=FBReader|' $PKG/usr/share/applications/FBReader.desktop mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a README.build fbreader/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild 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:-tgz}