550c0e7
%global reldate 20170915
Orion Poplawski 8eabeb4
5e6d49c
Name:          apache-poi
550c0e7
Version:       3.17
550c0e7
Release:       1%{?dist}
5e6d49c
Summary:       The Java API for Microsoft Documents
5e6d49c
# ASLv2 + GPLv3 src/resources/scratchpad/org/apache/poi/hdgf/chunks_parse_cmds.tbl
5e6d49c
# https://bugzilla.redhat.com/show_bug.cgi?id=1146670#c13
5e6d49c
License:       ASL 2.0 and (CC-BY and CC-BY-SA and W3C) and GPLv3
5e6d49c
URL:           http://poi.apache.org/
34f1f0e
Source0:       http://archive.apache.org/dist/poi/release/src/poi-src-%{version}%{?reldate:-}%{?reldate}.tar.gz
5e6d49c
# Creative Commons license 4.0 (Attribution-ShareAlike)
2b5a401
# These two zip files renamed after download for deficiencies in fedpkg
2b5a401
#Source1:       http://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%201st%20edition%20Part%204%20%28PDF%29.zip
2b5a401
#Source2:       http://www.ecma-international.org/publications/files/ECMA-ST/Office%20Open%20XML%201st%20edition%20Part%202%20%28PDF%29.zip
2b5a401
Source1:       Office_Open_XML_1st_edition_Part_4__PDF_.zip
2b5a401
Source2:       Office_Open_XML_1st_edition_Part_2__PDF_.zip
5e6d49c
# Creative Commons Attribution 3.0 License
5e6d49c
Source3:       http://dublincore.org/schemas/xmls/qdc/2003/04/02/dc.xsd
5e6d49c
Source4:       http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcterms.xsd
5e6d49c
Source5:       http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcmitype.xsd
5e6d49c
# W3C
5e6d49c
Source6:       http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd
5e6d49c
# http://www.etsi.org/index.php/terms-of-use
5e6d49c
# see https://bz.apache.org/bugzilla/show_bug.cgi?id=57862
5e6d49c
Source7:       http://uri.etsi.org/01903/v1.3.2/XAdES.xsd
5e6d49c
Source8:       http://uri.etsi.org/01903/v1.4.1/XAdESv141.xsd
5e6d49c
34f1f0e
# Force compile of xsds if disconnected
5b7d243
Patch1:        apache-poi-3.14-compile-xsds.patch
34f1f0e
# Disable javadoc doclint
71276e5
Patch2:        apache-poi-3.14-build.patch
5e6d49c
5e6d49c
BuildArch:     noarch
5e6d49c
5e6d49c
BuildRequires: jacoco
5e6d49c
BuildRequires: javapackages-local
550c0e7
BuildRequires: jmh
550c0e7
BuildRequires: jmh-generator-annprocess
34f1f0e
BuildRequires: apache-commons-collections4 >= 4.1
34f1f0e
BuildRequires: apache-commons-codec
34f1f0e
BuildRequires: apache-commons-logging
5b7d243
BuildRequires: mvn(com.github.virtuald:curvesapi)
5e6d49c
BuildRequires: mvn(dom4j:dom4j)
5e6d49c
BuildRequires: mvn(junit:junit)
5e6d49c
BuildRequires: mvn(log4j:log4j:1.2.17)
5e6d49c
BuildRequires: mvn(org.apache.ant:ant-junit)
5e6d49c
BuildRequires: mvn(org.apache.santuario:xmlsec) >= 2.0.1
5e6d49c
BuildRequires: mvn(org.apache.xmlbeans:xmlbeans)
5e6d49c
BuildRequires: mvn(org.bouncycastle:bcpkix-jdk15on)
5e6d49c
BuildRequires: mvn(org.bouncycastle:bcprov-jdk15on)
5e6d49c
BuildRequires: mvn(org.hamcrest:hamcrest-core)
5e6d49c
BuildRequires: mvn(org.ow2.asm:asm-all)
5e6d49c
BuildRequires: mvn(org.slf4j:slf4j-api)
7981aa4
BuildRequires: mvn(rhino:js)
7981aa4
Orion Poplawski 8eabeb4
#Fonts for testing
5e6d49c
BuildRequires: fontconfig liberation-sans-fonts liberation-serif-fonts
5e6d49c
Orion Poplawski 8eabeb4
%description
Orion Poplawski 8eabeb4
The Apache POI Project's mission is to create and maintain Java APIs for
Orion Poplawski 8eabeb4
manipulating various file formats based upon the Office Open XML standards
Orion Poplawski 8eabeb4
(OOXML) and Microsoft's OLE 2 Compound Document format (OLE2). In short, you
Orion Poplawski 8eabeb4
can read and write MS Excel files using Java. In addition, you can read and
Orion Poplawski 8eabeb4
write MS Word and MS PowerPoint files using Java. Apache POI is your Java
Orion Poplawski 8eabeb4
Excel solution (for Excel 97-2008). We have a complete API for porting other
Orion Poplawski 8eabeb4
OOXML and OLE2 formats and welcome others to participate.
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
OLE2 files include most Microsoft Office files such as XLS, DOC, and PPT as
Orion Poplawski 8eabeb4
well as MFC serialization API based file formats. The project provides APIs
Orion Poplawski 8eabeb4
for the OLE2 Filesystem (POIFS) and OLE2 Document Properties (HPSF).
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
Office OpenXML Format is the new standards based XML file format found in
Orion Poplawski 8eabeb4
Microsoft Office 2007 and 2008. This includes XLSX, DOCX and PPTX. The
Orion Poplawski 8eabeb4
project provides a low level API to support the Open Packaging Conventions
Orion Poplawski 8eabeb4
using openxml4j.
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
For each MS Office application there exists a component module that attempts
Orion Poplawski 8eabeb4
to provide a common high level Java API to both OLE2 and OOXML document
Orion Poplawski 8eabeb4
formats. This is most developed for Excel workbooks (SS=HSSF+XSSF). Work is
Orion Poplawski 8eabeb4
progressing for Word documents (HWPF+XWPF) and PowerPoint presentations
Orion Poplawski 8eabeb4
(HSLF+XSLF).
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
The project has recently added support for Outlook (HSMF). Microsoft opened
Orion Poplawski 8eabeb4
the specifications to this format in October 2007. We would welcome
Orion Poplawski 8eabeb4
contributions.
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
There are also projects for Visio (HDGF) and Publisher (HPBF). 
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
%package javadoc
ad3ddf5
Summary:        Javadoc for %{name}
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
%description javadoc
Orion Poplawski 8eabeb4
This package contains the API documentation for %{name}.
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
%prep
34f1f0e
%setup -q -n poi-%{version}
34f1f0e
%patch1
34f1f0e
%patch2
5e6d49c
5b7d243
find -name '*.class' -delete
5b7d243
find -name '*.jar' -delete
5b7d243
Orion Poplawski 8eabeb4
mkdir lib ooxml-lib
550c0e7
build-jar-repository -s -p lib \
550c0e7
  ant commons-collections4 commons-codec commons-logging bcprov bcpkix xmlsec slf4j/slf4j-api log4j-1.2.17 \
