Blame SPECS/tika.spec

aa1005
%{?scl:%scl_package tika}
aa1005
%{!?scl:%global pkg_name %{name}}
aa1005
%{?java_common_find_provides_and_requires}
aa1005
aa1005
# Conditionals to help breaking tika <-> vorbis-java-tika dependency cycle
aa1005
%if 0%{?rhel}
aa1005
%bcond_without vorbis_tika
aa1005
# Disable only for now
aa1005
%bcond_with tika_parsers
aa1005
%bcond_without tika_app
aa1005
%endif
aa1005
aa1005
Name:          %{?scl_prefix}tika
aa1005
Version:       1.5
aa1005
Release:       6.2%{?dist}
aa1005
Summary:       A content analysis toolkit
aa1005
License:       ASL 2.0
aa1005
Url:           http://tika.apache.org/
aa1005
Source0:       http://www.apache.org/dist/tika/%{pkg_name}-%{version}-src.zip
aa1005
# Fix stax-api gId:aId
aa1005
# Replace unavailable org.ow2.asm:asm-debug-all:4.1
aa1005
# Replace ant-nodeps with ant
aa1005
# Fix bouncycastle aId
aa1005
Patch0:        %{pkg_name}-1.4-fix-build-deps.patch
aa1005
Patch1:        %{pkg_name}-1.4-bouncycastle-1.50.patch
aa1005
Patch2:        %{pkg_name}-1.5-metadata-extractor.patch
aa1005
aa1005
BuildRequires: %{?scl_prefix_maven}mvn(biz.aQute:bndlib)
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(org.apache.ant:ant)
aa1005
BuildRequires: %{?scl_prefix_maven}mvn(org.osgi:org.osgi.compendium)
aa1005
BuildRequires: %{?scl_prefix_maven}mvn(org.osgi:org.osgi.core)
aa1005
aa1005
%if %{without vorbis_tika}
aa1005
BuildRequires: mvn(org.gagravarr:vorbis-java-tika)
aa1005
%endif
aa1005
aa1005
%if %{without tika_parsers}
aa1005
BuildRequires: %{?scl_prefix_java_common}apache-commons-logging
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(commons-codec:commons-codec)
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(javax.xml.stream:stax-api)
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(org.apache.commons:commons-compress)
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(org.ow2.asm:asm-all:5)
aa1005
BuildRequires: %{?scl_prefix}mvn(rome:rome)
aa1005
%if %{without tika_app}
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(com.google.code.gson:gson)
aa1005
BuildRequires: mvn(log4j:log4j:1.2.17)
aa1005
BuildRequires: mvn(org.slf4j:slf4j-log4j12)
aa1005
%endif
aa1005
%endif
aa1005
aa1005
%if 0
aa1005
# tika-server deps
aa1005
BuildRequires: mvn(net.sf.opencsv:opencsv:2.0)
aa1005
BuildRequires: mvn(org.apache.cxf:cxf-rt-frontend-jaxrs:2.6.1)
aa1005
BuildRequires: mvn(org.apache.cxf:cxf-rt-transports-http-jetty:2.6.1)
aa1005
# tika-parser deps
aa1005
BuildRequires: mvn(com.googlecode.mp4parser:mp4parser-project:1.0-RC-1)
aa1005
BuildRequires: mvn(com.googlecode.mp4parser:isoparser:1.0-RC-1)
aa1005
# tika-xmp
aa1005
BuildRequires: mvn(org.apache.felix:maven-scr-plugin:1.7.4)
aa1005
%endif
aa1005
aa1005
# Test deps
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(junit:junit)
aa1005
BuildRequires: %{?scl_prefix}mvn(org.mockito:mockito-core)
aa1005
BuildRequires: %{?scl_prefix_java_common}mvn(xml-apis:xml-apis)
aa1005
aa1005
BuildRequires: %{?scl_prefix_java_common}maven-local
aa1005
BuildRequires: %{?scl_prefix_maven}maven-failsafe-plugin
aa1005
BuildRequires: %{?scl_prefix_maven}maven-plugin-bundle
aa1005
BuildRequires: %{?scl_prefix_maven}maven-remote-resources-plugin
aa1005
BuildRequires: %{?scl_prefix_maven}maven-site-plugin
aa1005
aa1005
BuildArch:     noarch
aa1005
aa1005
%description
aa1005
The Apache Tika toolkit detects and extracts meta-data and
aa1005
structured text content from various documents using existing
aa1005
parser libraries.
aa1005
aa1005
%if %{without tika_parsers}
aa1005
aa1005
%package parsers
aa1005
Summary:       Apache Tika parsers
aa1005
aa1005
%description parsers
aa1005
Apache Tika parsers implementation that matches the
aa1005
type of the document, once it is known, using
aa1005
Mime Type detection.
aa1005
aa1005
%package java7
aa1005
Summary:       Apache Tika Java-7 Components
aa1005
aa1005
%description java7
aa1005
Java-7 reliant components, including FileTypeDetector
aa1005
implementations.
aa1005
aa1005
%if %{without tika_app}
aa1005
aa1005
%package app
aa1005
Summary:       Apache Tika Application
aa1005
Requires:      mvn(log4j:log4j:1.2.17)
aa1005
aa1005
%description app
aa1005
Apache Tika standalone application.
aa1005
%endif
aa1005
%endif
aa1005
aa1005
%package javadoc
aa1005
Summary:       Javadoc for %{pkg_name}
aa1005
aa1005
%description javadoc
aa1005
This package contains javadoc for %{pkg_name}.
aa1005
aa1005
%prep
aa1005
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
aa1005
set -e -x
aa1005
%setup -n %{pkg_name}-%{version} -q
aa1005
# Cleanup
aa1005
find . -name '*.jar' -delete
aa1005
find . -name '*.class' -delete
aa1005
# Remove unwanted test resources
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/testLinux-*-*
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/testFreeBSD-*
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/testSolaris-*
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.ibooks
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.numbers
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.pages
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.key
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.war
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.wma
aa1005
rm -r %{pkg_name}-parsers/src/test/resources/test-documents/*.wmv
aa1005
find . -name '*.7z' -delete
aa1005
find . -name '*.ar' -delete
aa1005
find . -name '*.cpio' -delete
aa1005
find . -name '*.ear' -delete
aa1005
find . -name '*.exe' -delete
aa1005
find . -name '*.mp*' -delete
aa1005
find . -name '*.tbz2' -delete
aa1005
find . -name '*.tgz' -delete
aa1005
find . -name '*.zip' -delete
aa1005
%patch0 -p1
aa1005
%patch1 -p1
aa1005
%patch2 -p1
aa1005
aa1005
%pom_disable_module %{pkg_name}-bundle
aa1005
%pom_disable_module %{pkg_name}-server
aa1005
%pom_disable_module %{pkg_name}-xmp
aa1005
# Unavailable plugins
aa1005
%pom_remove_plugin org.codehaus.mojo:clirr-maven-plugin %{pkg_name}-core
aa1005
%pom_remove_plugin org.apache.felix:maven-scr-plugin %{pkg_name}-xmp
aa1005
%pom_remove_plugin org.apache.felix:maven-scr-plugin %{pkg_name}-java7
aa1005
aa1005
# Require com.drewnoakes:metadata-extractor:2.6.2 and fedora metadata-extractor pkg is too old
aa1005
# see https://bugzilla.redhat.com/show_bug.cgi?id=947457
aa1005
%pom_xpath_set "pom:project/pom:dependencies/pom:dependency[pom:artifactId='metadata-extractor']/pom:version" 2  %{pkg_name}-parsers
aa1005
%pom_xpath_set "pom:project/pom:dependencies/pom:dependency[pom:artifactId='asm-all']/pom:version" 5.0.3  %{pkg_name}-parsers
aa1005
# Disable vorbis-java-tika support, cause circular dependency
aa1005
%if %{with vorbis_tika}
aa1005
%pom_remove_dep :vorbis-java-tika %{pkg_name}-parsers
aa1005
%endif
aa1005
aa1005
%if %{with tika_parsers}
aa1005
%pom_disable_module %{pkg_name}-parsers
aa1005
%else
aa1005
%if %{with tika_app}
aa1005
%pom_disable_module %{pkg_name}-app
aa1005
%else
aa1005
# No bundled libraries are shipped
aa1005
%pom_remove_plugin :maven-shade-plugin %{pkg_name}-app
aa1005
%pom_remove_plugin :maven-antrun-plugin %{pkg_name}-app
aa1005
%endif
aa1005
%endif
aa1005
aa1005
# Unavailable build dep com.googlecode.mp4parser:isoparser
aa1005
# MP4 is non-free remove support for it
aa1005
%pom_remove_dep com.googlecode.mp4parser:isoparser %{pkg_name}-parsers
aa1005
rm -r %{pkg_name}-parsers/src/main/java/org/apache/tika/parser/mp4/MP4Parser.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/mp4/MP4ParserTest.java
aa1005
aa1005
# This test require network
aa1005
rm %{pkg_name}-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
aa1005
# These test fails for unavailable deps: com.googlecode.mp4parser:isoparser and org.gagravarr:vorbis-java-tika
aa1005
rm -r %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/mail/RFC822ParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/mbox/MboxParserTest.java
aa1005
rm -r %{pkg_name}-parsers/src/test/java/org/apache/tika/detect/TestContainerAwareDetector.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/AutoDetectParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/asm/ClassParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/pkg/Bzip2ParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/pkg/GzipParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/pkg/TarParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/pkg/ZipParserTest.java
aa1005
rm -r %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/image/ImageMetadataExtractorTest.java
aa1005
# Fails for unavailable test resources
aa1005
rm -r %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/microsoft/ProjectParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/mp3/Mp3ParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/iwork/IWorkParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/pkg/ArParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/executable/ExecutableParserTest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/ibooks/iBooksParserTest.java \
aa1005
 %{pkg_name}-app/src/test/java/org/apache/tika/cli/TikaCLITest.java \
aa1005
 %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java
aa1005
aa1005
# NullPointerException: null
aa1005
rm -r %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/fork/ForkParserIntegrationTest.java
aa1005
# NoClassDefFoundError: org/w3c/dom/ElementTraversal
aa1005
%pom_add_dep xml-apis:xml-apis::test %{pkg_name}-parsers
aa1005
%pom_add_dep org.apache.commons:commons-logging:1.5 %{pkg_name}-parsers
aa1005
aa1005
# ComparisonFailure: Date/Time Original for when the photo was taken, unspecified time zone expected:<2009-08-11T[09]:09:45> but was:<2009-08-11T[11]:09:45>
aa1005
rm -r %{pkg_name}-parsers/src/test/java/org/apache/tika/parser/jpeg/JpegParserTest.java
aa1005
aa1005
#Remove deps required by parsers other than epub
aa1005
%pom_remove_dep org.apache.felix:org.apache.felix.scr.annotations %{pkg_name}-parsers
aa1005
%pom_remove_dep edu.ucar:netcdf %{pkg_name}-parsers
aa1005
%pom_remove_dep org.apache.james:apache-mime4j-core %{pkg_name}-parsers
aa1005
%pom_remove_dep org.apache.james:apache-mime4j-dom %{pkg_name}-parsers
aa1005
%pom_remove_dep org.apache.pdfbox:pdfbox %{pkg_name}-parsers
aa1005
%pom_remove_dep org.bouncycastle:bcmail-jdk16 %{pkg_name}-parsers
aa1005
%pom_remove_dep org.apache.poi:poi %{pkg_name}-parsers
aa1005
%pom_remove_dep org.apache.poi:poi-scratchpad %{pkg_name}-parsers
aa1005
%pom_remove_dep org.apache.poi:poi-ooxml %{pkg_name}-parsers
aa1005
%pom_remove_dep org.ccil.cowan.tagsoup:tagsoup %{pkg_name}-parsers
aa1005
%pom_remove_dep com.drewnoakes:metadata-extractor %{pkg_name}-parsers
aa1005
%pom_remove_dep de.l3s.boilerpipe:boilerpipe %{pkg_name}-parsers
aa1005
%pom_remove_dep org.gagravarr:vorbis-java-core %{pkg_name}-parsers
aa1005
%pom_remove_dep com.googlecode.juniversalchardet:juniversalchardet %{pkg_name}-parsers
aa1005
%pom_remove_dep org.bouncycastle:bcprov-jdk16 %{pkg_name}-parsers
aa1005
%pom_remove_dep org.slf4j:slf4j-log4j12 %{pkg_name}-parsers
aa1005
%pom_remove_dep com.uwyn:jhighlight %{pkg_name}-parsers
aa1005
rm -r tika-parsers/src/main/java/org/apache/tika/parser/{chm,code,crypto,dwg,executable,font,hdf,html,image,jpeg,mail,microsoft,mp3,mp4,netcdf,pdf,pkg,prt,txt}
aa1005
%{?scl:EOF}
aa1005
aa1005
aa1005
%build
aa1005
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
aa1005
# skip tests for now because there are test failures:
aa1005
# Tests which use cglib fail because of incompatibility with asm4
aa1005
# Test fails for unavailable build deps: com.googlecode.mp4parser:isoparser
aa1005
%mvn_package :%{pkg_name} %{pkg_name}
aa1005
%mvn_package :%{pkg_name}-core %{pkg_name}
aa1005
%mvn_package :%{pkg_name}-parent %{pkg_name}
aa1005
%mvn_build -f -s -- -Dproject.build.sourceEncoding=UTF-8
aa1005
%{?scl:EOF}
aa1005
aa1005
aa1005
%install
aa1005
%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"}
aa1005
%mvn_install
aa1005
aa1005
%if %{without tika_app}
aa1005
%jpackage_script org.apache.tika.cli.TikaCLI "" "" %{pkg_name}:google-gson:commons-io:commons-logging:log4j12-1.2.17:metadata-extractor2-2:juniversalchardet:apache-commons-codec:boilerpipe:thredds/netcdf:thredds/udunits:bea-stax-api:commons-compress:felix/org.apache.felix.scr.annotations:apache-mime4j/core:apache-mime4j/dom:pdfbox:poi/poi:poi/poi-scratchpad:poi/poi-ooxml:bcmail:bcprov:tagsoup:objectweb-asm4/asm-all:rome:fontbox:vorbis-java:dom4j:xmlbeans:poi/poi-ooxml-schemas:jempbox:xmpcore:slf4j/api:slf4j/log4j12:jdom:jdom2 %{pkg_name}-app true
aa1005
%endif
aa1005
%{?scl:EOF}
aa1005
aa1005
aa1005
%files -f .mfiles-%{pkg_name}
aa1005
%dir %{_javadir}/%{pkg_name}
aa1005
%dir %{_mavenpomdir}/%{pkg_name}
aa1005
%doc CHANGES.txt HEADER.txt KEYS README.txt
aa1005
%doc LICENSE.txt NOTICE.txt
aa1005
aa1005
%if %{without tika_parsers}
aa1005
aa1005
%files parsers -f .mfiles-%{pkg_name}-parsers
aa1005
%doc LICENSE.txt NOTICE.txt
aa1005
aa1005
%files java7 -f .mfiles-%{pkg_name}-java7
aa1005
%doc LICENSE.txt NOTICE.txt
aa1005
aa1005
%if %{without tika_app}
aa1005
aa1005
%files app -f .mfiles-%{pkg_name}-app
aa1005
%doc LICENSE.txt NOTICE.txt
aa1005
%{_bindir}/%{pkg_name}-app
aa1005
%endif
aa1005
%endif
aa1005
aa1005
%files javadoc -f .mfiles-javadoc
aa1005
%doc LICENSE.txt NOTICE.txt
aa1005
aa1005
%changelog
aa1005
* Thu Jul 16 2015 Mat Booth <mat.booth@redhat.com> - 1.5-6.2
aa1005
- Fix unowned directories
aa1005
aa1005
* Tue Jul 07 2015 Mat Booth <mat.booth@redhat.com> - 1.5-6.1
aa1005
- Import latest from Fedora
aa1005
aa1005
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-6
aa1005
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
aa1005
aa1005
* Wed Apr 22 2015 gil cattaneo <puntogil@libero.it> 1.5-5
aa1005
- rebuilt with new metadata-extractor2.8.1
aa1005
aa1005
* Mon Apr 20 2015 gil cattaneo <puntogil@libero.it> 1.5-4
aa1005
- rebuilt with new metadata-extractor2.7.2
aa1005
aa1005
* Fri Mar 06 2015 gil cattaneo <puntogil@libero.it> 1.5-3
aa1005
- rebuilt with new jhighlight
aa1005
aa1005
* Mon Feb 16 2015 gil cattaneo <puntogil@libero.it> 1.5-2
aa1005
- introduce license macro
aa1005
aa1005
* Tue Jul 01 2014 gil cattaneo <puntogil@libero.it> 1.5-1
aa1005
- update to 1.5
aa1005
aa1005
* Wed Jun 11 2014 Fabrice Bellet <fabrice@bellet.info> 1.4-7
aa1005
- enable app module, RHBZ#1109072
aa1005
aa1005
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-6
aa1005
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
aa1005
aa1005
* Fri Mar 07 2014 Michal Srb <msrb@redhat.com> - 1.4-5
aa1005
- Port to bouncycastle 1.50
aa1005
aa1005
* Tue Nov 19 2013 gil cattaneo <puntogil@libero.it> 1.4-4
aa1005
- enable vorbis-java-tika support
aa1005
aa1005
* Wed Oct 23 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4-3
aa1005
- Rebuild to regenerate broken POMs
aa1005
- Related: rhbz#1021484
aa1005
aa1005
* Mon Oct 21 2013 gil cattaneo <puntogil@libero.it> 1.4-2
aa1005
- enable parsers and xpm modules
aa1005
aa1005
* Thu Aug 29 2013 gil cattaneo <puntogil@libero.it> 1.4-1
aa1005
- update to 1.4
aa1005
aa1005
* Tue Oct 23 2012 gil cattaneo <puntogil@libero.it> 1.2-1
aa1005
- initial rpm