37650b
%bcond_with     jp_minimal
37650b
37650b
Summary:        High-performance, full-featured text search engine
37650b
Name:           lucene
37650b
Version:        8.4.1
37650b
Release:        5%{?dist}
37650b
Epoch:          0
37650b
License:        ASL 2.0
37650b
URL:            http://lucene.apache.org/
37650b
# solr source contains both lucene and dev-tools
37650b
Source0:        https://archive.apache.org/dist/lucene/solr/%{version}/solr-%{version}-src.tgz
37650b
37650b
Patch0:         0001-Disable-ivy-settings.patch
37650b
Patch1:         0002-Dependency-generation.patch
37650b
37650b
BuildRequires:  ant
37650b
BuildRequires:  ivy-local
37650b
BuildRequires:  maven-local
37650b
BuildRequires:  mvn(com.ibm.icu:icu4j)
37650b
BuildRequires:  mvn(org.apache:apache:pom:)
37650b
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
37650b
%if %{without jp_minimal}
37650b
BuildRequires:  mvn(commons-codec:commons-codec)
37650b
BuildRequires:  mvn(javax.servlet:javax.servlet-api)
37650b
BuildRequires:  mvn(javax.servlet:servlet-api)
37650b
BuildRequires:  mvn(junit:junit)
37650b
BuildRequires:  mvn(org.antlr:antlr4-runtime)
37650b
BuildRequires:  mvn(org.apache.commons:commons-compress)
37650b
BuildRequires:  mvn(org.eclipse.jetty:jetty-continuation)
37650b
BuildRequires:  mvn(org.eclipse.jetty:jetty-http)
37650b
BuildRequires:  mvn(org.eclipse.jetty:jetty-io)
37650b
BuildRequires:  mvn(org.eclipse.jetty:jetty-server)
37650b
BuildRequires:  mvn(org.eclipse.jetty:jetty-servlet)
37650b
BuildRequires:  mvn(org.eclipse.jetty:jetty-util)
37650b
BuildRequires:  mvn(org.ow2.asm:asm)
37650b
BuildRequires:  mvn(org.ow2.asm:asm-commons)
37650b
BuildRequires:  mvn(xerces:xercesImpl)
37650b
%endif
37650b
37650b
Provides:       %{name}-core = %{epoch}:%{version}-%{release}
37650b
37650b
# Obsolete since F32
37650b
# Required deps were removed from fedora
37650b
Obsoletes: %{name}-benchmark < 8.1.1-3
37650b
Obsoletes: %{name}-demo < 8.1.1-3
37650b
Obsoletes: %{name}-facet < 8.1.1-3
37650b
Obsoletes: %{name}-replicator < 8.1.1-3
37650b
Obsoletes: %{name}-spatial < 8.1.1-3
37650b
Obsoletes: %{name}-spatial-extras < 8.1.1-3
37650b
Obsoletes: %{name}-spatial3d < 8.1.1-3
37650b
Obsoletes: %{name}-test-framework < 8.4.1-4
37650b
37650b
%if %{with jp_minimal}
37650b
# Remove left-over packages that would have broken deps when built in minimal mode
37650b
Obsoletes: %{name}-parent < %{version}-%{release}
37650b
Obsoletes: %{name}-solr-grandparent < %{version}-%{release}
37650b
Obsoletes: %{name}-expressions < %{version}-%{release}
37650b
Obsoletes: %{name}-analyzers-phonetic < %{version}-%{release}
37650b
Obsoletes: %{name}-analyzers-icu < %{version}-%{release}
37650b
Obsoletes: %{name}-analyzers-nori < %{version}-%{release}
37650b
Obsoletes: %{name}-analyzers-kuromoji < %{version}-%{release}
37650b
Obsoletes: %{name}-analyzers-stempel < %{version}-%{release}
37650b
%endif
37650b
37650b
BuildArch:      noarch
37650b
37650b
%description
37650b
Apache Lucene is a high-performance, full-featured text search
37650b
engine library written entirely in Java. It is a technology suitable
37650b
for nearly any application that requires full-text search, especially
37650b
cross-platform.
37650b
37650b
%package analysis
37650b
Summary:      Lucene Common Analyzers
37650b
# Obsoletes since F30
37650b
# This module was removed upstream and no replacement exists
37650b
Obsoletes: %{name}-analyzers-uima < 8.1.1-3
37650b
# Obsolete since F32
37650b
# Required deps were removed from fedora
37650b
Obsoletes: %{name}-analyzers-morfologik < 8.1.1-3
37650b
37650b
%description analysis
37650b
Lucene Common Analyzers.
37650b
37650b
%package analyzers-smartcn
37650b
Summary:      Smart Chinese Analyzer
37650b
37650b
%description analyzers-smartcn
37650b
Lucene Smart Chinese Analyzer.
37650b
37650b
%package grouping
37650b
Summary:      Lucene Grouping Module
37650b
37650b
%description grouping
37650b
Lucene Grouping Module.
37650b
37650b
%package highlighter
37650b
Summary:      Lucene Highlighter Module
37650b
37650b
%description highlighter
37650b
Lucene Highlighter Module.
37650b
37650b
%package join
37650b
Summary:      Lucene Join Module
37650b
37650b
%description join
37650b
Lucene Join Module.
37650b
37650b
%package memory
37650b
Summary:      Lucene Memory Module
37650b
37650b
%description memory
37650b
High-performance single-document index to compare against Query.
37650b
37650b
%package misc
37650b
Summary:      Miscellaneous Lucene extensions
37650b
37650b
%description misc
37650b
Miscellaneous Lucene extensions.
37650b
37650b
%package queries
37650b
Summary:      Lucene Queries Module
37650b
37650b
%description queries
37650b
Lucene Queries Module.
37650b
37650b
%package queryparser
37650b
Summary:      Lucene QueryParsers Module
37650b
37650b
%description queryparser
37650b
Lucene QueryParsers Module.
37650b
37650b
%package sandbox
37650b
Summary:      Lucene Sandbox Module
37650b
37650b
%description sandbox
37650b
Lucene Sandbox Module.
37650b
37650b
%package backward-codecs
37650b
Summary:      Lucene Backward Codecs Module
37650b
37650b
%description backward-codecs
37650b
Codecs for older versions of Lucene.
37650b
37650b
%package codecs
37650b
Summary:      Codecs and postings formats for Apache Lucene
37650b
37650b
%description codecs
37650b
Codecs and postings formats for Apache Lucene.
37650b
37650b
%package classification
37650b
Summary:      Lucene Classification Module
37650b
37650b
%description classification
37650b
Lucene Classification Module.
37650b
37650b
%package suggest
37650b
Summary:      Lucene Suggest Module
37650b
37650b
%description suggest
37650b
Lucene Suggest Module.
37650b
37650b
%package monitor
37650b
Summary:      Lucene Monitor Module
37650b
37650b
%description monitor
37650b
Lucene Monitor Module.
37650b
37650b
%if %{without jp_minimal}
37650b
37650b
%package parent
37650b
Summary:      Parent POM for Lucene
37650b
37650b
%description parent
37650b
Parent POM for Lucene.
37650b
37650b
%package solr-grandparent
37650b
Summary:      Lucene Solr grandparent POM
37650b
37650b
%description solr-grandparent
37650b
Lucene Solr grandparent POM.
37650b
37650b
%package expressions
37650b
Summary:      Lucene Expressions Module
37650b
37650b
%description expressions
37650b
Dynamically computed values to sort/facet/search on based on a pluggable
37650b
grammar.
37650b
37650b
%package analyzers-phonetic
37650b
Summary:      Lucene Phonetic Filters
37650b
37650b
%description analyzers-phonetic
37650b
Provides phonetic encoding via Commons Codec.
37650b
37650b
%package analyzers-icu
37650b
Summary:      Lucene ICU Analysis Components
37650b
37650b
%description analyzers-icu
37650b
Provides integration with ICU (International Components for Unicode) for
37650b
stronger Unicode and internationalization support.
37650b
37650b
%package analyzers-nori
37650b
Summary:      An analyzer with morphological analysis for Korean
37650b
37650b
%description analyzers-nori
37650b
An analyzer with morphological analysis for Korean.
37650b
37650b
%package analyzers-kuromoji
37650b
Summary:      Lucene Kuromoji Japanese Morphological Analyzer
37650b
37650b
%description analyzers-kuromoji
37650b
Lucene Kuromoji Japanese Morphological Analyzer.
37650b
37650b
%package analyzers-stempel
37650b
Summary:      Lucene Stempel Analyzer
37650b
37650b
%description analyzers-stempel
37650b
Lucene Stempel Analyzer.
37650b
37650b
%endif
37650b
37650b
%package javadoc
37650b
Summary:        Javadoc for Lucene
37650b
37650b
%description javadoc
37650b
%{summary}.
37650b
37650b
%prep
37650b
%setup -q -n solr-%{version}
37650b
37650b
%patch0 -p1
37650b
%patch1 -p1
37650b
37650b
rm -rf solr
37650b
37650b
find -name "*.jar" -delete
37650b
37650b
mkdir -p lucene/build/analysis/{kuromoji,nori}
37650b
37650b
# don't generate uses clauses in osgi metadata
37650b
sed -i -e "/<Export-Package>/a<_nouses>true</_nouses>" dev-tools/maven/pom.xml.template
37650b
37650b
# compatibility with existing packages
37650b
%mvn_alias :%{name}-analyzers-common :%{name}-analyzers
37650b
37650b
%mvn_package ":%{name}-analysis-modules-aggregator" %{name}-analysis
37650b
%mvn_package ":%{name}-analyzers-common" %{name}-analysis
37650b
%mvn_package ":{*}-aggregator" @1
37650b
37650b
%build
37650b
pushd %{name}
37650b
find -maxdepth 2 -type d -exec mkdir -p '{}/lib' \;
37650b
37650b
# generate maven dependencies
37650b
ant -f build.xml generate-maven-artifacts -Divy.mode=local -Dversion=%{version} -Divy.available=true
37650b
37650b
# fix source dir + move to expected place
37650b
for pom in `find build/poms/%{name} -name pom.xml`; do
37650b
    sed 's/\${module-path}/${basedir}/g' "$pom" > "${pom##build/poms/%{name}/}"
