Blame SPECS/lucene5.spec

6d6f47
%global pkg_name lucene5
6d6f47
%{?scl:%scl_package %{pkg_name}}
6d6f47
%{?java_common_find_provides_and_requires}
6d6f47
6d6f47
# Copyright (c) 2000-2005, JPackage Project
6d6f47
# All rights reserved.
6d6f47
#
6d6f47
# Redistribution and use in source and binary forms, with or without
6d6f47
# modification, are permitted provided that the following conditions
6d6f47
# are met:
6d6f47
#
6d6f47
# 1. Redistributions of source code must retain the above copyright
6d6f47
#    notice, this list of conditions and the following disclaimer.
6d6f47
# 2. Redistributions in binary form must reproduce the above copyright
6d6f47
#    notice, this list of conditions and the following disclaimer in the
6d6f47
#    documentation and/or other materials provided with the
6d6f47
#    distribution.
6d6f47
# 3. Neither the name of the JPackage Project nor the names of its
6d6f47
#    contributors may be used to endorse or promote products derived
6d6f47
#    from this software without specific prior written permission.
6d6f47
#
6d6f47
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6d6f47
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6d6f47
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6d6f47
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
6d6f47
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6d6f47
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6d6f47
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
6d6f47
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
6d6f47
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6d6f47
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
6d6f47
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6d6f47
#
6d6f47
6d6f47
Summary:        High-performance, full-featured text search engine
6d6f47
Name:           %{?scl_prefix}%{pkg_name}
6d6f47
Version:        5.4.1
07e434
Release:        2.3%{?dist}
6d6f47
Epoch:          0
6d6f47
License:        ASL 2.0
6d6f47
URL:            http://lucene.apache.org/
6d6f47
Source0:        http://www.apache.org/dist/lucene/java/%{version}/lucene-%{version}-src.tgz
6d6f47
#svn export http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_5_4_1/dev-tools/
6d6f47
#tar caf dev-tools-5.4.1.tar.xz dev-tools/
6d6f47
Source1:        dev-tools-%{version}.tar.xz
6d6f47
Source2:        ivy-conf.xml
6d6f47
6d6f47
Patch0:         0001-disable-ivy-settings.patch
6d6f47
Patch1:         0001-dependency-generation.patch
6d6f47
Patch2:         ivy-local-fix.patch
6d6f47
6d6f47
BuildRequires:  %{?scl_prefix}ant
6d6f47
BuildRequires:  %{?scl_prefix}ivy-local
6d6f47
BuildRequires:  %{?scl_prefix}httpcomponents-client
6d6f47
BuildRequires:  %{?scl_prefix}jetty-continuation
6d6f47
BuildRequires:  %{?scl_prefix}jetty-http
6d6f47
BuildRequires:  %{?scl_prefix}jetty-io
6d6f47
BuildRequires:  %{?scl_prefix}jetty-server
6d6f47
BuildRequires:  %{?scl_prefix}jetty-servlet
6d6f47
BuildRequires:  %{?scl_prefix}jetty-util
6d6f47
BuildRequires:  %{?scl_prefix}nekohtml
6d6f47
BuildRequires:  %{?scl_prefix}xerces-j2
6d6f47
BuildRequires:  %{?scl_prefix}mvn(javax.servlet:servlet-api)
6d6f47
BuildRequires:  %{?scl_prefix}maven-local
6d6f47
BuildRequires:  %{?scl_prefix_maven}apache-parent
6d6f47
6d6f47
# test-framework deps
6d6f47
BuildRequires:  %{?scl_prefix}junit
6d6f47
#BuildRequires:  randomizedtesting-junit4-ant
6d6f47
#BuildRequires:  randomizedtesting-runner
6d6f47
07e434
# Workaround for bug in javapackages dependency generator (rhbz#1414716)
07e434
BuildRequires:  %{?scl_prefix}lucene-solr-grandparent
07e434
6d6f47
Provides:       %{name}-core = %{epoch}:%{version}-%{release}
6d6f47
6d6f47
BuildArch:      noarch
6d6f47
6d6f47
%description
6d6f47
Apache Lucene is a high-performance, full-featured text search
6d6f47
engine library written entirely in Java. It is a technology suitable
6d6f47
for nearly any application that requires full-text search, especially
6d6f47
cross-platform.
6d6f47
6d6f47
%package parent
6d6f47
Summary:      Parent POM for Lucene
6d6f47
6d6f47
%description parent
6d6f47
Parent POM for Lucene.
6d6f47
6d6f47
%package solr-grandparent
6d6f47
Summary:      Lucene Solr grandparent POM
6d6f47
6d6f47
%description solr-grandparent
6d6f47
Lucene Solr grandparent POM.
6d6f47
6d6f47
%package backward-codecs
6d6f47
Summary:      Lucene Backward Codecs Module
6d6f47
6d6f47
%description backward-codecs
6d6f47
Codecs for older versions of Lucene.
6d6f47
6d6f47
%package replicator
6d6f47
Summary:      Lucene Replicator Module
6d6f47
6d6f47
%description replicator
6d6f47
Lucene Replicator Module.
6d6f47
6d6f47
%package grouping
6d6f47
Summary:      Lucene Grouping Module
6d6f47
6d6f47
%description grouping
6d6f47
Lucene Grouping Module.
6d6f47
6d6f47
%package highlighter
6d6f47
Summary:      Lucene Highlighter Module
6d6f47
6d6f47
%description highlighter
6d6f47
Lucene Highlighter Module.
6d6f47
6d6f47
%package misc
6d6f47
Summary:      Miscellaneous Lucene extensions
6d6f47
6d6f47
%description misc
6d6f47
Miscellaneous Lucene extensions.
6d6f47
6d6f47
%package memory
6d6f47
Summary:      Lucene Memory Module
6d6f47
6d6f47
%description memory
6d6f47
High-performance single-document index to compare against Query.
6d6f47
6d6f47
%package classification
6d6f47
Summary:      Lucene Classification Module
6d6f47
6d6f47
%description classification
6d6f47
Lucene Classification Module.
6d6f47
6d6f47
%package join
6d6f47
Summary:      Lucene Join Module
6d6f47
6d6f47
%description join
6d6f47
Lucene Join Module.
6d6f47
6d6f47
%package suggest
6d6f47
Summary:      Lucene Suggest Module
6d6f47
6d6f47
%description suggest
6d6f47
Lucene Suggest Module.
6d6f47
6d6f47
%package facet
6d6f47
Summary:      Lucene Facets Module
6d6f47
6d6f47
%description facet
6d6f47
Package for Faceted Indexing and Search.
6d6f47
6d6f47
%package analysis
6d6f47
Summary:      Lucene Common Analyzers
6d6f47
6d6f47
%description analysis
6d6f47
Lucene Common Analyzers.
6d6f47
6d6f47
%package sandbox
6d6f47
Summary:      Lucene Sandbox Module
6d6f47
6d6f47
%description sandbox
6d6f47
Lucene Sandbox Module.
6d6f47
6d6f47
%package queries
6d6f47
Summary:      Lucene Queries Module
6d6f47
6d6f47
%description queries
6d6f47
Lucene Queries Module.
6d6f47
6d6f47
%package codecs
6d6f47
Summary:      Codecs and postings formats for Apache Lucene
6d6f47
6d6f47
%description codecs
6d6f47
Codecs and postings formats for Apache Lucene.
6d6f47
6d6f47
%package queryparser
6d6f47
Summary:      Lucene QueryParsers Module
6d6f47
6d6f47
%description queryparser
6d6f47
Lucene QueryParsers Module.
6d6f47
6d6f47
%package analyzers-smartcn
6d6f47
Summary:      Smart Chinese Analyzer
6d6f47
6d6f47
%description analyzers-smartcn
6d6f47
Lucene Smart Chinese Analyzer.
6d6f47
6d6f47
%package javadoc
6d6f47
Summary:        Javadoc for Lucene
6d6f47
6d6f47
%description javadoc
6d6f47
%{summary}.
6d6f47
6d6f47
%prep
6d6f47
%setup -q -n lucene-%{version}
6d6f47
%{?scl:scl enable %{scl_maven} %{scl} - <<"EOF"}
6d6f47
set -e -x
6d6f47
%patch0 -p1
6d6f47
%patch1 -p1
6d6f47
%patch2 -p1
6d6f47
# dependency generator expects that the directory name is just lucene
6d6f47
mkdir lucene
6d6f47
find -maxdepth 1 ! -name CHANGES.txt ! -name LICENSE.txt ! -name README.txt \
6d6f47
    ! -name NOTICE.txt ! -name MIGRATE.txt  ! -name ivy-settings.xml \