550c0e7
  junit hamcrest/core jmh/jmh-core jmh/jmh-generator-annprocess
5b7d243
build-jar-repository -s -p ooxml-lib dom4j xmlbeans/xbean curvesapi
34f1f0e
Orion Poplawski 8eabeb4
#Unpack the XMLSchema
Orion Poplawski 8eabeb4
pushd ooxml-lib
Orion Poplawski 8eabeb4
unzip "%SOURCE1" OfficeOpenXML-XMLSchema.zip
5e6d49c
unzip "%SOURCE2" OpenPackagingConventions-XMLSchema.zip
5e6d49c
cp -p %SOURCE3 .
5e6d49c
cp -p %SOURCE4 .
5e6d49c
cp -p %SOURCE5 .
5e6d49c
cp -p %SOURCE6 .
5e6d49c
cp -p %SOURCE7 .
5e6d49c
cp -p %SOURCE8 .
Orion Poplawski 8eabeb4
popd
Orion Poplawski 8eabeb4
7981aa4
# Customize pom file
550c0e7
%pom_xpath_inject "pom:dependencies/pom:dependency[pom:artifactId ='ant']" \
550c0e7
  "<scope>provided</scope>" maven/poi-excelant.pom
5e6d49c
550c0e7
# Compat symlinks
550c0e7
for m in poi poi-excelant poi-examples poi-ooxml poi-ooxml-schemas poi-scratchpad ; do
550c0e7
%mvn_file org.apache.poi:${m} poi/apache-${m} poi/${m}
5e6d49c
done
Orion Poplawski 8eabeb4
0305b35
# These tests fails on arm builders
91e43ce
rm src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheet.java \
91e43ce
 src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFSheetMergeRegions.java
