%global with_gcj %{!?_without_gcj:1}%{?_without_gcj:0} %global alternate_name iText Summary: A Free Java-PDF library Name: itext Version: 5.0.1 Release: 1%{?dist} # The licensing of individual parts is explained in NOTICE.txt License: AGPLv3 and BSD and MIT and ASL 2.0 URL: http://www.lowagie.com/iText/ Group: Development/Libraries Source0: http://downloads.sourceforge.net/project/%{name}/%{alternate_name}/%{alternate_name}%{version}/%{alternate_name}-src-%{version}.tar.gz # Borrowed from an old version of itext: Source1: itext.png Source3: itext-rups.sh Source4: itext-rups.desktop Patch1: itext-pdftk.patch BuildRequires: ant BuildRequires: bouncycastle-tsp BuildRequires: desktop-file-utils BuildRequires: dom4j BuildRequires: ImageMagick BuildRequires: java-devel >= 1.7 BuildRequires: jpackage-utils %if %{with_gcj} BuildRequires: java-gcj-compat-devel Requires(post): java-gcj-compat Requires(postun): java-gcj-compat Requires: java-1.5.0-gcj %else BuildArch: noarch %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: bouncycastle-tsp Requires: java >= 1.5 Requires: jpackage-utils >= 1.5 Requires(post): jpackage-utils >= 1.7 Requires(postun): jpackage-utils >= 1.7 Provides: %{alternate_name} = %{version}-%{release} # They don't provide rtf and toolbox anymore Obsoletes: %{name}-rtf < 2.1.7-7 Obsoletes: %{name}-toolbox < 2.1.7-7 %description iText is a library that allows you to generate PDF files on the fly. The iText classes are very useful for people who need to generate read-only, platform independent documents containing text, lists, tables and images. The library is especially useful in combination with Java(TM) technology-based Servlets: The look and feel of HTML is browser dependent; with iText and PDF you can control exactly how your servlet's output will look. %package rups Summary: Reading/Updating PDF Syntax Group: Applications/Productivity # The icons are CC-BY. The code is LGPLv2+. License: LGPLv2+ and CC-BY Requires: %{name} = %{version}-%{release} #Requires: dom4j #Requires: pdf-renderer %description rups iText RUPS is a tool that combines SUN's PDF Renderer (to view PDF documents), iText's PdfReader (to inspect the internal structure of a PDF file), and iText's PdfStamper to manipulate a PDF file. %package javadoc Summary: Javadoc for %{alternate_name} Group: Documentation BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: jpackage-utils %description javadoc API documentation for the %{alternate_name} package. %prep %setup -q -c -T -a 0 %patch1 -p0 -b .pdftk # Fix encoding issues sed 's/\r//' src/rups/com/itextpdf/rups/view/icons/copyright_notice.txt > tmpfile touch -r src/rups/com/itextpdf/rups/view/icons/copyright_notice.txt tmpfile mv -f tmpfile src/rups/com/itextpdf/rups/view/icons/copyright_notice.txt mkdir lib #build-jar-repository -s -p lib bcprov bcmail bctsp pdf-renderer dom4j build-jar-repository -s -p lib bcprov bcmail bctsp dom4j # Remove jdk & version numbers from classpath entries for jarname in bcmail bcprov bctsp dom4j; do sed -i "s|$jarname-.*\.jar|$jarname.jar|" src/ant/.ant.properties done %build export CLASSPATH=$(build-classpath bcprov bcmail bctsp dom4j) pushd src ant release popd %install rm -rf $RPM_BUILD_ROOT # jars mkdir -p $RPM_BUILD_ROOT%{_javadir} cp -p lib/iText.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar cp -p lib/iText-rups.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}-rups-%{version}.jar (cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do \ ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done) mkdir -p $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications # rups stuff install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_bindir}/%{name}-rups desktop-file-install \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ %{SOURCE4} # icon for rups mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps cp -a %{SOURCE1} \ $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/128x128/apps/%{name}-rups.png %if %{with_gcj} RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-indirect-classes" %{_bindir}/aot-compile-rpm %endif # javadoc mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name} cp -pr build/docs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} # Install the pom install -dm 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms cp -pr build/release/maven/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-itext.pom %add_to_maven_depmap itext itext %{version} JPP itext %add_to_maven_depmap com.lowagie itext %{version} JPP itext %clean rm -rf $RPM_BUILD_ROOT %post %update_maven_depmap %if %{with_gcj} if [ -x %{_bindir}/rebuild-gcj-db ] then %{_bindir}/rebuild-gcj-db fi %endif %postun %update_maven_depmap %if %{with_gcj} if [ -x %{_bindir}/rebuild-gcj-db ] then %{_bindir}/rebuild-gcj-db fi %endif %post rups touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun rups if [ $1 -eq 0 ] ; then touch --no-create %{_datadir}/icons/hicolor &>/dev/null gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi %posttrans rups gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files %defattr(-,root,root,-) %doc src/core/com/itextpdf/text/*.txt %{_javadir}/%{name}.jar %{_javadir}/%{name}-%{version}.jar %{_mavenpomdir}/JPP-itext.pom %{_mavendepmapfragdir}/%{name} %if %{with_gcj} %dir %{_libdir}/gcj/%{name} %{_libdir}/gcj/%{name}/%{name}-%{version}.* %endif %files rups %defattr(-,root,root,-) %doc src/rups/com/itextpdf/rups/view/icons/copyright_notice.txt %{_javadir}/%{name}-rups.jar %{_javadir}/%{name}-rups-%{version}.jar %{_bindir}/%{name}-rups %{_datadir}/applications/%{name}-rups.desktop %{_datadir}/icons/hicolor/128x128/apps/%{name}-rups.png %if %{with_gcj} %{_libdir}/gcj/%{name}/%{name}-rups-%{version}.* %endif %files javadoc %defattr(-,root,root,-) %{_javadocdir}/%{name} # ----------------------------------------------------------------------------- %changelog * Fri Feb 12 2010 Orcan Ogetbil 5.0.1-1 - New upstream release (jump from 2.1.7 to 5.0.0) * Sat Oct 03 2009 Orcan Ogetbil 2.1.7-6 - Bump release * Thu Oct 01 2009 Orcan Ogetbil 2.1.7-5 - Separate rtf, rups and toolbox packages - Reduce dependencies of the main package (RHBZ#524066) * Thu Aug 27 2009 Andrew Overholt 2.1.7-4 - Patch POM file due to explicit "jdk14" requirement on bouncycastle - Patch in XML output classes from earlier version (their license is clean) for maven-doxia * Thu Aug 27 2009 Andrew Overholt 2.1.7-3 - Add maven POM file for use by other maven packages * Fri Jul 24 2009 Fedora Release Engineering - 2.1.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Jul 09 2009 Orcan Ogetbil 2.1.7-1 - New upstream release * Tue Jun 16 2009 Orcan Ogetbil 2.1.6-1 - New upstream release - Some SPEC file cleanup * Tue Apr 21 2009 Jochen Schmitt 2.1.5-2 - Patch to allow reading of pdf files from stdin for pdftk (BZ #495574) * Tue Mar 10 2009 Jochen Schmitt 2.1.5-1 - New upstream release * Tue Mar 03 2009 Orcan Ogetbil 2.1.4-5 - Remove the odd Provides introduced in the 2.1.4-3 build. * Wed Feb 25 2009 Fedora Release Engineering - 2.1.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu Feb 19 2009 Orcan Ogetbil 2.1.4-3 - Add extra Provides for a nice interaction with pdftk. * Thu Feb 12 2009 Orcan Ogetbil 2.1.4-2 - Pass the additional flag "-fno-indirect-classes" to aot-compile-rpm * Sun Nov 30 2008 Orcan Ogetbil 2.1.4-1 - Updated to 2.1.4. - Set debug="on" on javac part of the build script to compile the aot-bits correctly. (bug#472292) * Sat Oct 11 2008 Orcan Ogetbil 2.1.3-4 - Fix more encoding issues. * Fri Oct 10 2008 Orcan Ogetbil 2.1.3-3 - Included the copyright notice (CC-BY) for the icons among the doc files. * Thu Oct 09 2008 Orcan Ogetbil 2.1.3-2 - Enabled compilation of rups library - Resorted dependencies (added: pdf-renderer, dom4j; removed bouncycastle) - Fixed java dependencies - License is (LGPLv2+ or MPLv1.1) and ASL 2.0 and BSD and MIT and LGPLv2+ and CC-BY - Minor improvements in the SPEC file * Thu Oct 02 2008 Orcan Ogetbil 2.1.3-1 - Repacked with version 2.1.3 * Thu Oct 05 2006 Christian Iseli 1.3-3 - rebuilt for unwind info generation, broken in gcc-4.1.1-21 * Tue Sep 19 2006 Anthony Green - 1.3-2 - Fix release tag. * Mon Sep 18 2006 Anthony Green - 1.3-1jpp_9.2 - Rebuild. * Wed Aug 30 2006 Anthony Green - 1.3-1jpp_9.1 - Rebuild with aot-compile-rpm. * Tue Jul 25 2006 Anthony Green - 1.3-1jpp_9 - Rebuild with new compiler. * Tue Feb 28 2006 Anthony Green - 1.3-1jpp_8 - Rebuild with new compiler. * Mon Jan 17 2006 Anthony Green - 1.3-1jpp_6 - Remove epoch from changelog versions. * Mon Jan 16 2006 Anthony Green - 1.3-1jpp_5 - Remove empty /usr/share/java/itext. - Move manual and javadoc packages to Documentation group. - Add itext-no-javadoc-web-links.patch. * Mon Jan 16 2006 Anthony Green - 1.3-1jpp_4 - Fixed Group. - Cleaned up changelog versions. - Use dos2unix on doc files. - Don't create unversioned javadoc link. * Thu Jan 13 2006 Anthony Green - 1.3-1jpp_3 - Remove javadoc %%postun, as that should get handled by the fact that the file is ghosted. - Improve javadoc and manual subpackage descriptions. * Wed Jan 4 2006 Anthony Green - 1.3-1jpp_2 - Add ant-trax and jaxp_transform_impl dependencies. - Set OPT_JAR_LIST. * Wed Jan 4 2006 Anthony Green - 1.3-1jpp_1 - Build native code. - Add patch to remove proprietary jpeg encoding library usage. - Fix BuildRequires. - Tweak BuildRoot. * Thu Aug 26 2005 Ralph Apel - 1.3-1jpp - Upgrade to 1.3 - Now one jar only * Wed Aug 25 2004 Ralph Apel - 1.02b-2jpp - Build with ant-1.6.2 - Relax some versioned dependencies * Fri Feb 27 2004 Ralph Apel - 1.02b-1jpp - First JPackage release