6d6f47
    ! -path lucene -exec mv \{} lucene/ \;
6d6f47
6d6f47
tar xf %{SOURCE1}
6d6f47
pushd dev-tools/maven
6d6f47
sed -i -e "s|/Export-Package>|/Export-Package><_nouses>true</_nouses>|g" pom.xml.template
6d6f47
popd
6d6f47
6d6f47
# remove all binary libs
6d6f47
find . -name "*.jar" -exec rm -f {} \;
6d6f47
6d6f47
%mvn_package ":lucene-analysis-modules-aggregator" lucene-analysis
6d6f47
%mvn_package ":lucene-analyzers-common" lucene-analysis
6d6f47
%mvn_package ":{*}-aggregator" @1
6d6f47
6d6f47
%mvn_compat_version : 5 5.4.1
6d6f47
6d6f47
# we don't need following modules
6d6f47
rm -Rf lucene/analysis/{icu,kuromoji,morfologik,phonetic,stempel,uima}
6d6f47
%{?scl:EOF}
6d6f47
6d6f47
%build
6d6f47
%{?scl:scl enable %{scl_maven} %{scl} - <<"EOF"}
6d6f47
set -e -x
6d6f47
pushd lucene
6d6f47
# generate dependencies
6d6f47
ant filter-pom-templates -Divy.settings.file=%{SOURCE2} -Dbuild.sysclasspath=first -Divy.mode=local -Dversion=%{version}
6d6f47
6d6f47
mkdir -p analysis/{icu,kuromoji,morfologik,phonetic,stempel,uima}
6d6f47
6d6f47
# fix source dir + move to expected place
6d6f47
for pom in `find build/poms/lucene -name pom.xml`; do
6d6f47
    sed 's/\${module-path}/${basedir}/g' "$pom" > "${pom##build/poms/lucene/}"