37650b
done
37650b
%pom_disable_module src/test core
37650b
%pom_disable_module src/test codecs
37650b
37650b
popd
37650b
37650b
mv lucene/build/poms/pom.xml .
37650b
37650b
# deal with split packages in core/misc/analysis modules by adding additional metadata and
37650b
# require-bundling the core bundle from misc
37650b
%pom_xpath_set "pom:Export-Package" "*;version=\"%{version}\""
37650b
%pom_add_plugin org.apache.felix:maven-bundle-plugin lucene/misc \
37650b
"<configuration><instructions>
37650b
<Require-Bundle>org.apache.lucene.core;bundle-version=\"%{version}\"</Require-Bundle>
37650b
<Export-Package>
37650b
 org.apache.lucene.document;version=\"%{version}\";misc=split;mandatory:=misc,
37650b
 org.apache.lucene.index;version=\"%{version}\";misc=split;mandatory:=misc,
37650b
 org.apache.lucene.search;version=\"%{version}\";misc=split;mandatory:=misc,
37650b
 org.apache.lucene.store;version=\"%{version}\";misc=split;mandatory:=misc,
37650b
 org.apache.lucene.util.fst;version=\"%{version}\";misc=split;mandatory:=misc,
37650b
 *;version=\"%{version}\"</Export-Package>
