#!/bin/sh # Heavily based on the Slackware 13.1 SlackBuild # Written by Andrea Sciucca ( gohanz at infinito.it) # Last build from sbabaro ( slacky at it-d.com ) # Slackware build script for pdfedit # Official Site: http://pdfedit.petricek.net # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #### Remove all un-needed comments please! #### See http://www.slacky.eu/wikislack/index.php?title=Linee_guida_per_pacchettizzatori for details set -e # Basic information. PKGNAME=pdfedit VERSION=${VERSION:-0.4.5} BUILD=${BUILD:-1} TAG=${TAG:-sl} ARCH=${ARCH:-x86_64} SOURCE="http://downloads.sourceforge.net/project/$PKGNAME/$PKGNAME/$VERSION/$PKGNAME-$VERSION.tar.bz2" TAR= # empty = auto DIR= # empty = auto # Does not touch following if not needed CWD=$(pwd) TMP=${TMP:-/tmp/buildpkgs/$PKGNAME} PKG=$TMP/package-$PKGNAME OUTPUT=${OUTPUT:-$CWD} TAR=${TAR:-$(basename $SOURCE)} DIR=${DIR:-$(echo "$TAR"|sed -r 's/(\.tar|)(.gz|.bz2|)$//')} if [ ! -e $CWD/$TAR ];then wget $SOURCE #elif [ ${SOURCE:0:4} == "http" ];then # SIZE=$(curl -s --head $SOURCE|grep Content-Length|awk '{print $2}') # if [ -z "$SIZE" -o "$(ls -l $TAR|awk '{print $5}')" != "$SIZE" ];then # rm -f $TAR # wget $SOURCE # fi fi CHOST="i486" if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" elif [ "$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" CHOST="x86_64" fi ##rm -rf $TMP echo $TMP echo $PKG echo $OUTPUT echo $DIR ##mkdir -p $TMP $PKG $OUTPUT cd $TMP ##tar xjvf $CWD/$TAR cd $DIR ### Installing patches # zcat $CWD/your_patch.diff.gz |patch -p1 chown -R root:root . chmod -R u+w,go+r-w,a-s . # Add a good path for docbook.xsl printf "/usr/share/xml/docbook/xsl-stylesheets-*/html\n" >> \ doc/tools/docbook_xslt_paths # Customize as you need export QTDIR=/opt/kde3/lib$LIBDIRSUFFIX/qt3 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ##./configure \ ## --prefix=/usr \ ## --libdir=/usr/lib$LIBDIRSUFFIX \ ## --sysconfdir=/etc \ ## --localstatedir=/var \ ## --mandir=/usr/man \ ## --docdir=/usr/doc/$PKGNAME-$VERSION \ ## --build=$CHOST-slackware-linux \ ## --enable-stack-protector \ ## --enable-release \ ## --enable-gui \ ## --disable-kernel-tests \ ## --disable-advanced-doc \ ## --enable-user-manual \ ## --enable-doxygen-doc \ ## --enable-pdfedit-core-dev \ ## --with-parallel-make=auto \ ## --with-root-dir=$PKG \ ## --with-qmake=/opt/kde3/lib$LIBDIRSUFFIX/qt3/bin/qmake make $MAKEOPTS make install DESTDIR=$PKG ## Do special operations # cat $CWD/rc.application.sh > $PKG/etc/rc.d/rc.application.new # cat $PKG/etc/init.d/initscript >> $PKG/etc/rc.d/rc.program.new # rm $PKG/etc/init.d/initscript # mv $PKG/etc/appl.conf $PKG/etc/appl.conf.new echo "End Make" # Documentations mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION set +e cp -r \ [A-Z]* doc/ docs/ readme* install.txt \ $PKG/usr/doc/$PKGNAME-$VERSION set -e echo "Finished Documentation" cat $CWD/$PKGNAME.SlackBuild > $PKG/usr/doc/$PKGNAME-$VERSION/$PKGNAME.SlackBuild cat $CWD/slack-desc > $PKG/usr/doc/$PKGNAME-$VERSION/slack-desc if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done ) fi ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true ) mkdir -p $PKG/usr/share/applications cat $CWD/pdfedit.desktop > $PKG/usr/share/applications/$NAME.desktop mkdir -p $PKG/usr/share/icons/default.kde/16x16/apps mkdir -p $PKG/usr/share/icons/default.kde/32x32/apps mkdir -p $PKG/usr/share/icons/default.kde/48x48/apps mkdir -p $PKG/usr/share/icons/default.kde/64x64/apps ( cd src/gui/icon cp -a pdfedit_icon_64.png $PKG/usr/share/icons/default.kde/64x64/apps/pdfedit.png cp -a pdfedit_icon_16.png $PKG/usr/share/icons/default.kde/16x16/apps/pdfedit.png cp -a pdfedit_icon_32.png $PKG/usr/share/icons/default.kde/32x32/apps/pdfedit.png cp -a pdfedit_icon_48.png $PKG/usr/share/icons/default.kde/48x48/apps/pdfedit.png ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc [ -e $CWD/doinst.sh ] && cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder 2>/dev/null)" ];then requiredbuilder -c -b -y -v -s $CWD $PKG fi /sbin/makepkg -l y -c n $OUTPUT/$PKGNAME-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi