#!/bin/sh # Set initial variables: PKGNAM=xpdf VERSION=3.02 PATCHLEVEL=pl2 PKGVER=${VERSION}${PATCHLEVEL} BUILD=2 . /etc/pkghelpers pkghelpers_env rm -rf $PKG cd $TMP rm -rf xpdf-$VERSION tar xzvf $CWD/xpdf-$VERSION.tar.gz cd xpdf-$VERSION zcat $CWD/xpdf-resizefix.diff.gz | patch -p1 --verbose || exit 1 cat $CWD/xpdf-3.02pl1.patch | patch -p1 --verbose || exit 1 cat $CWD/xpdf-3.02pl2.patch | patch -p1 --verbose || exit 1 zcat $CWD/xpdf_3.02-1.3.diff.gz | patch -p1 --verbose || exit 1 pkghelpers_permissions zcat $CWD/xpdfrc.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit LDFLAGS="-L/usr/lib$LIBSUFFIX " \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib$LIBSUFFIX \ --mandir=/usr/man \ --sysconfdir=/etc \ --with-gzip \ --with-freetype2-includes=/usr/include/freetype2 make -j3 || exit 1 make install DESTDIR=$PKG || exit 1 mkdir -p $PKG/etc cat doc/sample-xpdfrc > $PKG/etc/xpdfrc mkdir -p $PKG/usr/share/applications cat $CWD/xpdf.desktop > $PKG/usr/share/applications/xpdf.desktop mkdir -p $PKG/usr/share/icons cat xpdf/xpdfIcon.xpm > $PKG/usr/share/icons/xpdfIcon.xpm ( 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 ) chmod 755 $PKG/usr/bin/* mkdir -p $PKG/usr/doc/xpdf-$VERSION cp -a \ ANNOUNCE CHANGES COPYING INSTALL README \ $PKG/usr/doc/xpdf-$VERSION chmod 644 $PKG/usr/doc/xpdf-$VERSION/* # Add additional language support: for language in xpdf-arabic xpdf-chinese-simplified xpdf-chinese-traditional xpdf-cyrillic xpdf-greek xpdf-hebrew xpdf-japanese xpdf-korean xpdf-latin2 xpdf-thai xpdf-turkish ; do rm -rf ${language} tar xf $CWD/${language}.tar.gz ( cd ${language} zcat $CWD/${language}.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 chown -R root:root . find . -type f -exec chmod 644 {} \; cat add-to-xpdfrc >> $PKG/etc/xpdfrc mkdir -p $PKG/usr/share/xpdf/$(echo ${language} | cut -f2- -d -) cp -a * $PKG/usr/share/xpdf/$(echo ${language} | cut -f2- -d -) ) done mkdir -p $PKG/install cat << EOF > $PKG/install/doinst.sh #!/bin/sh config() { NEW="\$1" OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r \$OLD ]; then mv \$NEW \$OLD elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy rm \$NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/xpdfrc.new EOF cat $CWD/slack-desc > $PKG/install/slack-desc # We'll use the versions of these from the poppler derived work (if they exist here): ( cd $PKG/usr/bin rm -f pdfinfo pdftops pdftoppm pdftohtml pdftotext pdfimages pdffonts cd $PKG/usr/man/man1 for file in pdfinfo pdftops pdftoppm pdftohtml pdftotext pdfimages pdffonts ; do rm -f ${file}.1.gz done ) # Build the package: cd $PKG pkghelpers_fixup pkghelpers_makepkg