diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ec72963 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +1.0.2.tar.gz diff --git a/XDocumentPropertiesSupplier-writer2xhtml.patch b/XDocumentPropertiesSupplier-writer2xhtml.patch new file mode 100644 index 0000000..6a0f656 --- /dev/null +++ b/XDocumentPropertiesSupplier-writer2xhtml.patch @@ -0,0 +1,57 @@ +Index: trunk/source/java/org/openoffice/da/comp/writer2xhtml/BatchConverter.java +=================================================================== +--- trunk/source/java/org/openoffice/da/comp/writer2xhtml/BatchConverter.java (revision 150) ++++ trunk/source/java/org/openoffice/da/comp/writer2xhtml/BatchConverter.java (working copy) +@@ -35,8 +35,8 @@ + import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter; + import com.sun.star.beans.PropertyValue; + import com.sun.star.beans.UnknownPropertyException; +-import com.sun.star.beans.XPropertySet; +-import com.sun.star.document.XDocumentInfoSupplier; ++import com.sun.star.document.XDocumentProperties; ++import com.sun.star.document.XDocumentPropertiesSupplier; + import com.sun.star.frame.XComponentLoader; + import com.sun.star.frame.XStorable; + import com.sun.star.io.NotConnectedException; +@@ -367,33 +367,15 @@ + } + + // Get the title and the description of the document +- XDocumentInfoSupplier docInfo = (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xDocument); +- XPropertySet infoProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, docInfo.getDocumentInfo()); +- if (infoProps!=null) { +- try { +- Object loadedTitle = infoProps.getPropertyValue("Title"); +- if (AnyConverter.isString(loadedTitle)) { +- String sLoadedTitle = AnyConverter.toString(loadedTitle); +- if (bUseTitle && sLoadedTitle.length()>0) { +- entry.setDisplayName(sLoadedTitle); +- } +- } +- +- Object loadedDescription = infoProps.getPropertyValue("Description"); +- if (AnyConverter.isString(loadedDescription)) { +- String sLoadedDescription = AnyConverter.toString(loadedDescription); +- if (bUseDescription && sLoadedDescription.length()>0) { +- entry.setDescription(sLoadedDescription); +- } +- } +- } +- catch (UnknownPropertyException e) { +- } +- catch (WrappedTargetException e) { +- } +- catch (com.sun.star.lang.IllegalArgumentException e) { +- } ++ XDocumentProperties docProps = ((XDocumentPropertiesSupplier) UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xDocument)).getDocumentProperties(); ++ String loadedTitle = docProps.getTitle(); ++ if (bUseTitle && loadedTitle.length()>0) { ++ entry.setDisplayName(loadedTitle); + } ++ String loadedDescription = docProps.getDescription(); ++ if (bUseDescription && loadedDescription.length()>0) { ++ entry.setDescription(loadedDescription); ++ } + + // Determine the type of the component + boolean bText = false; diff --git a/XDocumentPropertiesSupplier.patch b/XDocumentPropertiesSupplier.patch new file mode 100644 index 0000000..b2e2045 --- /dev/null +++ b/XDocumentPropertiesSupplier.patch @@ -0,0 +1,30 @@ +Index: trunk/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java +=================================================================== +--- trunk/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java (revision 150) ++++ trunk/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java (working copy) +@@ -33,7 +33,7 @@ + import com.sun.star.beans.XPropertyAccess; + import com.sun.star.beans.XPropertySet; + import com.sun.star.container.XNameAccess; +-import com.sun.star.document.XDocumentInfoSupplier; ++import com.sun.star.document.XDocumentPropertiesSupplier; + import com.sun.star.frame.XDesktop; + import com.sun.star.lang.XComponent; + import com.sun.star.lang.IllegalArgumentException; +@@ -179,13 +179,9 @@ + XComponent xComponent = xDesktop.getCurrentComponent(); + + // Get the document info property set +- XDocumentInfoSupplier xDocInfoSuppl = (XDocumentInfoSupplier) +- UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xComponent); +- Object docInfo = xDocInfoSuppl.getDocumentInfo(); +- XPropertySet xDocInfo = (XPropertySet) +- UnoRuntime.queryInterface(XPropertySet.class, docInfo); +- +- return getPropertyValueAsString(xDocInfo,"Template"); ++ XDocumentPropertiesSupplier xDocPropsSuppl = (XDocumentPropertiesSupplier) ++ UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xComponent); ++ return xDocPropsSuppl.getDocumentProperties().getTemplateName(); + } + catch (Exception e) { + return ""; diff --git a/dead.package b/dead.package deleted file mode 100644 index 5204a84..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -Orphaned for 6+ weeks diff --git a/sources b/sources new file mode 100644 index 0000000..3d8d167 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +542369caf2b79de81d21549090fe9807 1.0.2.tar.gz diff --git a/writer2latex.metainfo.xml b/writer2latex.metainfo.xml new file mode 100644 index 0000000..9ff59b5 --- /dev/null +++ b/writer2latex.metainfo.xml @@ -0,0 +1,11 @@ + + + net.sourceforge.writer2latex.writer2latex.addon + libreoffice-writer.desktop + Writer2LaTeX + Provides LaTeX and BibTeX export for LibreOffice + http://writer2latex.sourceforge.net/ + http://sourceforge.net/p/writer2latex/tracker/ + CC0-1.0 + LGPL-2.0 + diff --git a/writer2latex.spec b/writer2latex.spec new file mode 100644 index 0000000..1694962 --- /dev/null +++ b/writer2latex.spec @@ -0,0 +1,263 @@ +# rhbz#1025499 the package is technically noarch (java), but libreoffice +# does not have any arch-independent extension location +%global debug_package %{nil} + +Name: writer2latex +Version: 1.0.2 +Release: 26%{?dist} +Summary: Document Converter from ODT to LaTeX +License: LGPLv2 +Url: http://writer2latex.sourceforge.net/ +Source0: http://writer2latex.svn.sourceforge.net/viewvc/writer2latex/tags/%{version}.tar.gz +Source1: writer2latex.metainfo.xml +Source2: writer2xhtml.metainfo.xml +Patch0: writer2latex05.rh.patch +Patch1: XDocumentPropertiesSupplier.patch +Patch2: XDocumentPropertiesSupplier-writer2xhtml.patch + # Path1--2 upstreamed as "LibreOffice 4 doesn't show + # LaTeX Options dialog upon export" +BuildRequires: ant +BuildRequires: java-devel +BuildRequires: libreoffice-core +BuildRequires: osgi(javax.xml) + +%global baseinstdir %{_libdir}/libreoffice + +%description +Writer2LaTeX is a utility written in java. It converts LibreOffice documents +– in particular documents containing formulas – into other formats. It is +actually a collection of four converters, i.e.: +1) Writer2LaTeX converts documents into LaTeX 2e format for high quality + typesetting. +2) Writer2BibTeX extracts bibliographic data from a document and stores it in + BibTeX format (works together with Writer2LaTeX). +3) Writer2xhtml converts documents into XHTML 1.0 or XHTML 1.1+MathML 2.0 with + CSS2. +4) Calc2xhtml is a companion to Writer2xhtml that converts OOo Calc documents + to XHTML 1.0 with CSS2 to display your spreadsheets on the web. + +%package java +Summary: Java library for %{name} +BuildArch: noarch +Requires: osgi(javax.xml) +Suggests: %{name}-doc +Obsoletes: %{name} < 1.0.2-18 +Provides: %{name} = %{version}-%{release} + +%description java +A java library for document conversion from ODT to LaTeX, BibTeX, XHTML, +HTML5 and EPUB. + +%package doc +Summary: User manual for %{name} +BuildArch: noarch + +%description doc +User manual for %{name}. + +%package javadoc +Summary: Javadoc for %{name} +BuildArch: noarch + +%description javadoc +Javadoc for %{name}. + +%package -n libreoffice-writer2latex +Summary: LibreOffice Writer To LateX Converter +Requires: libreoffice-core%{?_isa} +Requires: osgi(javax.xml) +Suggests: %{name}-doc +Obsoletes: openoffice.org-writer2latex < 1.0.2-4 + +%package -n libreoffice-writer2xhtml +Summary: LibreOffice Writer to xhtml Converter +Requires: libreoffice-core%{?_isa} +Requires: osgi(javax.xml) +Suggests: %{name}-doc +Obsoletes: openoffice.org-writer2xhtml < 1.0.2-4 + +%description -n libreoffice-writer2latex +Document Converter Extension for LibreOffice to provide +LaTeX and BibTeX export filters. + +%description -n libreoffice-writer2xhtml +Document Converter Extension for LibreOffice to provide +XHTML export filters. + +%prep +%autosetup -n %{version} -p1 +sed -i -e 's#name="OFFICE_CLASSES" location="/usr/share/java/openoffice"#name="OFFICE_CLASSES" location="%{_libdir}/libreoffice/program/classes"#' build.xml +sed -i -e 's#name="URE_CLASSES" location="/usr/share/java/openoffice"#name="URE_CLASSES" location="%{_libdir}/libreoffice/program/classes"#' build.xml + +%build +ant jar javadoc oxt + +%install +# jar +install -d -m 755 $RPM_BUILD_ROOT%{_javadir} +install -p -m 644 target/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar +# javadoc +install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} +cp -p -r target/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} +pushd $RPM_BUILD_ROOT%{_javadocdir} +ln -s %{name}-%{version} %{name} +popd +# LibreOffice extensions +install -d -m 755 $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/writer2latex.oxt +unzip target/lib/writer2latex.oxt -d $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/writer2latex.oxt +install -d -m 755 $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/writer2xhtml.oxt +unzip target/lib/writer2xhtml.oxt -d $RPM_BUILD_ROOT%{baseinstdir}/share/extensions/writer2xhtml.oxt +# AppData metadata +install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/appdata +install -p -m 644 %{SOURCE1} %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/appdata + +%files java +%license source/distro/COPYING.TXT +%{_javadir}/* + +%files doc +%doc source/distro/History.txt source/distro/Readme.txt source/distro/doc/user-manual.odt +%license source/distro/COPYING.TXT + +%files javadoc +%license source/distro/COPYING.TXT +%{_javadocdir}/%{name} +%{_javadocdir}/%{name}-%{version} + +%files -n libreoffice-writer2latex +%license source/distro/COPYING.TXT +%{baseinstdir}/share/extensions/writer2latex.oxt +%{_datadir}/appdata/writer2latex.metainfo.xml + +%files -n libreoffice-writer2xhtml +%license source/distro/COPYING.TXT +%{baseinstdir}/share/extensions/writer2xhtml.oxt +%{_datadir}/appdata/writer2xhtml.metainfo.xml + +%changelog +* Sat Jul 27 2019 Fedora Release Engineering - 1.0.2-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 03 2019 Fedora Release Engineering - 1.0.2-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.0.2-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 1.0.2-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 1.0.2-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.0.2-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 1.0.2-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Feb 05 2016 Fedora Release Engineering - 1.0.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 05 2016 David Tardon - 1.0.2-18 +- add AppData Addon metadata +- move writer2latex.jar into a noarch subpackage +- split user manual into a separate noarch subpackage + +* Tue Jul 07 2015 Caolán McNamara - 1.0.2-17 +- Resolves: rhbz#1240059 FTBFS with merged ure dirs + +* Fri Jun 19 2015 Fedora Release Engineering - 1.0.2-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Aug 18 2014 Fedora Release Engineering - 1.0.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sun Jun 08 2014 Fedora Release Engineering - 1.0.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Oct 31 2013 David Tardon - 1.0.2-13 +- Resolves: rhbz#1025499 there is no debuginfo here + +* Wed Oct 23 2013 Caolán McNamara - 1.0.2-12 +- Resolves: rhbz#1022169 remove versioned jars + +* Sun Aug 04 2013 Fedora Release Engineering - 1.0.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Feb 22 2013 Stephan Bergmann - 1.0.2-10 +- Resolves: rhbz#914578 FTBFS (incl. adaption to LibreOffice 4.0 API changes) + +* Fri Feb 15 2013 Fedora Release Engineering - 1.0.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Jul 22 2012 Fedora Release Engineering - 1.0.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 1.0.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Jun 23 2011 Caolán McNamara 1.0.2-6 +- Resolves: rhbz#715890 FTBFS, just use basis-link from now on + +* Mon Feb 07 2011 Fedora Release Engineering - 1.0.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sat Oct 23 2010 Caolán McNamara 1.0.2-4 +- Resolves: rhbz#645906 rebuild for LibreOffice + +* Wed Jul 14 2010 Caolán McNamara 1.0.2-3 +- rebuild for OpenOffice.org 3.3 + +* Thu Jul 08 2010 Caolán McNamara 1.0.2-2 +- add COPYING to all subpackages + +* Sat Jun 05 2010 Caolán McNamara 1.0.2-1 +- latest version + +* Tue Mar 09 2010 Caolán McNamara 1.0.1-1 +- latest version + +* Mon Dec 21 2009 Caolán McNamara 1.0-3 +- Preserve time stamps + +* Thu Nov 19 2009 Caolán McNamara 1.0-2 +- Resolves: rhbz#539035 update for OOo 3.2 + +* Mon Sep 21 2009 Caolán McNamara 1.0-1 +- latest version + +* Fri Jul 24 2009 Caolán McNamara 0.5.0.2-7 +- make javadoc no-arch when building as arch-dependant aot + +* Thu Feb 26 2009 Caol@n McNamara 0.5.0.2-6 +- update for 3.1 + +* Wed Feb 25 2009 Fedora Release Engineering - 0.5.0.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sun Nov 23 2008 Caolán McNamara 0.5.0.2-4 +- tweak summary + +* Thu Nov 20 2008 Caolán McNamara 0.5.0.2-3 +- upstream repacked tarballs to replace 0.5.0.1 with 0.5.0.2 + +* Mon Oct 06 2008 Caolán McNamara 0.5.0.2-2 +- update for guidelines + +* Wed Sep 03 2008 Caolán McNamara 0.5.0.2-1 +- latest version + +* Sat Aug 09 2008 Caolán McNamara 0.5-4 +- use generic requires + +* Mon Mar 31 2008 Caolán McNamara 0.5-3 +- tweak for guidelines +- and adjust for OOo3 3 layer packaging + +* Mon Feb 18 2008 Fedora Release Engineering - 0.5-2 +- Autorebuild for GCC 4.3 + +* Sat Dec 1 2007 Caolán McNamara 0.5-1 +- initial version diff --git a/writer2latex05.rh.patch b/writer2latex05.rh.patch new file mode 100644 index 0000000..305823c --- /dev/null +++ b/writer2latex05.rh.patch @@ -0,0 +1,29 @@ +--- writer2latex05.orig/build.xml 2007-11-16 11:19:54.000000000 +0000 ++++ writer2latex05/build.xml 2007-11-16 11:30:50.000000000 +0000 +@@ -100,7 +100,7 @@ + + + +- ++ + + + +@@ -135,7 +135,7 @@ + + + +- ++ + + + +@@ -174,7 +174,7 @@ + + + +- ++ + + + diff --git a/writer2xhtml.metainfo.xml b/writer2xhtml.metainfo.xml new file mode 100644 index 0000000..6cda16b --- /dev/null +++ b/writer2xhtml.metainfo.xml @@ -0,0 +1,12 @@ + + + net.sourceforge.writer2latex.writer2xhtml.addon + libreoffice-calc + libreoffice-writer.desktop + Writer2xhtml + Provides XHTML, HTML5 and EPUB export for LibreOffice + http://writer2latex.sourceforge.net/ + http://sourceforge.net/p/writer2latex/tracker/ + CC0-1.0 + LGPL-2.0 +