diff --git a/srcpkgs/xpdf/patches/permissions.patch b/srcpkgs/xpdf/patches/permissions.patch new file mode 100644 index 0000000000..4c250fd6ae --- /dev/null +++ b/srcpkgs/xpdf/patches/permissions.patch @@ -0,0 +1,173 @@ +diff -u -Naur xpdf-3.03-old/xpdf/PDFCore.cc xpdf-3.03-new/xpdf/PDFCore.cc +--- xpdf-3.03-old/xpdf/PDFCore.cc 2011-08-15 23:08:53.000000000 +0200 ++++ xpdf-3.03-new/xpdf/PDFCore.cc 2011-08-20 13:47:13.508475137 +0200 +@@ -4,6 +4,8 @@ + // + // Copyright 2004 Glyph & Cog, LLC + // ++// Modified for Debian by Hamish Moffatt, 18 August 2005. ++// + //======================================================================== + + #include +@@ -1619,9 +1621,11 @@ + int x0, y0, x1, y1, t; + GString *s; + ++#ifdef ENFORCE_PERMISSIONS + if (!doc->okToCopy()) { + return NULL; + } ++#endif + if ((page = findPage(pg))) { + cvtUserToDev(pg, xMin, yMin, &x0, &y0); + cvtUserToDev(pg, xMax, yMax, &x1, &y1); +diff -u -Naur xpdf-3.03-old/xpdf/pdfimages.cc xpdf-3.03-new/xpdf/pdfimages.cc +--- xpdf-3.03-old/xpdf/pdfimages.cc 2011-08-15 23:08:53.000000000 +0200 ++++ xpdf-3.03-new/xpdf/pdfimages.cc 2011-08-20 13:50:39.638162542 +0200 +@@ -4,6 +4,8 @@ + // + // Copyright 1998-2003 Glyph & Cog, LLC + // ++// Modified for Debian by Hamish Moffatt, 22 May 2002. ++// + //======================================================================== + + #include +@@ -119,12 +121,14 @@ + } + + // check for copy permission ++#ifdef ENFORCE_PERMISSIONS + if (!doc->okToCopy()) { + error(errNotAllowed, -1, + "Copying of images from this document is not allowed."); + exitCode = 3; + goto err1; + } ++#endif + + // get page range + if (firstPage < 1) +diff -u -Naur xpdf-3.03-old/xpdf/pdftops.cc xpdf-3.03-new/xpdf/pdftops.cc +--- xpdf-3.03-old/xpdf/pdftops.cc 2011-08-15 23:08:53.000000000 +0200 ++++ xpdf-3.03-new/xpdf/pdftops.cc 2011-08-20 13:51:03.830253411 +0200 +@@ -4,6 +4,8 @@ + // + // Copyright 1996-2003 Glyph & Cog, LLC + // ++// Modified for Debian by Hamish Moffatt, 22 May 2002. ++// + //======================================================================== + + #include +@@ -278,12 +280,14 @@ + goto err1; + } + ++#ifdef ENFORCE_PERMISSIONS + // check for print permission + if (!doc->okToPrint()) { + error(errNotAllowed, -1, "Printing this document is not allowed."); + exitCode = 3; + goto err1; + } ++#endif + + // construct PostScript file name + if (argc == 3) { +diff -u -Naur xpdf-3.03-old/xpdf/pdftotext.cc xpdf-3.03-new/xpdf/pdftotext.cc +--- xpdf-3.03-old/xpdf/pdftotext.cc 2011-08-15 23:08:53.000000000 +0200 ++++ xpdf-3.03-new/xpdf/pdftotext.cc 2011-08-20 13:51:24.367184150 +0200 +@@ -4,6 +4,8 @@ + // + // Copyright 1997-2003 Glyph & Cog, LLC + // ++// Modified for Debian by Hamish Moffatt, 22 May 2002. ++// + //======================================================================== + + #include +@@ -168,6 +170,7 @@ + goto err2; + } + ++#ifdef ENFORCE_PERMISSIONS + // check for copy permission + if (!doc->okToCopy()) { + error(errNotAllowed, -1, +@@ -175,6 +178,7 @@ + exitCode = 3; + goto err2; + } ++#endif + + // construct text file name + if (argc == 3) { +diff -u -Naur xpdf-3.03-old/xpdf/XPDFCore.cc xpdf-3.03-new/xpdf/XPDFCore.cc +--- xpdf-3.03-old/xpdf/XPDFCore.cc 2011-08-15 23:08:53.000000000 +0200 ++++ xpdf-3.03-new/xpdf/XPDFCore.cc 2011-08-20 13:48:54.902483779 +0200 +@@ -4,6 +4,8 @@ + // + // Copyright 2002-2003 Glyph & Cog, LLC + // ++// Modified for Debian by Hamish Moffatt, 22 May 2002. ++// + //======================================================================== + + #include +@@ -384,12 +386,16 @@ + #ifndef NO_TEXT_SELECT + if (selectULX != selectLRX && + selectULY != selectLRY) { ++#ifdef ENFORCE_PERMISSIONS + if (doc->okToCopy()) { + copySelection(); + } else { + error(errNotAllowed, -1, + "Copying of text from this document is not allowed."); + } ++#else ++ copySelection(); ++#endif + } + #endif + } +@@ -408,9 +414,11 @@ + int pg; + double ulx, uly, lrx, lry; + ++#ifdef ENFORCE_PERMISSIONS + if (!doc->okToCopy()) { + return; + } ++#endif + if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) { + //~ for multithreading: need a mutex here + if (currentSelection) { +diff -u -Naur xpdf-3.03-old/xpdf/XPDFViewer.cc xpdf-3.03-new/xpdf/XPDFViewer.cc +--- xpdf-3.03-old/xpdf/XPDFViewer.cc 2011-08-15 23:08:53.000000000 +0200 ++++ xpdf-3.03-new/xpdf/XPDFViewer.cc 2011-08-20 13:49:52.908140863 +0200 +@@ -4,6 +4,8 @@ + // + // Copyright 2002-2003 Glyph & Cog, LLC + // ++// Modified for Debian by Hamish Moffatt, 22 May 2002. ++// + //======================================================================== + + #include +@@ -3492,10 +3494,12 @@ + PSOutputDev *psOut; + + doc = viewer->core->getDoc(); ++#ifdef ENFORCE_PERMISSIONS + if (!doc->okToPrint()) { + error(errNotAllowed, -1, "Printing this document is not allowed."); + return; + } ++#endif + + viewer->core->setBusyCursor(gTrue); + + diff --git a/srcpkgs/xpdf/template b/srcpkgs/xpdf/template new file mode 100644 index 0000000000..86d69317b3 --- /dev/null +++ b/srcpkgs/xpdf/template @@ -0,0 +1,30 @@ +# Template file for 'xpdf' +pkgname=xpdf +version=3.04 +revision=1 +patch_args="-Np1" +build_style=gnu-configure +configure_args="--enable-multithreaded + --with-freetype2-library=${XBPS_CROSS_BASE}/usr/lib + --with-freetype2-includes=${XBPS_CROSS_BASE}/usr/include/freetype2 + --x-includes=${XBPS_CROSS_BASE}/usr/include" +conf_files="/etc/xpdfrc" +makedepends="lesstif-devel libpaper-devel libXt-devel libXpm-devel libXp-devel freetype-devel" +depends="gsfonts" +short_desc="Viewer for Portable Document Format (PDF) files" +maintainer="Christian Neukirchen " +license="GPL-2" +homepage="http://www.foolabs.com/xpdf/" +distfiles="ftp://ftp.foolabs.com/pub/${pkgname}/${pkgname}-${version}.tar.gz" +checksum=11390c74733abcb262aaca4db68710f13ffffd42bfe2a0861a5dfc912b2977e5 + +post_extract() { + sed -i 's:/usr/share/fonts/type1/gsfonts:/usr/share/fonts/Type1:' xpdf/GlobalParams.cc + sed -i 's:times-medium-r-normal--16:times-medium-r-normal--14:' xpdf/XPDFViewer.cc +} + +post_install() { + # already in poppler-utils + rm $DESTDIR/usr/bin/pdf* + rm $DESTDIR/usr/share/man/man1/pdf* +}