# Work around koji build issues on ppc64 # See https://www.redhat.com/archives/fedora-devel-list/2009-March/msg00022.html %global libreoffice_dir $(ls -d /usr/lib*/libreoffice) Name: jabref Version: 2.8 Release: 4%{?dist} Summary: Graphical frontend to manage BibTeX bibliographical databases License: GPLv2+ and BSD Group: Applications/Publishing Url: http://jabref.sourceforge.net/ BuildArch: noarch Source0: http://downloads.sourceforge.net/%{name}/JabRef-%{version}-src.tar.bz2 Source1: jabref.desktop # Adapted from the man page included in the Debian jabref package Source2: jabref.1 # Don't package other classes into the jar; don't use manifest; # point to system jars; use correct encoding for javadocs Patch0: %{name}-2.8-build_xml.patch # Regenerate the antlr parser with a more modern version of antlr3 Patch1: %{name}-2.8b-antlr.patch # Remove the explicit use of the Windows L&F Patch2: %{name}-2.4.2-remove-windows.patch # Remove all uses of "SPL" Patch3: %{name}-2.8b-remove-spl.patch # Use the newest jgoodies API (adapted from commit a7cbac6e0d0cfe3c7399827cc240316650c04644) Patch4: %{name}-2.8-jgoodies.patch BuildRequires: jpackage-utils BuildRequires: java-devel BuildRequires: ant BuildRequires: antlr3-java BuildRequires: antlr3-tool BuildRequires: antlr-tool BuildRequires: apache-commons-logging BuildRequires: glazedlists BuildRequires: jempbox BuildRequires: jgoodies-forms >= 1.5.0 BuildRequires: jgoodies-looks >= 2.5.0 BuildRequires: jpf BuildRequires: jpfcodegen BuildRequires: libreoffice-core >= 1:3.5.2 BuildRequires: microba BuildRequires: pdfbox BuildRequires: ritopt BuildRequires: spin BuildRequires: stringtemplate4 BuildRequires: desktop-file-utils Requires: java Requires: jpackage-utils Requires: antlr3-java Requires: antlr3-tool Requires: antlr-tool Requires: apache-commons-logging Requires: glazedlists Requires: jempbox Requires: jgoodies-forms >= 1.5.0 Requires: jgoodies-looks >= 2.5.0 Requires: jpf Requires: jpfcodegen Requires: microba Requires: pdfbox Requires: ritopt Requires: spin Requires(post): desktop-file-utils Requires(postun): desktop-file-utils %description JabRef is a graphical front-end to manage BibTeX databases, the standard LaTeX bibliography reference format. JabRef is build to be platform independent (requires Java >= 1.4.2). It merges and extends the functionalities of BibKeeper (Morten O. Alver) and JBibtexManager (Nizar Batada). %package javadoc Summary: Javadoc for %{name} Group: Documentation Requires: jpackage-utils %description javadoc API documentation for %{name}. %prep %setup -q # Clean up the build %patch0 -p1 # Fix errors in the antlr parser %patch1 -p1 # Remove explicit reference to the Windows L&F %patch2 -p1 # Remove bundled "ritopt" package and clean up the source rm -rf src/java/gnu # Remove "sciplore" client rm -rf src/java/net/sf/jabref/spl src/java/spl %patch3 -p1 # Change a deprecated API from JGoodies Forms %patch4 -p2 # Fix one file permission chmod a-x src/txt/gpl2.txt # Remove all pre-built jar files find -name '*.class' -exec rm -f '{}' \; find -name '*.jar' -exec rm -f '{}' \; %build # Fix errors in the antlr parser and regenerate rm -f src/java/net/sf/jabref/bst/Bst*.java mv src/java/net/sf/jabref/bst/bst.g src/java/net/sf/jabref/bst/Bst.g java -cp `build-classpath antlr antlr3 antlr3-runtime stringtemplate4` org.antlr.Tool src/java/net/sf/jabref/bst/Bst.g # Use system jars export CLASSPATH=$(build-classpath antlr antlr3 antlr3-runtime apache-commons-logging glazedlists jempbox jgoodies-common jgoodies-forms jgoodies-looks jpf jpf-boot jpfcodegen microba pdfbox ritopt spin) # Libreoffice jars (build dependency only) export CLASSPATH=$CLASSPATH:%{libreoffice_dir}/program/classes/unoil.jar export CLASSPATH=$CLASSPATH:%{libreoffice_dir}/ure/share/java/ridl.jar export CLASSPATH=$CLASSPATH:%{libreoffice_dir}/ure/share/java/juh.jar export CLASSPATH=$CLASSPATH:%{libreoffice_dir}/ure/share/java/jurt.jar ant jars docs %install # Install Java stuff install -d -m 755 $RPM_BUILD_ROOT%{_javadir} install -pm 644 build/lib/JabRef-%{version}.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}.jar # Javadoc install -d -m 755 p $RPM_BUILD_ROOT%{_javadocdir}/%{name} cp -r build/docs/API/* $RPM_BUILD_ROOT%{_javadocdir}/%{name} # Install desktop file, icon, man page, and shell script mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/48x48/apps/ cp -p src/images/JabRef-icon-48.png \ ${RPM_BUILD_ROOT}%{_datadir}/icons/hicolor/48x48/apps/jabref.png desktop-file-install \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ %{SOURCE1} install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1 install -pm 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1 %jpackage_script net.sf.jabref.JabRefMain "" "" antlr:antlr3:antlr3-runtime:apache-commons-logging:glazedlists:jempbox:jgoodies-common:jgoodies-forms:jgoodies-looks:jpf:jpf-boot:jpfcodegen-rt:microba:pdfbox:ritopt:spin:jabref jabref true %post -p /usr/bin/update-desktop-database %postun -p /usr/bin/update-desktop-database %files %doc src/txt/CHANGELOG src/txt/README src/txt/TODO src/txt/*.txt %{_datadir}/applications/%{name}.desktop %{_datadir}/icons/hicolor/48x48/apps/%{name}.png %{_javadir}/%{name}.jar %{_bindir}/%{name} %doc %{_mandir}/man1/%{name}.1.gz %files javadoc %doc src/txt/gpl*.txt %{_javadocdir}/%{name} %changelog * Fri May 25 2012 Mary Ellen Foster - 2.8-4 - Correct path to libreoffice jars on all build architectures * Fri May 25 2012 Mary Ellen Foster - 2.8-3 - Access system jars in a different way * Fri May 25 2012 Mary Ellen Foster - 2.8-2 - Add javadoc subpackage - Use upstream patch to update jgoodies API - Modify build.xml to point to system jars instead of using CLASSPATH * Fri May 18 2012 Mary Ellen Foster - 2.8-1 - Update to 2.8 final * Wed May 9 2012 Mary Ellen Foster - 2.8-0.6.b2 - Update to new jgoodies APIs - Change path to libreoffice jars * Mon Mar 19 2012 Mary Ellen Foster - 2.8-0.5.b2 - Upgrade to beta 2 * Mon Feb 13 2012 Mary Ellen Foster - 2.8-0.4.b - Remove defattr line from files section * Mon Jan 30 2012 Mary Ellen Foster - 2.8-0.3.b - Update after looking at Debian package: - Use separately packaged JPFCodeGen library - Add man page - Add file argument to Exec line in desktop file - Fix the broken "remove-wsi" patch * Wed Jan 25 2012 Mary Ellen Foster - 2.8-0.2.b - Remove clean section and unnecessary permissions on shell script - Remove classpath from jar manifest - Remove unneeded patch * Wed Jan 25 2012 Mary Ellen Foster - 2.8-0.1.b - Initial package