91e43ce
sed -i '/TestXSSFSheet/d' src/ooxml/testcases/org/apache/poi/xssf/usermodel/AllXSSFUsermodelTests.java
91e43ce
550c0e7
# This test fails for unknown reason
550c0e7
rm src/ooxml/testcases/org/apache/poi/sl/TestFonts.java
550c0e7
Orion Poplawski 8eabeb4
%build
Orion Poplawski 8eabeb4
cat > build.properties <<'EOF'
Orion Poplawski 53b6c24
main.ant.jar=lib/ant.jar
34f1f0e
main.commons-collections4.jar=lib/commons-collections4.jar
Orion Poplawski da28f30
main.commons-codec.jar=lib/commons-codec.jar
Orion Poplawski 8eabeb4
main.commons-logging.jar=lib/commons-logging.jar
34f1f0e
main.log4j.jar=lib/log4j-1.2.17.jar
Orion Poplawski 8eabeb4
main.junit.jar=lib/junit.jar
550c0e7
main.jmh.jar=lib/jmh_jmh-core.jar
550c0e7
main.jmhAnnotation.jar=lib/jmh_jmh-generator-annprocess.jar
ea8c70f
main.hamcrest.jar=lib/hamcrest_core.jar
Orion Poplawski 8eabeb4
ooxml.dom4j.jar=ooxml-lib/dom4j.jar
5b7d243
ooxml.curvesapi.jar=ooxml-lib/curvesapi.jar
Orion Poplawski 1c28ba5
ooxml.xmlbeans23.jar=ooxml-lib/xmlbeans_xbean.jar
Orion Poplawski 1c28ba5
ooxml.xmlbeans26.jar=ooxml-lib/xmlbeans_xbean.jar
5e6d49c
dsig.xmlsec.jar=lib/xmlsec.jar
5e6d49c
dsig.bouncycastle-prov.jar=lib/bcprov.jar
5e6d49c
dsig.bouncycastle-pkix.jar=lib/bcpkix.jar
5e6d49c
dsig.sl4j-api.jar=lib/slf4j_slf4j-api.jar
Orion Poplawski 8eabeb4
disconnected=1
Orion Poplawski 8eabeb4
DSTAMP=%{reldate}
Orion Poplawski 8eabeb4
EOF
Orion Poplawski 8eabeb4
5e6d49c
export ANT_OPTS="-Xmx768m"
550c0e7
ant -propertyfile build.properties compile-ooxml-xsds jar maven-poms javadocs
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
%install
34f1f0e
for m in poi poi-excelant poi-examples poi-ooxml poi-ooxml-schemas poi-scratchpad ; do
550c0e7
%mvn_artifact build/dist/maven/$m/${m}-%{version}.pom build/dist/maven/$m/${m}-%{version}.jar
Orion Poplawski 8eabeb4
done
Orion Poplawski 8eabeb4
5e6d49c
%mvn_install -J build/tmp/site/build/site/apidocs
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
%check
550c0e7
export LANG=en_US.UTF-8 # To enable 8-bit character tests
550c0e7
ant -propertyfile build.properties test
Orion Poplawski 8eabeb4
5e6d49c
%files -f .mfiles
ad3ddf5
%doc KEYS
ad3ddf5
%license LICENSE NOTICE
ad3ddf5
 