37650b
</instructions></configuration>"
37650b
%pom_add_plugin org.apache.felix:maven-bundle-plugin lucene/analysis/common \
37650b
"<configuration><instructions>
37650b
<Require-Bundle>org.apache.lucene.core;bundle-version=\"%{version}\"</Require-Bundle>
37650b
<Export-Package>
37650b
 org.apache.lucene.analysis.standard;version=\"%{version}\";analysis=split;mandatory:=analysis,
37650b
 *;version=\"%{version}\"</Export-Package>
37650b
</instructions></configuration>"
37650b
37650b
%pom_disable_module solr
37650b
%pom_remove_plugin -r :gmaven-plugin
37650b
%pom_remove_plugin -r :maven-enforcer-plugin
37650b
%pom_remove_plugin -r :forbiddenapis
37650b
%pom_remove_plugin -r :buildnumber-maven-plugin
37650b
37650b
# don't build modules for which deps are not in fedora or not new enough in fedora
37650b
pushd lucene
37650b
%pom_disable_module benchmark
37650b
%pom_disable_module demo
37650b
%pom_disable_module test-framework
37650b
%pom_disable_module facet
37650b
%pom_disable_module replicator
37650b
%pom_disable_module spatial
37650b
%pom_disable_module spatial-extras
37650b
%pom_disable_module spatial3d
37650b
37650b
%pom_disable_module opennlp analysis
37650b
%pom_disable_module morfologik analysis
37650b
popd
37650b
37650b
%if %{with jp_minimal}
37650b
pushd lucene
37650b
%pom_disable_module expressions
37650b
%pom_disable_module icu analysis
37650b
%pom_disable_module kuromoji analysis
37650b
%pom_disable_module phonetic analysis
37650b
%pom_disable_module stempel analysis
37650b
%pom_disable_module nori analysis
37650b
popd
37650b
37650b
%mvn_package :lucene-parent __noinstall
37650b
%mvn_package :lucene-solr-grandparent __noinstall
37650b
%endif
37650b
37650b
# For some reason TestHtmlParser.testTurkish fails when building inside SCLs
37650b
%mvn_build -s -f
37650b
37650b
%install
37650b
%mvn_install
37650b
37650b
# Use the same directory of the main package for subpackage licence and docs
37650b
%global _docdir_fmt %{name}
37650b
37650b
%files -f .mfiles-%{name}-core
37650b
%doc lucene/CHANGES.txt lucene/README.txt
37650b
%doc lucene/MIGRATE.txt lucene/JRE_VERSION_MIGRATION.txt
37650b
%license lucene/LICENSE.txt lucene/NOTICE.txt
37650b
37650b
%files analysis -f .mfiles-%{name}-analysis
37650b
37650b
%files analyzers-smartcn -f .mfiles-%{name}-analyzers-smartcn
37650b
37650b
%files grouping -f .mfiles-%{name}-grouping
37650b
37650b
%files highlighter -f .mfiles-%{name}-highlighter
37650b
37650b
%files join -f .mfiles-%{name}-join
37650b
37650b
%files memory -f .mfiles-%{name}-memory
37650b
37650b
%files misc -f .mfiles-%{name}-misc
37650b
37650b
%files queries -f .mfiles-%{name}-queries
37650b
37650b
%files queryparser -f .mfiles-%{name}-queryparser
37650b
37650b
%files sandbox -f .mfiles-%{name}-sandbox
37650b
37650b
%files backward-codecs -f .mfiles-%{name}-backward-codecs
37650b
37650b
%files codecs -f .mfiles-%{name}-codecs
37650b
37650b
%files classification -f .mfiles-%{name}-classification
37650b
37650b
%files suggest -f .mfiles-%{name}-suggest
37650b
37650b
%files monitor -f .mfiles-%{name}-monitor
37650b
%if %{without jp_minimal}
37650b
37650b
%files parent -f .mfiles-%{name}-parent
37650b
37650b
%files solr-grandparent -f .mfiles-%{name}-solr-grandparent
37650b
37650b
%files expressions -f .mfiles-%{name}-expressions
37650b
37650b
%files analyzers-phonetic -f .mfiles-%{name}-analyzers-phonetic
37650b
37650b
%files analyzers-icu -f .mfiles-%{name}-analyzers-icu
37650b
37650b
%files analyzers-nori -f .mfiles-%{name}-analyzers-nori
37650b
37650b
%files analyzers-kuromoji -f .mfiles-%{name}-analyzers-kuromoji
37650b
37650b
%files analyzers-stempel -f .mfiles-%{name}-analyzers-stempel
37650b
%endif
37650b
37650b
%files javadoc -f .mfiles-javadoc
37650b
%license lucene/LICENSE.txt lucene/NOTICE.txt
37650b
37650b
%changelog
37650b
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 0:8.4.1-5
37650b
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
37650b
37650b
* Wed May 06 2020 Mat Booth <mat.booth@redhat.com> - 0:8.4.1-4
37650b
- Fix jp_minimal mode
37650b
37650b
* Tue May 5 2020 Alexander Kurtakov <akurtako@redhat.com> - 0:8.4.1-3
37650b
- Disable test-framework as its dependency (randomizedtesting) is removed.
37650b
37650b
* Sat Mar 21 2020 Mat Booth <mat.booth@redhat.com> - 0:8.4.1-2
37650b
- Fix deps for minimal mode
37650b
37650b
* Sat Mar 21 2020 Mat Booth <mat.booth@redhat.com> - 0:8.4.1-1
37650b
- Update to latest upstream release
37650b
37650b
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0:8.1.1-4
37650b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
37650b
37650b
* Thu Nov 28 2019 Mat Booth <mat.booth@redhat.com> - 0:8.1.1-3
37650b
- Drop spatial, morfologik, replicator, demo and benchmark modules due to missing deps
37650b
- Fix obsoletes when built in minimal mode
37650b
37650b
* Thu Jun 13 2019 Mat Booth <mat.booth@redhat.com> - 0:8.1.1-2
37650b
- Enable additional module in jp_minimal mode
37650b
37650b
* Wed Jun 12 2019 Mat Booth <mat.booth@redhat.com> - 0:8.1.1-1
37650b
- Update to latest upstream release
37650b
37650b
* Thu Feb 14 2019 Mat Booth <mat.booth@redhat.com> - 0:7.7.0-1
37650b
- Update to latest upstream release
37650b
- Drop deprecated uima analyzers sub-package
37650b
- Added nori Korean analyzers sub-package
37650b
37650b
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0:7.1.0-4
37650b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
37650b
37650b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:7.1.0-3
37650b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
37650b
37650b
* Thu Apr 26 2018 Mat Booth <mat.booth@redhat.com> - 0:7.1.0-2
37650b
- Fix split package information in OSGi metadata
37650b
37650b
* Thu Apr 12 2018 Mat Booth <mat.booth@redhat.com> - 0:7.1.0-1
37650b
- Update to a newer upstream release
37650b
37650b
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:6.1.0-8
37650b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
37650b
37650b
* Thu Dec 07 2017 Mat Booth <mat.booth@redhat.com> - 0:6.1.0-7
37650b
- Enable more modules in jp_minimal profile, rhbz#1455267
37650b
37650b
* Mon Oct 16 2017 Michael Simacek <msimacek@redhat.com> - 0:6.1.0-6
37650b
- Backport fix for CVE-2017-12629
37650b
37650b
* Thu Sep 21 2017 Mat Booth <mat.booth@redhat.com> - 0:6.1.0-5
37650b
- Rebuild to regenerate OSGi metadata due to objectweb-asm update
37650b
37650b
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0:6.1.0-4
37650b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
37650b
37650b
* Tue Apr 04 2017 Mat Booth <mat.booth@redhat.com> - 0:6.1.0-3
37650b
- Add better OSGi metadata for dealing with core/misc split packages
37650b
- Drop F24-specific hack
37650b
37650b
* Tue Mar 21 2017 Michael Simacek <msimacek@redhat.com> - 0:6.1.0-2
37650b
- Update jp_minimal conditional
37650b
37650b
* Mon Mar 20 2017 Mat Booth <mat.booth@redhat.com> - 0:6.1.0-1
37650b
- Update to lucene 6
37650b
- Add "spatial-extras" subpackage, this decouples dependencies on spatial4j.
37650b
37650b
* Thu Mar 16 2017 Michael Simacek <msimacek@redhat.com> - 0:5.5.0-7
37650b
- Add jp_minimal conditional
37650b
37650b
* Mon Feb 06 2017 Michael Simacek <msimacek@redhat.com> - 0:5.5.0-6
37650b
- Remove buildnumber-plugin
37650b
37650b
* Mon Aug 22 2016 Roman Vais <rvais@redhat.com> - 0:5.5.0-5
37650b
- Removed test dependency macros for lucene demo that caused conflict (duplicity)
37650b
37650b
* Wed Jul 13 2016 Roland Grunberg <rgrunber@redhat.com> - 0:5.5.0-4
37650b
- analyzers-common should have versioned requires on package from core.
37650b
37650b
* Fri Jul 08 2016 Mat Booth <mat.booth@redhat.com> - 0:5.5.0-3
37650b
- Misc module should require core module, the split package
37650b
  causes problems for OSGi consumers
