commit 06d0c4ede65ceecf671ad0ba6beb4f404a505512 Author: shtrom Date: Tue Jan 17 07:39:53 2012 +0000 [pdfsizeopt,multivalent-pdf-tools] Tool to optimise the size of PDFs, and missing dependency git-svn-id: svn+ssh://scm.narf.ssji.net/svn/archlinux-packages@314 df209809-8e4a-0410-9a64-c169741eb0fc diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d55cd359b827 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = pdfsizeopt-svn + pkgdesc = PDF file size optimizer + pkgver = 221 + pkgrel = 2 + url = https://code.google.com/p/pdfsizeopt + arch = any + license = GPL2 + makedepends = subversion + depends = python2>=2.4 + depends = ghostscript>=8.61 + depends = sam2p + depends = tif22pnm + optdepends = multivalent-pdf-tools: to optimise cross reference table and object serialisation [use --use-multivalent=true] + optdepends = pngout: to optimise the size of PNG parts [use --use-jbig2=true] + optdepends = jbig2enc: to manage JBIG2 parts [use --use-pngout=true] + source = archpackage.patch + md5sums = ee0d8cd8232c42592791f470301252a1 + +pkgname = pdfsizeopt-svn + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f19733dc552b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,41 @@ +# Maintainer: Olivier Mehani +# $Id$ +pkgname=pdfsizeopt-svn +pkgver=171 +pkgrel=1 +pkgdesc="PDF file size optimizer" +arch=(any) +url="https://code.google.com/p/pdfsizeopt" +license=('GPL2') +groups=() +depends=("python2>=2.4" "ghostscript>=8.61" "sam2p" "tif22pnm") +makedepends=('subversion') +optdepends=("multivalent-pdf-tools: to optimise cross reference table and object serialisation [use --use-multivalent=true]" + "pngout: to optimise the size of PNG parts [use --use-jbig2=true]" + "jbig2enc: to manage JBIG2 parts [use --use-pngout=true]") +source=("archpackage.patch") + +_svntrunk=http://pdfsizeopt.googlecode.com/svn/trunk/ +_svnmod=pdfsizeopt + +build() { + cd "$srcdir" + msg "Connecting to SVN server...." + + if [[ -d "$_svnmod/.svn" ]]; then + (cd "$_svnmod" && svn up -r "$pkgver") + else + svn co "$_svntrunk" --config-dir ./ -r "$pkgver" "$_svnmod" + fi + + msg "SVN checkout done or server timeout" + cd $_svnmod + patch -p0 < $srcdir/archpackage.patch +} + +package() { + install -D -m 755 $srcdir/pdfsizeopt/pdfsizeopt.py $pkgdir/usr/bin/pdfsizeopt +} + +# vim:set ts=2 sw=2 et: +md5sums=('0c2bfe7f87cfcdc6774015c0d6fa15f7') diff --git a/archpackage.patch b/archpackage.patch new file mode 100644 index 000000000000..8c45bc384fca --- /dev/null +++ b/archpackage.patch @@ -0,0 +1,36 @@ +Index: pdfsizeopt.py +=================================================================== +--- pdfsizeopt.py (revision 171) ++++ pdfsizeopt.py (working copy) +@@ -1,4 +1,4 @@ +-#! /usr/bin/python2.4 ++#! /usr/bin/python2 + # + # pdfsizeopt.py: do various PDF size optimizations + # by pts@fazekas.hu at Sun Mar 29 13:42:05 CEST 2009 +@@ -6712,7 +6712,11 @@ + Pathname to Multivalent.jar or None. + """ + assert os.sep not in file_name +- multivalent_jar = FindOnPath(file_name) ++ # XXX ArchLinux packaging-specific ++ multivalent_jar = "/usr/share/java/multivalent/%s" % file_name ++ if not os.path.isfile(multivalent_jar): ++ # XXX resume normal operation ++ multivalent_jar = FindOnPath(file_name) + if multivalent_jar is None: + slash_file_name = os.sep + file_name + for item in os.getenv('CLASSPATH', '').split(os.pathsep): +@@ -6865,9 +6869,9 @@ + argv.append('--help') + + try: +- use_pngout = True +- use_jbig2 = True +- use_multivalent = True ++ use_pngout = False ++ use_jbig2 = False ++ use_multivalent = False + do_optimize_images = True + do_optimize_objs = True + do_unify_fonts = True