5e6d49c
%files javadoc -f .mfiles-javadoc
ad3ddf5
%license LICENSE NOTICE
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
%changelog
550c0e7
* Wed Apr 18 2018 Mat Booth <mat.booth@redhat.com> - 3.17-1
550c0e7
- Update to latest upstream release
550c0e7
- Includes fix for CVE-2017-12626
550c0e7
db73abc
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.15-2
db73abc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
db73abc
34f1f0e
* Fri Aug 18 2017 Mat Booth <mat.booth@redhat.com> - 3.15-1
34f1f0e
- Update to 3.15
34f1f0e
eab8a01
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.14-5
eab8a01
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
eab8a01
d21c03c
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.14-4
d21c03c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d21c03c
0305b35
* Wed Jun 29 2016 gil cattaneo <puntogil@libero.it> 3.14-3
0305b35
- removed some test failures
0305b35
91e43ce
* Sun Jun 26 2016 gil cattaneo <puntogil@libero.it> 3.14-2
91e43ce
- removed some test failures on arm builder
91e43ce
5b7d243
* Wed Mar 16 2016 gil cattaneo <puntogil@libero.it> 3.14-1
5b7d243
- Update to 3.14
5b7d243
986cdf2
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.13-2
986cdf2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
986cdf2
7981aa4
* Sat Sep 26 2015 gil cattaneo <puntogil@libero.it> 3.13-1
7981aa4
- Update to 3.13
7981aa4
5e6d49c
* Tue Sep 01 2015 gil cattaneo <puntogil@libero.it> 3.12-2
5e6d49c
- build fix
5e6d49c
- fix license field
5e6d49c
- obsoletes manual sub-package
5e6d49c
c743681
* Tue Jul  7 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@laptop> - 3.12-1
c743681
- Update to latest version
c743681
346ab53
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10.1-3
346ab53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
346ab53
ad3ddf5
* Wed Feb 11 2015 gil cattaneo <puntogil@libero.it> 3.10.1-2
ad3ddf5
- fix for RHBZ#1138135 (CVE-2014-3574)
ad3ddf5
- introduce license macro
ad3ddf5
Orion Poplawski 1c28ba5
* Thu Sep 4 2014 Orion Poplawski <orion@cora.nwra.com> - 3.10.1-1
Orion Poplawski 1c28ba5
- Update to 3.10.1 (Bug 1138135: CVE-2014-3574 CVE-2014-3529)
Orion Poplawski 1c28ba5
188b3d3
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.10-2
188b3d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
188b3d3
8564501
* Mon Feb 24 2014 Orion Poplawski <orion@cora.nwra.com> - 3.10-1
8564501
- Update to 3.10
8564501
3de6552
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9-2
3de6552
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
3de6552
b43f09f
* Wed Jun 12 2013 Orion Poplawski <orion@cora.nwra.com> - 3.9-1
b43f09f
- Update to 3.9 final
b43f09f
- Install all jars and add poms for each
b43f09f
- Cleanup and update spec
b43f09f
4aae467
* Fri Apr 05 2013 Karsten Hopp <karsten@redhat.com> 3.8-5
4aae467
- drop excludearch ppc64
4aae467
8ae6c59
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8-4
8ae6c59
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
8ae6c59
0ae060f
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8-3
0ae060f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
0ae060f
a764730
* Fri Jul 13 2012 Orion Poplawski <orion@cora.nwra.com> - 3.8-2
a764730
- Add patch to fix compilation with JDK 1.7
a764730
Orion Poplawski 2e7badf
* Thu May 10 2012 Orion Poplawski <orion@cora.nwra.com> - 3.8-1
Orion Poplawski 2e7badf
- Update to 3.8 final
Orion Poplawski e589137
- Add patch to fix CVE-2012-0213 (bugs 799078, 820788)
Orion Poplawski 2e7badf
Orion Poplawski 61875bd
* Thu Jan 5 2012 Orion Poplawski <orion@cora.nwra.com> - 3.8-0.3.beta5
Orion Poplawski 61875bd
- Update to 3.8-beta5
Orion Poplawski 61875bd
Orion Poplawski da28f30
* Fri Jul 22 2011 Orion Poplawski <orion@cora.nwra.com> - 3.8-0.2.beta3
Orion Poplawski da28f30
- Update to 3.8-beta3
Orion Poplawski da28f30
- Add commons-codec to the build jar repository
Orion Poplawski da28f30
Orion Poplawski 53b6c24
* Wed Apr 20 2011 Orion Poplawski <orion@cora.nwra.com> - 3.8-0.1.beta2
Orion Poplawski 53b6c24
- Update to 3.8-beta2
Orion Poplawski 53b6c24
- Add BR fontconfig needed for tests to find fonts
Orion Poplawski 53b6c24
- Fix javadoc link
Orion Poplawski 53b6c24
0c56388
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7-5
0c56388
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
0c56388
Orion Poplawski 348e76c
* Tue Dec 21 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-4
Orion Poplawski 348e76c
- No java >= 1:1.6.0 on ppc64
Orion Poplawski 348e76c
6779503
* Tue Dec 21 2010 Alexander Kurtakov <akurtako@redhat.com> 3.7-3
6779503
- No poi-contrib.jar.
6779503
0d2627f
* Tue Dec 21 2010 Alexander Kurtakov <akurtako@redhat.com> 3.7-2
0d2627f
- Url encode the source.
0d2627f
Orion Poplawski 9c72c65
* Mon Dec 6 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-1
Orion Poplawski 9c72c65
- Update to 3.7 final
Orion Poplawski 9c72c65
Orion Poplawski 8eabeb4
* Mon Nov 8 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-0.5.beta3
Orion Poplawski 8eabeb4
- Add pom
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
* Mon Nov 1 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-0.4.beta3
Orion Poplawski 8eabeb4
- Fix manual package
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
* Wed Oct 27 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-0.3.beta3
Orion Poplawski 8eabeb4
- Update to 3.7 beta3
Orion Poplawski 8eabeb4
- Add more Requires
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
* Wed Sep 1 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-0.2.beta2
Orion Poplawski 8eabeb4
- Update to 3.7 beta2
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
* Fri Jun 25 2010 Orion Poplawski <orion@cora.nwra.com> - 3.7-0.1.beta1
Orion Poplawski 8eabeb4
- Update to 3.7 beta1
Orion Poplawski 8eabeb4
- Rebase compile-xsds patch
Orion Poplawski 8eabeb4
Orion Poplawski 8eabeb4
* Fri Jun 25 2010 Orion Poplawski <orion@cora.nwra.com> - 3.6-1
Orion Poplawski 8eabeb4
- Initial Fedora package