X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 58B58DC0090 for ; Sun, 22 Jun 2014 22:25:56 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id hz1so5060994pad.24 for ; Sun, 22 Jun 2014 15:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JiSxzwLXOFZ9VRPOXoy1gH+BD/4ZYwqnQ6GHDpFLAYA=; b=Jl475eFTwbpu/TuDPDA6osRdLF3WIH9NCFWwGNfCFBnAi7ZTcZTHlmIN2VG9kyNrRn b+feLQ3f7o/qaFsrUwKIQppbyPcMYdLcOIzNv9wmd9nk7LwwrqZAeqyf0EAeE5z1kGsB rz8U+ERo8OUvTkSHQdHH6YzfEf7PyGfs+El9PSr/3OIdWOpHsKLmOI4+y/sOIBci+8iO PlxKMHkbWA+h/SjjY3zaJKcDYI34nGjDrZWryk9YP2r/AB4s3YrjGp7sY842yRU3Cex2 skOukVgeyHttSmZOZm9A2qBepvu+OOyuq7PxQAYPT0RJBVC4UD3/deC6s6xWaHIIltJ9 FnOA== X-Received: by 10.68.235.6 with SMTP id ui6mr23723988pbc.45.1403475955389; Sun, 22 Jun 2014 15:25:55 -0700 (PDT) Received: from localhost.localdomain ([50.0.227.6]) by mx.google.com with ESMTPSA id si8sm82607344pab.27.2014.06.22.15.25.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jun 2014 15:25:54 -0700 (PDT) From: Isaac Dunham To: alpine-devel@lists.alpinelinux.org Cc: Isaac Dunham Subject: [alpine-devel] [PATCH 1/2] Add Xpdf, an X11/Motif PDF viewer. Date: Sun, 22 Jun 2014 22:24:16 +0000 Message-Id: <1403475856-4621-1-git-send-email-ibid.ag@gmail.com> X-Mailer: git-send-email 2.0.0 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- testing/xpdf/APKBUILD | 62 ++++++++++++++++++++++++ testing/xpdf/xpdf-3.04-protection.patch | 84 +++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 testing/xpdf/APKBUILD create mode 100644 testing/xpdf/xpdf-3.04-protection.patch diff --git a/testing/xpdf/APKBUILD b/testing/xpdf/APKBUILD new file mode 100644 index 0000000..196c9d9 --- /dev/null +++ b/testing/xpdf/APKBUILD @@ -0,0 +1,62 @@ +# Contributor: Isaac Dunham +# Maintainer: Isaac Dunham +pkgname=xpdf +pkgver="3.04" +pkgrel=0 +pkgdesc="The classic X11 PDF viewer" +url="http://foolabs.com/xpdf" +arch="all" +license="GPL2/GPL3" +depends="" +depends_dev="" +makedepends="motif-dev freetype-dev libpng-dev" +install="" +subpackages="$pkgname-doc" +source="ftp://ftp.foolabs.com/pub/xpdf/$pkgname-$pkgver.tar.gz +xpdf-3.04-protection.patch" + +_builddir="$srcdir/$pkgname-$pkgver" +prepare() { + local i + cd "$_builddir" + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done +} + +build() { + echo "$_builddir" + cd "$_builddir" + ./configure \ + --with-x \ + --with-freetype2-includes=/usr/include/freetype2 \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + rm -f "$pkgdir"/usr/lib/*.la + #delete pdf* utils that conflict with poppler-utils. + for i in pdftops pdftotxt pdfinfo pdfdetach; do + rm -f "$pkgdir"/usr/bin/$i + rm -f "$pkgdir"/usr/share/man/man1/$i.1 + done +} + +md5sums="3bc86c69c8ff444db52461270bef3f44 xpdf-3.04.tar.gz +11bd32802d9e600ad028f5b84194178d xpdf-3.04-protection.patch" +sha256sums="11390c74733abcb262aaca4db68710f13ffffd42bfe2a0861a5dfc912b2977e5 xpdf-3.04.tar.gz +5a12a1781eb29f83b3f0e3c1484e6c99537f84e42aa3dda9bb9c4a5befd83217 xpdf-3.04-protection.patch" +sha512sums="3fb3c380fdbd13d937449ae3f7d7a163815cc85296d30be7b9907687884385d6171bb48ee5d5c13368d6bba87740b678f491bdcf61b38d130809e9afa260f6cf xpdf-3.04.tar.gz +4c6360731ad60ed45e0612b016116a9588f293267ee3e2c1f7cd2f046f045f165334c6e7fceb6b51b3181adb7a74087036a28fcec0e04b23e6374ffc421c1f54 xpdf-3.04-protection.patch" diff --git a/testing/xpdf/xpdf-3.04-protection.patch b/testing/xpdf/xpdf-3.04-protection.patch new file mode 100644 index 0000000..677db00 --- /dev/null +++ b/testing/xpdf/xpdf-3.04-protection.patch @@ -0,0 +1,84 @@ +Port Johannes Bauer's protection patch to 3.04. +This does NOT disable the error messages, since the user should +be aware of the author's intent. + +Also, this does not deal with permission to print. + +diff --git a/xpdf/PDFCore.cc b/xpdf/PDFCore.cc +index 34b6483..e93fe52 100644 +--- a/xpdf/PDFCore.cc ++++ b/xpdf/PDFCore.cc +@@ -1677,9 +1677,6 @@ GString *PDFCore::extractText(int pg, double xMin, double yMin, + int x0, y0, x1, y1, t; + GString *s; + +- if (!doc->okToCopy()) { +- return NULL; +- } + if ((page = findPage(pg))) { + cvtUserToDev(pg, xMin, yMin, &x0, &y0); + cvtUserToDev(pg, xMax, yMax, &x1, &y1); +diff --git a/xpdf/XPDFCore.cc b/xpdf/XPDFCore.cc +index 9a3725f..1562c7a 100644 +--- a/xpdf/XPDFCore.cc ++++ b/xpdf/XPDFCore.cc +@@ -384,9 +384,8 @@ void XPDFCore::endSelection(int wx, int wy) { + #ifndef NO_TEXT_SELECT + if (selectULX != selectLRX && + selectULY != selectLRY) { +- if (doc->okToCopy()) { + copySelection(); +- } else { ++ if (!doc->okToCopy()) { + error(errNotAllowed, -1, + "Copying of text from this document is not allowed."); + } +@@ -408,9 +407,6 @@ void XPDFCore::copySelection() { + int pg; + double ulx, uly, lrx, lry; + +- if (!doc->okToCopy()) { +- return; +- } + if (getSelection(&pg, &ulx, &uly, &lrx, &lry)) { + //~ for multithreading: need a mutex here + if (currentSelection) { +diff --git a/xpdf/pdfimages.cc b/xpdf/pdfimages.cc +index dc79443..9aaa811 100644 +--- a/xpdf/pdfimages.cc ++++ b/xpdf/pdfimages.cc +@@ -122,8 +122,6 @@ int main(int argc, char *argv[]) { + if (!doc->okToCopy()) { + error(errNotAllowed, -1, + "Copying of images from this document is not allowed."); +- exitCode = 3; +- goto err1; + } + + // get page range +diff --git a/xpdf/pdftohtml.cc b/xpdf/pdftohtml.cc +index f1fe691..824233e 100644 +--- a/xpdf/pdftohtml.cc ++++ b/xpdf/pdftohtml.cc +@@ -134,8 +134,6 @@ int main(int argc, char *argv[]) { + if (!doc->okToCopy()) { + error(errNotAllowed, -1, + "Copying of text from this document is not allowed."); +- exitCode = 3; +- goto err1; + } + + // get page range +diff --git a/xpdf/pdftotext.cc b/xpdf/pdftotext.cc +index 758413e..e6779fa 100644 +--- a/xpdf/pdftotext.cc ++++ b/xpdf/pdftotext.cc +@@ -192,8 +192,6 @@ int main(int argc, char *argv[]) { + if (!doc->okToCopy()) { + error(errNotAllowed, -1, + "Copying of text from this document is not allowed."); +- exitCode = 3; +- goto err2; + } + + // construct text file name -- 2.0.0 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---