6d6f47
done
6d6f47
%pom_remove_plugin :forbiddenapis
6d6f47
for module in test-framework; do
6d6f47
    %pom_remove_plugin :forbiddenapis ${module}
6d6f47
done
6d6f47
6d6f47
%pom_disable_module src/test core
6d6f47
%pom_disable_module src/test codecs
6d6f47
6d6f47
# we don't need these
6d6f47
%pom_disable_module test-framework
6d6f47
%pom_disable_module spatial
6d6f47
%pom_disable_module spatial3d
6d6f47
%pom_disable_module demo
6d6f47
%pom_disable_module benchmark
6d6f47
%pom_disable_module expressions
6d6f47
%pom_disable_module icu analysis
6d6f47
%pom_disable_module kuromoji analysis
6d6f47
%pom_disable_module morfologik analysis
6d6f47
%pom_disable_module phonetic analysis
6d6f47
%pom_disable_module stempel analysis
6d6f47
%pom_disable_module uima analysis
6d6f47
6d6f47
popd
6d6f47
6d6f47
mv lucene/build/poms/pom.xml .
6d6f47
6d6f47
%pom_disable_module solr
6d6f47
%pom_remove_plugin :gmaven-plugin
6d6f47
%pom_remove_plugin :forbiddenapis
6d6f47
%pom_remove_plugin :maven-enforcer-plugin
6d6f47
6d6f47
# For some reason TestHtmlParser.testTurkish fails when building inside SCLs
6d6f47
%mvn_build -s -f
6d6f47
%{?scl:EOF}
6d6f47
6d6f47
%install
6d6f47
%{?scl:scl enable %{scl_maven} %{scl} - <<"EOF"}
6d6f47
set -e -x
6d6f47
# suggest provides spellchecker
6d6f47
%mvn_alias :lucene-suggest :lucene-spellchecker
6d6f47
6d6f47
# compatibility with existing packages
6d6f47
%mvn_alias :lucene-analyzers-common :lucene-analyzers
6d6f47
6d6f47
%mvn_install
6d6f47
6d6f47
# Use the same directory of the main package for subpackage licence and docs
6d6f47
%global _docdir_fmt %{pkg_name}
6d6f47
%{?scl:EOF}
6d6f47
6d6f47
%files -f .mfiles-lucene-core
6d6f47
%{!?_licensedir:%global license %%doc}
6d6f47
%dir %{_javadir}/%{pkg_name}
6d6f47
%dir %{_jnidir}/%{pkg_name}
6d6f47
%dir %{_mavenpomdir}/%{pkg_name}
6d6f47
%doc LICENSE.txt NOTICE.txt CHANGES.txt README.txt MIGRATE.txt
6d6f47
6d6f47
%files parent -f .mfiles-lucene-parent
6d6f47
%dir %{_mavenpomdir}/%{pkg_name}
6d6f47
%doc LICENSE.txt NOTICE.txt
6d6f47
%files solr-grandparent -f .mfiles-lucene-solr-grandparent
6d6f47
%dir %{_mavenpomdir}/%{pkg_name}
6d6f47
%doc LICENSE.txt NOTICE.txt
6d6f47
%files backward-codecs -f .mfiles-lucene-backward-codecs
6d6f47
%files replicator -f .mfiles-lucene-replicator
6d6f47
%files grouping -f .mfiles-lucene-grouping
6d6f47
%files highlighter -f .mfiles-lucene-highlighter
6d6f47
%files misc -f .mfiles-lucene-misc
6d6f47
%dir %{_jnidir}/%{pkg_name}
6d6f47
%files memory -f .mfiles-lucene-memory
6d6f47
%files classification -f .mfiles-lucene-classification
6d6f47
%files join -f .mfiles-lucene-join
6d6f47
%files suggest -f .mfiles-lucene-suggest
6d6f47
%files facet -f .mfiles-lucene-facet
6d6f47
%files analysis -f .mfiles-lucene-analysis
6d6f47
%files sandbox -f .mfiles-lucene-sandbox
6d6f47
%files queries -f .mfiles-lucene-queries
6d6f47
%files codecs -f .mfiles-lucene-codecs
6d6f47
%files queryparser -f .mfiles-lucene-queryparser
6d6f47
%files analyzers-smartcn -f .mfiles-lucene-analyzers-smartcn
6d6f47
%files javadoc -f .mfiles-javadoc
6d6f47
%doc LICENSE.txt NOTICE.txt
6d6f47
6d6f47
%changelog
07e434
* Thu Jan 19 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:5.4.1-2.3
07e434
- Add workaround for bug in javapackages dependency generator
07e434
- Resolves: rhbz#1414716
07e434
6d6f47
* Thu Mar 31 2016 Michal Srb <msrb@redhat.com> - 0:5.4.1-2.2
6d6f47
- Fix directory ownership (Resolves: rhbz#1319277)
6d6f47
6d6f47
* Tue Jan 26 2016 Michal Srb <msrb@redhat.com> - 0:5.4.1-2.1
6d6f47
- Prepare for SCL build
6d6f47
6d6f47
* Mon Jan 25 2016 Alexander Kurtakov <akurtako@redhat.com> 0:5.4.1-2
6d6f47
- Organize Sources numbering.
6d6f47
- Drop old jpackage header - package has nothing in common anymore.
6d6f47
- Drop 3+ years old provides/obsoletes.
6d6f47
- Move old changelog to separate file to ease working with the spec file.
6d6f47
6d6f47
* Mon Jan 25 2016 Alexander Kurtakov <akurtako@redhat.com> 0:5.4.1-1
6d6f47
- Update to upstream 5.4.1 release.
6d6f47
6d6f47
* Thu Jan 21 2016 Alexander Kurtakov <akurtako@redhat.com> 0:5.4.0-1
6d6f47
- Update to upstream 5.4.0 release.
6d6f47
6d6f47
* Tue Oct 6 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.3.1-1
6d6f47
- Update to upstream 5.3.1 release.
6d6f47
6d6f47
* Thu Aug 27 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.3.0-1
6d6f47
- Update to upstream 5.3.0 release.
6d6f47
6d6f47
* Wed Aug 26 2015 Mat Booth <mat.booth@redhat.com> - 0:5.2.1-4
6d6f47
- Remove forbidden SCL macros
6d6f47
6d6f47
* Wed Jun 24 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.2.1-3
6d6f47
- Disable generation of uses clauses in OSGi manifests.
6d6f47
6d6f47
* Wed Jun 24 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.2.1-2
6d6f47
- Drop old workarounds.
6d6f47
6d6f47
* Tue Jun 23 2015 Alexander Kurtakov <akurtako@redhat.com> 0:5.2.1-1
6d6f47
- Update to upstream 5.2.1.