diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 143bd19..e137c2e 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -8,13 +8,14 @@ arch=('x86_64') license=('custom' 'BSD' 'GPL' 'LGPL') url="http://netpbm.sourceforge.net/" depends=('perl' 'libpng' 'libtiff' 'libxml2') -makedepends=('python2' 'jbigkit' 'subversion') +makedepends=('python' 'jbigkit' 'subversion') options=('!makeflags') # Get docs with: wget --recursive --relative -nH http://netpbm.sourceforge.net/doc/ source=(https://downloads.sourceforge.net/project/netpbm/super_stable/$pkgver/netpbm-$pkgver.tgz https://sources.archlinux.org/other/packages/netpbm/netpbm-doc-31Jan2014.tar.xz{,.sig} netpbm-CAN-2005-2471.patch netpbm-security-code.patch netpbm-security-scripts.patch - reproducible-man-gzip.patch use-source-date-epoch.patch) + reproducible-man-gzip.patch use-source-date-epoch.patch + netpbm-python3-compat.patch) sha256sums=('e370c3593c3a2a38edd7181c1ebfc40f03dba6ade915ad46ca5d4eb46c3e381a' '74bcf840ee643c6917330c382484010cb99c004a3fcf05391bebcac63815acb3' 'SKIP' @@ -22,19 +23,27 @@ sha256sums=('e370c3593c3a2a38edd7181c1ebfc40f03dba6ade915ad46ca5d4eb46c3e381a' '83d75a80ce999d8b69572e54f04c4d220c60b0d09f9e52d3236264535c3bf216' '2c397588d9cba2c40dee55c07713d5e77e0e04245db939fdc1962d7de4cf4a33' '8e3efdb4fcbfdc8e9a5c8e9663c7d6b9ecef3a2379ce38d2acc5669c339f6814' - '68055341833f482c6910a56c2fdfe046978a1a92fd8442a2a9209c82ce3e4d13') + '68055341833f482c6910a56c2fdfe046978a1a92fd8442a2a9209c82ce3e4d13' + '54c50745ea13aab6e68eb56e66b8d37895958a2f1d175fc9adf2e0624de50cd6') validpgpkeys=('5357F3B111688D88C1D88119FCF2CB179205AC90') prepare() { - cd $pkgname-$pkgver + #makeman expects the input to be valid UTF-8 + cd doc + for f in *.html + do + iconv -o "$f.out" -f CP1252 -t UTF-8 "$f" + mv "$f.out" "$f" + done + + cd "$srcdir"/$pkgname-$pkgver patch -p1 < ../netpbm-CAN-2005-2471.patch patch -p1 < ../netpbm-security-code.patch patch -p1 < ../netpbm-security-scripts.patch patch -p1 < ../reproducible-man-gzip.patch patch -p1 < ../use-source-date-epoch.patch - sed -i 's|#!/usr/bin/python|#!/usr/bin/python2|' buildtools/makeman - sed -i 's|@python|@python2|' buildtools/manpage.mk + patch -p1 < ../netpbm-python3-compat.patch cp config.mk.in config.mk [ "${CARCH}" = 'x86_64' ] && echo 'CFLAGS_SHLIB = -fPIC' >> config.mk diff --git a/trunk/netpbm-python3-compat.patch b/trunk/netpbm-python3-compat.patch new file mode 100644 index 0000000..08977fb --- /dev/null +++ b/trunk/netpbm-python3-compat.patch @@ -0,0 +1,68 @@ +Index: makeman +=================================================================== +diff --git a/buildtools/makeman b/buildtools/makeman +--- a/buildtools/makeman (revision 2995) ++++ b/buildtools/makeman (revision 3033) +@@ -32,7 +32,7 @@ + # Added footer message to clarify original source. + # + +-import os, sys, exceptions, re ++import os, sys, re + + source = "netpbm documentation" + section = 1 +@@ -50,7 +50,7 @@ + .IP + .B http://netpbm.sourceforge.net/doc/''' + +-class LiftException(exceptions.Exception): ++class LiftException(Exception): + def __init__(self, message, retval=1): + self.message = message + self.retval = retval +@@ -332,9 +332,7 @@ + outdoc = makeman(name, file, indoc) + except: + os.remove(tempfile) +- # Pass the exception upwards +- (exc_type, exc_value, exc_traceback) = sys.exc_info() +- raise exc_type, exc_value, exc_traceback ++ raise + if outdoc == indoc: + os.remove(tempfile) + if outdoc is None: +@@ -343,11 +341,11 @@ + outfp.write(outdoc) + outfp.close() # under Windows you can't rename an open file + stem = file[:file.find(".")] +- os.rename(tempfile, stem + "." + `sectmap[file]`) +- except LiftException, e: ++ os.rename(tempfile, stem + "." + repr(sectmap[file])) ++ except LiftException as e: + mainerr.write("makeman: " + e.message + "\n") + return e.retval +- except IOError, e: ++ except IOError as e: + mainerr.write("makeman: file I/O error: %s\n" % e) + return 3 + except KeyboardInterrupt: +@@ -355,8 +353,7 @@ + return 4 + except: + if verbosity: +- (exc_type, exc_value, exc_traceback) = sys.exc_info() +- raise exc_type, exc_value, exc_traceback ++ raise + else: + mainerr.write("makeman: internal error!\n") + return 5 +@@ -363,7 +360,7 @@ + + if __name__ == "__main__": + # Run the main sequence +- raise SystemExit, main(sys.argv[1:]) ++ raise SystemExit(main(sys.argv[1:])) + + # The following sets edit modes for GNU EMACS + # Local Variables: