#!/bin/sh # Heavily based on the Slackware 13.0 SlackBuild # http://soft.proindependent.com/qtiplot.html # Packager Andrea Sciucca ( gohanz at infinito.it) # http://www.slacky.eeuu # # # Required gsl, muparser # # Exit on most errors set -e CWD=`pwd` TMP=${TMP:-/tmp/txz} PKG=$TMP/package-qtiplot NAME=qtiplot VERSION=0.9.7.10 ARCH=${ARCH:-i486} BUILD=1as SOURCE=http://download.berlios.de/qtiplot/$NAME-$VERSION.tar.bz2 if [ ! -e $NAME-$VERSION.tar.bz2 ]; then wget $SOURCE fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi cd $TMP tar xvjf $CWD/$NAME-$VERSION.tar.bz2 echo -e "\E[0;32m+--------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild QtiPlot |\E[0;0m" echo -e "\E[0;32m+--------------------------+\E[0;0m" cd $NAME-$VERSION # Patch the source to work with shared gsl and muparser system library. # And to disable the documentation building, because a compilation error. #patch -p1 < $CWD/qtiplot-0.9.7.10-SlackWare.13.0.patch patch -p0 < $CWD/qtiplot-0.9.7.10_patch.diff patch -p0 < $CWD/gsl_fft_patch.diff cp $CWD/build.conf . find . -perm 666 -exec chmod 644 {} \; 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 {} \; chown -R root:root . mkdir -p $PKG/usr/bin cat << EOF > $PKG/usr/bin/qtiplot #!/bin/bash cd /usr/share/qtiplot exec /usr/share/qtiplot/qtiplot EOF chmod 755 $PKG/usr/bin/* # Configure: qmake -unix PREFIX=/usr QMAKE_LIBS="$SLKLDFLAGS" QMAKE_CFLAGS="$SLKCFLAGS" QMAKE_CXXFLAGS="$SLKCFLAGS" -o Makefile qtiplot.pro # Build and install: LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ make mkdir -p $PKG/usr/share/qtiplot install -m 755 qtiplot/qtiplot $PKG/usr/share/qtiplot install -m 755 qtiplot/qti_wordlist.txt $PKG/usr/share/qtiplot cp qtiplot/*.py $PKG/usr/share/qtiplot cp -a -r qtiplot/translations $PKG/usr/share/qtiplot mkdir -p $PKG/usr/include mkdir -p $PKG/usr/lib/qtiplot/plugins cp -a fitPlugins/lib* $PKG/usr/lib/qtiplot/plugins cp -a 3rdparty/qwt/lib/libqwt.a $PKG/usr/lib cp -a 3rdparty/qwt/src/*.h $PKG/usr/include mkdir -p $PKG/usr/doc/$NAME-$VERSION cp README.html gpl_licence.txt $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/usr/share/applications/ mkdir -p $PKG/usr/share/pixmaps/ mkdir -p $PKG/usr/man/man1 cp -f $CWD/qtiplot.desktop $PKG/usr/share/applications/qtiplot.desktop cp -f $TMP/$NAME-$VERSION/qtiplot_logo.png $PKG/usr/share/pixmaps/qtiplot.png cp -f $TMP/$NAME-$VERSION/qtiplot.1 $PKG/usr/man/man1 mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild echo "if [ -x /usr/bin/update-mime-database ]; then /usr/bin/update-mime-database /usr/share/mime &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database &> /dev/null fi" >> $PKG/install/doinst.sh gzip -9 $PKG/usr/man/*/* cd $PKG ADD=$(ls /var/log/packages/ | sed -ne 's/\(gsl\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2,/p' \ -e 's/\(muparser\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2/p') \ requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi