From b300331d871eddb15e894ac1333810e7ae5b6663 Mon Sep 17 00:00:00 2001 From: Orcan Ogetbil Date: Apr 09 2009 18:52:02 +0000 Subject: - Patch ".afm files not found" issue (#494785) --- diff --git a/pdftk-classpath.patch b/pdftk-classpath.patch new file mode 100644 index 0000000..c178607 --- /dev/null +++ b/pdftk-classpath.patch @@ -0,0 +1,47 @@ +--- pdftk/pdftk.cc 2009-04-09 18:07:27.000000000 +0100 ++++ /home/aph/pdftk.cc 2009-04-09 18:09:20.000000000 +0100 +@@ -2669,6 +2669,44 @@ + strcmp( argv[ii], "-h" )== 0 ); + } + ++ { ++ // Set up CLASSPATH so that we can find property files in ++ // itext.jar. Do this the official way, calling build-classpath. ++ ++ char new_classpath[4096]; ++ char itext_classpath[1024]; ++ char *environ_classpath = getenv ("CLASSPATH"); ++ ++ FILE *p = popen ("/usr/bin/build-classpath itext", "r"); ++ if (!p) ++ { ++ perror ("Can't popen /usr/bin/build-classpath itext"); ++ exit (1); ++ } ++ ++ char *s = fgets(itext_classpath, sizeof itext_classpath, p); ++ if (!s) ++ { ++ perror ("Can't get ouput from /usr/bin/build-classpath itext"); ++ exit (1); ++ } ++ ++ char *nl = strchr (itext_classpath, '\n'); ++ if (nl) ++ *nl = 0; ++ ++ pclose (p); ++ ++ strcpy (new_classpath, "CLASSPATH="); ++ strncat (new_classpath, itext_classpath, sizeof new_classpath); ++ if (environ_classpath) ++ { ++ strncat (new_classpath, ":", sizeof new_classpath); ++ strncat (new_classpath, environ_classpath, sizeof new_classpath); ++ } ++ putenv (new_classpath); ++ } ++ + if( help_b ) { + describe_full(); + } diff --git a/pdftk.spec b/pdftk.spec index 097342b..d3f1484 100644 --- a/pdftk.spec +++ b/pdftk.spec @@ -3,7 +3,7 @@ Summary: The PDF Tool Kit Name: pdftk Version: 1.41 -Release: 14%{?dist} +Release: 15%{?dist} License: GPLv2+ URL: http://www.pdfhacks.com/pdftk/ # Remove java-lib/com because it's contains licensing issue @@ -12,6 +12,8 @@ Patch0: pdftk-use-internal-itext.patch Patch1: pdftk-1.41-make.patch Patch2: pdftk-1.41-gcc44.patch Patch3: pdftk-1.41-stdin.patch +# Solves ".afm files not found" error. RHBZ#494785: +Patch4: pdftk-classpath.patch Group: Applications/Publishing BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gcc-java @@ -46,6 +48,7 @@ C++ code to use iText's (itext-paulo) Java classes. %patch1 -p1 %patch2 -p1 %patch3 -p1 -b .org +%patch4 -p0 -b .classpath rm -rf java_libs @@ -87,6 +90,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %changelog +* Wed Apr 8 2009 Orcan Ogetbil 1.41-15 +- Patch ".afm files not found" issue (#494785) + * Tue Mar 31 2009 Jochen Schmitt 1.41-14 - Patch stdin issue (#492968)