[32475] trunk/dports/graphics/xpdf

landonf at macports.org landonf at macports.org
Thu Jan 3 13:03:04 PST 2008


Revision: 32475
          http://trac.macosforge.org/projects/macports/changeset/32475
Author:   landonf at macports.org
Date:     2008-01-03 13:03:03 -0800 (Thu, 03 Jan 2008)

Log Message:
-----------
Disable PDF restrictions by default, using the patch from:
	http://www.mazzoo.de/d/xpdf-3.02-salvage-your-eye.patch

If you want DRM enabled, set the +drm variant.

I just ran into a government form that we submitted, containing our own original work, that had been password protected to prevent copy/paste. Now our HR department doesn't have to transcribe the entire form by hand.

Modified Paths:
--------------
    trunk/dports/graphics/xpdf/Portfile

Added Paths:
-----------
    trunk/dports/graphics/xpdf/files/
    trunk/dports/graphics/xpdf/files/xpdf-3.02-salvage-your-eye.patch

Modified: trunk/dports/graphics/xpdf/Portfile
===================================================================
--- trunk/dports/graphics/xpdf/Portfile	2008-01-03 20:50:44 UTC (rev 32474)
+++ trunk/dports/graphics/xpdf/Portfile	2008-01-03 21:03:03 UTC (rev 32475)
@@ -2,6 +2,7 @@
 PortSystem 1.0
 name         xpdf
 version      3.02
+revision     1
 description  Xpdf is a viewer for PDF files.
 long_description \
     Xpdf is a viewer for Portable Document Format \
@@ -34,6 +35,8 @@
 		     port:libpaper port:openmotif port:t1lib
 depends_run  path:${prefix}/share/ghostscript/fonts:ghostscript
 
+patchfiles   xpdf-3.02-salvage-your-eye.patch
+
 post-patch {
     cd ${worksrcpath}
     reinplace "s|/usr/local|${prefix}|g" \
@@ -90,6 +93,10 @@
         --with-Xm-includes=${prefix}/include
 }
 
+variant drm {
+    patchfiles-delete xpdf-3.02-salvage-your-eye.patch
+}
+
 post-install {
     ui_msg " \
         Xpdf language support packages are also available at \

Added: trunk/dports/graphics/xpdf/files/xpdf-3.02-salvage-your-eye.patch
===================================================================
--- trunk/dports/graphics/xpdf/files/xpdf-3.02-salvage-your-eye.patch	                        (rev 0)
+++ trunk/dports/graphics/xpdf/files/xpdf-3.02-salvage-your-eye.patch	2008-01-03 21:03:03 UTC (rev 32475)
@@ -0,0 +1,40 @@
+diff -Nur xpdf-3.02-orig/xpdf/SecurityHandler.cc xpdf-3.02/xpdf/SecurityHandler.cc
+--- xpdf/SecurityHandler.cc	2007-02-27 23:05:52.000000000 +0100
++++ xpdf/SecurityHandler.cc	2007-06-05 12:23:37.000000000 +0200
+@@ -373,9 +373,6 @@
+     return gFalse;
+   }
+   permFlags = (*xsh->authorize)(xsh->handlerData, docData, authData);
+-  if (!(permFlags & xpdfPermissionOpen)) {
+-    return gFalse;
+-  }
+   if (!(*xsh->getKey)(xsh->handlerData, docData, &key, &length, &encVersion)) {
+     return gFalse;
+   }
+diff -Nur xpdf-3.02-orig/xpdf/XRef.cc xpdf-3.02/xpdf/XRef.cc
+--- xpdf/XRef.cc	2007-02-27 23:05:52.000000000 +0100
++++ xpdf/XRef.cc	2007-06-05 12:26:31.000000000 +0200
+@@ -771,19 +771,19 @@
+ }
+ 
+ GBool XRef::okToPrint(GBool ignoreOwnerPW) {
+-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint);
++  return gTrue;
+ }
+ 
+ GBool XRef::okToChange(GBool ignoreOwnerPW) {
+-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange);
++  return gTrue;
+ }
+ 
+ GBool XRef::okToCopy(GBool ignoreOwnerPW) {
+-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy);
++  return gTrue;
+ }
+ 
+ GBool XRef::okToAddNotes(GBool ignoreOwnerPW) {
+-  return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes);
++  return gTrue;
+ }
+ 
+ Object *XRef::fetch(int num, int gen, Object *obj) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080103/fd31f57e/attachment.html


More information about the macports-changes mailing list