37650b
37650b
* Mon Apr 18 2016 Mat Booth <mat.booth@redhat.com> - 0:5.5.0-2
37650b
- Add missing BR on ant, fixes FTBFS
37650b
37650b
* Wed Feb 24 2016 Michael Simacek <msimacek@redhat.com> - 0:5.5.0-1
37650b
- Update to upstream version 5.5.0
37650b
37650b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0:5.4.1-3
37650b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
37650b
37650b
* Mon Jan 25 2016 Alexander Kurtakov <akurtako@redhat.com> 0:5.4.1-2
37650b
- Organize Sources numbering.
37650b
- Drop old jpackage header - package has nothing in common anymore.
37650b
- Drop 3+ years old provides/obsoletes.
37650b
- Move old changelog to separate file to ease working with the spec file.
37650b
37650b
* Mon Jan 25 2016 Alexander Kurtakov <akurtako@redhat.com> 0:5.4.1-1
37650b
- Update to upstream 5.4.1 release.
37650b
37650b
* Thu Jan 21 2016 Alexander Kurtakov <akurtako@redhat.com> 0:5.4.0-1
37650b
- Update to upstream 5.4.0 release.
37650b
37650b
* Tue Oct 6 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.3.1-1
37650b
- Update to upstream 5.3.1 release.
37650b
37650b
* Thu Aug 27 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.3.0-1
37650b
- Update to upstream 5.3.0 release.
37650b
37650b
* Wed Aug 26 2015 Mat Booth <mat.booth@redhat.com> - 0:5.2.1-4
37650b
- Remove forbidden SCL macros
37650b
37650b
* Wed Jun 24 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.2.1-3
37650b
- Disable generation of uses clauses in OSGi manifests.
37650b
37650b
* Wed Jun 24 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.2.1-2
37650b
- Drop old workarounds.
37650b
37650b
* Tue Jun 23 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.2.1-1
37650b
- Update to upstream 5.2.1.