diff options
Diffstat (limited to 'source/xap/xpdf')
-rw-r--r-- | source/xap/xpdf/VendorP.h.buggy.diff | 19 | ||||
-rw-r--r-- | source/xap/xpdf/doinst.sh | 19 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-arabic.diff (renamed from source/xap/xpdf/xpdf-arabic.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-chinese-simplified.diff (renamed from source/xap/xpdf/xpdf-chinese-simplified.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-chinese-traditional.diff (renamed from source/xap/xpdf/xpdf-chinese-traditional.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-cyrillic.diff (renamed from source/xap/xpdf/xpdf-cyrillic.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-greek.diff (renamed from source/xap/xpdf/xpdf-greek.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-hebrew.diff (renamed from source/xap/xpdf/xpdf-hebrew.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-japanese.diff (renamed from source/xap/xpdf/xpdf-japanese.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-korean.diff (renamed from source/xap/xpdf/xpdf-korean.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-latin2.diff (renamed from source/xap/xpdf/xpdf-latin2.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-thai.diff (renamed from source/xap/xpdf/xpdf-thai.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/lang/xpdf-turkish.diff (renamed from source/xap/xpdf/xpdf-turkish.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdf-3.02pl1.patch (renamed from source/xap/xpdf/xpdf-3.02pl1.patch) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdf-3.02pl2.patch (renamed from source/xap/xpdf/xpdf-3.02pl2.patch) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdf-3.02pl3.patch (renamed from source/xap/xpdf/xpdf-3.02pl3.patch) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdf-3.02pl4.patch | 282 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdf-resizefix.diff (renamed from source/xap/xpdf/xpdf-resizefix.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdf_3.02-1.3.diff (renamed from source/xap/xpdf/xpdf_3.02-1.3.diff) | 0 | ||||
-rw-r--r-- | source/xap/xpdf/patches/xpdfrc.diff (renamed from source/xap/xpdf/xpdfrc.diff) | 0 | ||||
-rwxr-xr-x | source/xap/xpdf/xpdf.SlackBuild | 124 | ||||
-rw-r--r-- | source/xap/xpdf/xpdf.desktop | 6 |
22 files changed, 371 insertions, 79 deletions
diff --git a/source/xap/xpdf/VendorP.h.buggy.diff b/source/xap/xpdf/VendorP.h.buggy.diff deleted file mode 100644 index a8c91ab4..00000000 --- a/source/xap/xpdf/VendorP.h.buggy.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- ./VendorP.h.orig 2007-02-14 02:45:33.000000000 -0600 -+++ ./VendorP.h 2007-08-08 14:22:17.000000000 -0500 -@@ -76,6 +76,8 @@ - XtPointer extension; /* pointer to extension record */ - } VendorShellClassPart; - -+struct VendorShellClassRec; -+/* - typedef struct _VendorShellClassRec { - CoreClassPart core_class; - CompositeClassPart composite_class; -@@ -85,6 +87,7 @@ - } VendorShellClassRec; - - externalref VendorShellClassRec vendorShellClassRec; -+*/ - - /* New fields for the vendor shell widget. */ - diff --git a/source/xap/xpdf/doinst.sh b/source/xap/xpdf/doinst.sh new file mode 100644 index 00000000..03a6ae85 --- /dev/null +++ b/source/xap/xpdf/doinst.sh @@ -0,0 +1,19 @@ +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 + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + diff --git a/source/xap/xpdf/xpdf-arabic.diff b/source/xap/xpdf/lang/xpdf-arabic.diff index a6dfcf1f..a6dfcf1f 100644 --- a/source/xap/xpdf/xpdf-arabic.diff +++ b/source/xap/xpdf/lang/xpdf-arabic.diff diff --git a/source/xap/xpdf/xpdf-chinese-simplified.diff b/source/xap/xpdf/lang/xpdf-chinese-simplified.diff index adb125a4..adb125a4 100644 --- a/source/xap/xpdf/xpdf-chinese-simplified.diff +++ b/source/xap/xpdf/lang/xpdf-chinese-simplified.diff diff --git a/source/xap/xpdf/xpdf-chinese-traditional.diff b/source/xap/xpdf/lang/xpdf-chinese-traditional.diff index 71d35ee5..71d35ee5 100644 --- a/source/xap/xpdf/xpdf-chinese-traditional.diff +++ b/source/xap/xpdf/lang/xpdf-chinese-traditional.diff diff --git a/source/xap/xpdf/xpdf-cyrillic.diff b/source/xap/xpdf/lang/xpdf-cyrillic.diff index ec841961..ec841961 100644 --- a/source/xap/xpdf/xpdf-cyrillic.diff +++ b/source/xap/xpdf/lang/xpdf-cyrillic.diff diff --git a/source/xap/xpdf/xpdf-greek.diff b/source/xap/xpdf/lang/xpdf-greek.diff index fe47d443..fe47d443 100644 --- a/source/xap/xpdf/xpdf-greek.diff +++ b/source/xap/xpdf/lang/xpdf-greek.diff diff --git a/source/xap/xpdf/xpdf-hebrew.diff b/source/xap/xpdf/lang/xpdf-hebrew.diff index e7d091d0..e7d091d0 100644 --- a/source/xap/xpdf/xpdf-hebrew.diff +++ b/source/xap/xpdf/lang/xpdf-hebrew.diff diff --git a/source/xap/xpdf/xpdf-japanese.diff b/source/xap/xpdf/lang/xpdf-japanese.diff index 5c1878fe..5c1878fe 100644 --- a/source/xap/xpdf/xpdf-japanese.diff +++ b/source/xap/xpdf/lang/xpdf-japanese.diff diff --git a/source/xap/xpdf/xpdf-korean.diff b/source/xap/xpdf/lang/xpdf-korean.diff index 632fc214..632fc214 100644 --- a/source/xap/xpdf/xpdf-korean.diff +++ b/source/xap/xpdf/lang/xpdf-korean.diff diff --git a/source/xap/xpdf/xpdf-latin2.diff b/source/xap/xpdf/lang/xpdf-latin2.diff index 88ce2444..88ce2444 100644 --- a/source/xap/xpdf/xpdf-latin2.diff +++ b/source/xap/xpdf/lang/xpdf-latin2.diff diff --git a/source/xap/xpdf/xpdf-thai.diff b/source/xap/xpdf/lang/xpdf-thai.diff index 75b9b1a2..75b9b1a2 100644 --- a/source/xap/xpdf/xpdf-thai.diff +++ b/source/xap/xpdf/lang/xpdf-thai.diff diff --git a/source/xap/xpdf/xpdf-turkish.diff b/source/xap/xpdf/lang/xpdf-turkish.diff index ec7fe79f..ec7fe79f 100644 --- a/source/xap/xpdf/xpdf-turkish.diff +++ b/source/xap/xpdf/lang/xpdf-turkish.diff diff --git a/source/xap/xpdf/xpdf-3.02pl1.patch b/source/xap/xpdf/patches/xpdf-3.02pl1.patch index cd42fb96..cd42fb96 100644 --- a/source/xap/xpdf/xpdf-3.02pl1.patch +++ b/source/xap/xpdf/patches/xpdf-3.02pl1.patch diff --git a/source/xap/xpdf/xpdf-3.02pl2.patch b/source/xap/xpdf/patches/xpdf-3.02pl2.patch index ab9e3c67..ab9e3c67 100644 --- a/source/xap/xpdf/xpdf-3.02pl2.patch +++ b/source/xap/xpdf/patches/xpdf-3.02pl2.patch diff --git a/source/xap/xpdf/xpdf-3.02pl3.patch b/source/xap/xpdf/patches/xpdf-3.02pl3.patch index b5988805..b5988805 100644 --- a/source/xap/xpdf/xpdf-3.02pl3.patch +++ b/source/xap/xpdf/patches/xpdf-3.02pl3.patch diff --git a/source/xap/xpdf/patches/xpdf-3.02pl4.patch b/source/xap/xpdf/patches/xpdf-3.02pl4.patch new file mode 100644 index 00000000..082d1175 --- /dev/null +++ b/source/xap/xpdf/patches/xpdf-3.02pl4.patch @@ -0,0 +1,282 @@ +*** xpdf-3.02.orig/xpdf/Stream.cc Fri Jul 24 14:30:46 2009 +--- xpdf-3.02/xpdf/Stream.cc Mon Oct 5 11:07:49 2009 +*************** +*** 323,328 **** +--- 323,332 ---- + } else { + imgLineSize = nVals; + } ++ if (width > INT_MAX / nComps) { ++ // force a call to gmallocn(-1,...), which will throw an exception ++ imgLineSize = -1; ++ } + imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar)); + imgIdx = nVals; + } +*** xpdf-3.02.orig/xpdf/PSOutputDev.cc Tue Feb 27 14:05:52 2007 +--- xpdf-3.02/xpdf/PSOutputDev.cc Fri Oct 2 12:38:58 2009 +*************** +*** 4301,4307 **** + width, -height, height); + + // allocate a line buffer +! lineBuf = (Guchar *)gmalloc(4 * width); + + // set up to process the data stream + imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), +--- 4301,4307 ---- + width, -height, height); + + // allocate a line buffer +! lineBuf = (Guchar *)gmallocn(width, 4); + + // set up to process the data stream + imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), +diff -r -c xpdf-3.02.orig/splash/Splash.cc xpdf-3.02/splash/Splash.cc +*** xpdf-3.02.orig/splash/Splash.cc Tue Feb 27 14:05:52 2007 +--- xpdf-3.02/splash/Splash.cc Fri Aug 14 14:05:08 2009 +*************** +*** 12,17 **** +--- 12,18 ---- + + #include <stdlib.h> + #include <string.h> ++ #include <limits.h> + #include "gmem.h" + #include "SplashErrorCodes.h" + #include "SplashMath.h" +*************** +*** 1912,1918 **** + xq = w % scaledWidth; + + // allocate pixel buffer +! pixBuf = (SplashColorPtr)gmalloc((yp + 1) * w); + + // initialize the pixel pipe + pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha, +--- 1913,1922 ---- + xq = w % scaledWidth; + + // allocate pixel buffer +! if (yp < 0 || yp > INT_MAX - 1) { +! return splashErrBadArg; +! } +! pixBuf = (SplashColorPtr)gmallocn(yp + 1, w); + + // initialize the pixel pipe + pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha, +*************** +*** 2208,2216 **** + xq = w % scaledWidth; + + // allocate pixel buffers +! colorBuf = (SplashColorPtr)gmalloc((yp + 1) * w * nComps); + if (srcAlpha) { +! alphaBuf = (Guchar *)gmalloc((yp + 1) * w); + } else { + alphaBuf = NULL; + } +--- 2212,2223 ---- + xq = w % scaledWidth; + + // allocate pixel buffers +! if (yp < 0 || yp > INT_MAX - 1 || w > INT_MAX / nComps) { +! return splashErrBadArg; +! } +! colorBuf = (SplashColorPtr)gmallocn(yp + 1, w * nComps); + if (srcAlpha) { +! alphaBuf = (Guchar *)gmallocn(yp + 1, w); + } else { + alphaBuf = NULL; + } +diff -r -c xpdf-3.02.orig/splash/SplashErrorCodes.h xpdf-3.02/splash/SplashErrorCodes.h +*** xpdf-3.02.orig/splash/SplashErrorCodes.h Tue Feb 27 14:05:52 2007 +--- xpdf-3.02/splash/SplashErrorCodes.h Fri Aug 14 14:03:46 2009 +*************** +*** 29,32 **** +--- 29,34 ---- + + #define splashErrSingularMatrix 8 // matrix is singular + ++ #define splashErrBadArg 9 // bad argument ++ + #endif +*** xpdf-3.02.orig/splash/SplashBitmap.cc Tue Feb 27 14:05:52 2007 +--- xpdf-3.02/splash/SplashBitmap.cc Wed Aug 19 14:55:39 2009 +*************** +*** 11,16 **** +--- 11,17 ---- + #endif + + #include <stdio.h> ++ #include <limits.h> + #include "gmem.h" + #include "SplashErrorCodes.h" + #include "SplashBitmap.h" +*************** +*** 27,56 **** + mode = modeA; + switch (mode) { + case splashModeMono1: +! rowSize = (width + 7) >> 3; + break; + case splashModeMono8: +! rowSize = width; + break; + case splashModeRGB8: + case splashModeBGR8: +! rowSize = width * 3; + break; + #if SPLASH_CMYK + case splashModeCMYK8: +! rowSize = width * 4; + break; + #endif + } +! rowSize += rowPad - 1; +! rowSize -= rowSize % rowPad; +! data = (SplashColorPtr)gmalloc(rowSize * height); + if (!topDown) { + data += (height - 1) * rowSize; + rowSize = -rowSize; + } + if (alphaA) { +! alpha = (Guchar *)gmalloc(width * height); + } else { + alpha = NULL; + } +--- 28,75 ---- + mode = modeA; + switch (mode) { + case splashModeMono1: +! if (width > 0) { +! rowSize = (width + 7) >> 3; +! } else { +! rowSize = -1; +! } + break; + case splashModeMono8: +! if (width > 0) { +! rowSize = width; +! } else { +! rowSize = -1; +! } + break; + case splashModeRGB8: + case splashModeBGR8: +! if (width > 0 && width <= INT_MAX / 3) { +! rowSize = width * 3; +! } else { +! rowSize = -1; +! } + break; + #if SPLASH_CMYK + case splashModeCMYK8: +! if (width > 0 && width <= INT_MAX / 4) { +! rowSize = width * 4; +! } else { +! rowSize = -1; +! } + break; + #endif + } +! if (rowSize > 0) { +! rowSize += rowPad - 1; +! rowSize -= rowSize % rowPad; +! } +! data = (SplashColorPtr)gmallocn(height, rowSize); + if (!topDown) { + data += (height - 1) * rowSize; + rowSize = -rowSize; + } + if (alphaA) { +! alpha = (Guchar *)gmallocn(width, height); + } else { + alpha = NULL; + } +*** xpdf-3.02.orig/xpdf/XRef.cc Tue Feb 27 14:05:52 2007 +--- xpdf-3.02/xpdf/XRef.cc Tue Oct 13 11:57:24 2009 +*************** +*** 52,57 **** +--- 52,59 ---- + // generation 0. + ObjectStream(XRef *xref, int objStrNumA); + ++ GBool isOk() { return ok; } ++ + ~ObjectStream(); + + // Return the object number of this object stream. +*************** +*** 67,72 **** +--- 69,75 ---- + int nObjects; // number of objects in the stream + Object *objs; // the objects (length = nObjects) + int *objNums; // the object numbers (length = nObjects) ++ GBool ok; + }; + + ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { +*************** +*** 80,85 **** +--- 83,89 ---- + nObjects = 0; + objs = NULL; + objNums = NULL; ++ ok = gFalse; + + if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { + goto err1; +*************** +*** 105,110 **** +--- 109,121 ---- + goto err1; + } + ++ // this is an arbitrary limit to avoid integer overflow problems ++ // in the 'new Object[nObjects]' call (Acrobat apparently limits ++ // object streams to 100-200 objects) ++ if (nObjects > 1000000) { ++ error(-1, "Too many objects in an object stream"); ++ goto err1; ++ } + objs = new Object[nObjects]; + objNums = (int *)gmallocn(nObjects, sizeof(int)); + offsets = (int *)gmallocn(nObjects, sizeof(int)); +*************** +*** 161,170 **** + } + + gfree(offsets); + + err1: + objStr.free(); +- return; + } + + ObjectStream::~ObjectStream() { +--- 172,181 ---- + } + + gfree(offsets); ++ ok = gTrue; + + err1: + objStr.free(); + } + + ObjectStream::~ObjectStream() { +*************** +*** 837,842 **** +--- 848,858 ---- + delete objStr; + } + objStr = new ObjectStream(this, e->offset); ++ if (!objStr->isOk()) { ++ delete objStr; ++ objStr = NULL; ++ goto err; ++ } + } + objStr->getObject(e->gen, num, obj); + break; diff --git a/source/xap/xpdf/xpdf-resizefix.diff b/source/xap/xpdf/patches/xpdf-resizefix.diff index 4be7feb0..4be7feb0 100644 --- a/source/xap/xpdf/xpdf-resizefix.diff +++ b/source/xap/xpdf/patches/xpdf-resizefix.diff diff --git a/source/xap/xpdf/xpdf_3.02-1.3.diff b/source/xap/xpdf/patches/xpdf_3.02-1.3.diff index 6a769e5c..6a769e5c 100644 --- a/source/xap/xpdf/xpdf_3.02-1.3.diff +++ b/source/xap/xpdf/patches/xpdf_3.02-1.3.diff diff --git a/source/xap/xpdf/xpdfrc.diff b/source/xap/xpdf/patches/xpdfrc.diff index f005414e..f005414e 100644 --- a/source/xap/xpdf/xpdfrc.diff +++ b/source/xap/xpdf/patches/xpdfrc.diff diff --git a/source/xap/xpdf/xpdf.SlackBuild b/source/xap/xpdf/xpdf.SlackBuild index d07fb9aa..5acf7c06 100755 --- a/source/xap/xpdf/xpdf.SlackBuild +++ b/source/xap/xpdf/xpdf.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +22,20 @@ VERSION=3.02 -PATCHLEVEL=pl3 -ARCH=${ARCH:-x86_64} +PATCHLEVEL=pl4 +BUILD=${BUILD:-2} + NUMJOBS=${NUMJOBS:-" -j7 "} -BUILD=1 + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" @@ -36,25 +46,23 @@ elif [ "$ARCH" = "s390" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-xpdf + rm -rf $PKG mkdir -p $TMP $PKG cd $TMP rm -rf xpdf-$VERSION -tar xvf $CWD/xpdf-$VERSION.tar.gz || exit 1 +tar xvf $CWD/xpdf-$VERSION.tar.?z || exit 1 cd xpdf-$VERSION || exit 1 -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 -cat $CWD/xpdf-3.02pl3.patch | patch -p1 --verbose || exit 1 -zcat $CWD/xpdf_3.02-1.3.diff.gz | patch -p1 --verbose || exit 1 - chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ @@ -62,7 +70,14 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -zcat $CWD/xpdfrc.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit +zcat $CWD/patches/xpdf-resizefix.diff.gz | patch -p1 --verbose || exit 1 +cat $CWD/patches/xpdf-3.02pl1.patch | patch -p1 --verbose || exit 1 +cat $CWD/patches/xpdf-3.02pl2.patch | patch -p1 --verbose || exit 1 +cat $CWD/patches/xpdf-3.02pl3.patch | patch -p1 --verbose || exit 1 +cat $CWD/patches/xpdf-3.02pl4.patch | patch -p1 --verbose || exit 1 +zcat $CWD/patches/xpdf_3.02-1.3.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/patches/xpdfrc.diff.gz | patch -p1 --verbose || exit 1 + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ @@ -71,71 +86,68 @@ CXXFLAGS="$SLKCFLAGS" \ --mandir=/usr/man \ --sysconfdir=/etc \ --with-gzip \ - --with-freetype2-includes=/usr/include/freetype2 + --with-freetype2-includes=/usr/include/freetype2 \ + --build=$ARCH-slackware-linux make $NUMJOBS || make || 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 +chmod 0755 $PKG/usr/bin/* +gzip -9 $PKG/usr/man/man?/* -find $PKG | xargs file | grep -e "executable" -e "shared object" \ - | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +# 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 +) -chmod 755 $PKG/usr/bin/* -gzip -9 $PKG/usr/man/man?/* +# Don't clobber /etc/xpdfrc +mkdir -p $PKG/etc +cat doc/sample-xpdfrc > $PKG/etc/xpdfrc +mv $PKG/etc/xpdfrc $PKG/etc/xpdfrc.new -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 desktop menu entry and icon +mkdir -p $PKG/usr/share/{applications,pixmaps} +cat $CWD/xpdf.desktop > $PKG/usr/share/applications/xpdf.desktop +cat xpdf/xpdfIcon.xpm > $PKG/usr/share/pixmaps/xpdfIcon.xpm # 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 + tar xf $CWD/lang/${language}.tar.gz ( cd ${language} - zcat $CWD/${language}.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 + zcat $CWD/lang/${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 + cat add-to-xpdfrc >> $PKG/etc/xpdfrc.new mkdir -p $PKG/usr/share/xpdf/$(echo ${language} | cut -f2- -d -) cp -a * $PKG/usr/share/xpdf/$(echo ${language} | cut -f2- -d -) ) done +find $PKG | xargs file | grep -e "executable" -e "shared object" \ + | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/xpdf-$VERSION +cp -a \ + ANNOUNCE CHANGES COPYING INSTALL README \ + $PKG/usr/doc/xpdf-$VERSION +chmod 0644 $PKG/usr/doc/xpdf-$VERSION/* + +# If there's a ChangeLog, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r CHANGES ]; then + DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION) + cat CHANGES | head -n 1000 > $DOCSDIR/CHANGES + touch -r CHANGES $DOCSDIR/CHANGES +fi + mkdir -p $PKG/install -mv $PKG/etc/xpdfrc $PKG/etc/xpdfrc.new -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 -) +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh # Build the package: cd $PKG diff --git a/source/xap/xpdf/xpdf.desktop b/source/xap/xpdf/xpdf.desktop index b8f4c9b1..51d1a5a6 100644 --- a/source/xap/xpdf/xpdf.desktop +++ b/source/xap/xpdf/xpdf.desktop @@ -1,5 +1,4 @@ [Desktop Entry] -Encoding=UTF-8 Name=X PDF Name[bn]=এক্স পি-ডি-এফ Name[de]=X-PDF @@ -11,7 +10,7 @@ Name[ko]=X용 PDF Name[mn]=X-PDF Name[nds]=X-PDF Name[te]=ఎక్స్ పిడిఎఫ్ -MimeType=application/pdf +MimeType=application/pdf; GenericName=PDF Viewer GenericName[af]=Pdf Aansig GenericName[ar]=عارض الملفات PDF @@ -93,8 +92,7 @@ GenericName[zh_TW]=PDF 檢視程式 GenericName[zu]=Umbukisi we-PDF Exec=xpdf Icon=xpdfIcon -Path= Type=Application Terminal=false X-KDE-StartupNotify=false -Categories=Graphics;PDFViewer; +Categories=Graphics; |