Репозиторий Sisyphus
Последнее обновление: 19 октября 2019 | Пакетов: 17506 | Посещений: 15294051
en ru br
Репозитории ALT
S:7.7.0-alt1_1jpp8
4.0: 2.1.0-alt4jvm4.2
3.0: 1.4.3-alt1
www.altlinux.org/Changes

Группа :: Работа с текстами
Пакет: lucene

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Name: lucene
Version: 2.1.0
Release: alt4jvm4.2

%def_disable check
# previously used by eclipse but no longer needed
%def_disable devel
%def_enable debug
%def_enable demo
%def_enable contrib
# TODO: build with contrib-db
%def_disable contribdb

%define pkgdocdir %_docdir/%name-%version

Summary: High-performance, full-featured text search engine
Group: Text tools
License: Apache Software License
Url: http://lucene.apache.org/
Packager: Eugene Ostapets <eostapets at altlinux.ru>
Epoch:          0

Source0:        http://www.apache.org/dist/lucene/java/%name-%version-src.tar.gz

# WARNING: they report incorrect version; good to cheat eclipse 3.3.0 build.

# FIX LATER.
Source1: lucene-1.9-OSGi-MANIFEST.MF
Source2: lucene-1.9-analysis-OSGi-MANIFEST.MF
Patch11: lucene-2.1.0-alt-remove-contribs.patch

BuildArch: noarch

BuildPreReq: rpm-build-java
BuildRequires: jpackage-utils zip
BuildRequires: /proc
BuildRequires: ant >= 1.5
BuildRequires: javacc
BuildRequires: unzip

%if_enabled contrib
BuildRequires:  java-javadoc
BuildRequires:  jline
BuildRequires:  jtidy
BuildRequires:  regexp
BuildRequires:  jakarta-commons-digester
# hack: replace with java-devel or jpackage-generic-compat when jpackage-utils 1.7.3 alt6 will appear
BuildRequires:  jpackage-1.4-compat
%else
BuildRequires: java-devel
%endif

%description
Jakarta Lucene is a high-performance, full-featured text search engine
written entirely in Java. It is a technology suitable for nearly any
application that requires full-text search, especially cross-platform.

%package manual
Summary: Documentation for Lucene
Group: Development/Java
Requires: %name-javadoc = %version-%release

%description manual
Documentation for Lucene, a text search engine
written in Java.

%package javadoc
Summary: Javadoc for Lucene
Group: Development/Java

%description javadoc
Javadoc-generated HTML documentation for Lucene, a text search engine
written in Java.

%package demo
Summary: Lucene demonstrations and samples
Group: Development/Java
Requires: %name = %version-%release

%description demo
Demonstrations and samples for Lucene, a text search engine
written in Java.

%if_enabled devel
%package devel
Summary:        Lucene source code
Group:          Development/Java
Requires:       %{name} = %{version}-%{release}

%description devel
Source code for use by Java debuggers, such as Eclipse.
%endif

%if_enabled contrib
%package contrib
Summary:        Lucene contributed extensions
Group:          Development/Java
Requires:       %{name} = %{epoch}:%{version}-%{release}

%description contrib
%{summary}.
%endif


%prep
%setup -q -n %name-%version
find . -name '*.jar' -delete
%patch11 -p1

%build
export OPT_JAR_LIST="ant/ant-junit junit"
export CLASSPATH=$(build-classpath jline jtidy regexp commons-digester junit)

%if_enabled contribdb
%else
rm -r contrib/db
%endif
pushd contrib
#keep analyzers (required for eclipse)
#keep ant
# others require lots of deps
rm -r javascript miscellaneous similarity surround \
xml-query-parser gdata-server lucli queries snowball \
swing benchmark highlighter memory regex spellchecker wordnet
popd

ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 \
   -Dversion=%version \
   -Djavacc.zip=%_javadir/javacc.jar \
%if_disabled debug
   -Djavac.debug=off \
%endif
%if_enabled contrib
   package
%else
   jar-core javadocs
%endif
%if_enabled demo
ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 jar-demo
%endif
%if_enabled check
export CLASSPATH=$(build-classpath jline jtidy regexp commons-digester junit)
ant test
%endif


mkdir META-INF
cp %{SOURCE1} META-INF/MANIFEST.MF
zip -u build/lucene-core-%{version}.jar META-INF/MANIFEST.MF
%if_enabled contrib
cp %{SOURCE2} META-INF/MANIFEST.MF
zip -u build/contrib/analyzers/lucene-analyzers-%{version}.jar META-INF/MANIFEST.MF
%endif

%install
# jars
mkdir -p %buildroot%_javadir
install -m644 build/%name-core-%version.jar \
   %buildroot%_javadir/%name-%{version}.jar
%if_enabled demo
# demo
#install -p -m644  build/%name-demos-%version-dev.jar \
install -p -m644  build/%name-demos-2.1.1-dev.jar \
 %buildroot%{_javadir}/%{name}-demos-%{version}.jar
%endif
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

%if_enabled contrib
# contrib jars
install -d -m 0755 $RPM_BUILD_ROOT%{_javadir}/%{name}-contrib
# skipped highlighter lucli memory misc queries similarity snowball spellchecker surround swing wordnet xml-query-parser
for c in analyzers ant ; do
   install -m 0644 build/contrib/$c/%{name}-${c}-%{version}.jar \
$RPM_BUILD_ROOT%{_javadir}/%{name}-contrib
done
(cd $RPM_BUILD_ROOT%{_javadir}/%{name}-contrib && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)

%if_enabled contribdb
# bdb contrib jars
install -d -m 0755 $RPM_BUILD_ROOT%{_javadir}/%{name}-contrib-db
install -m 0644 build/contrib/db/bdb/%{name}-bdb-%{version}.jar \
$RPM_BUILD_ROOT%{_javadir}/%{name}-contrib-db
install -m 0644 build/contrib/db/bdb-je/%{name}-bdb-je-%{version}.jar \
$RPM_BUILD_ROOT%{_javadir}/%{name}-contrib-db
(cd $RPM_BUILD_ROOT%{_javadir}/%{name}-contrib-db && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
%endif
%endif

%if_enabled webapp
# TODO: webapp: luceneweb.war / where do we install 'em?
# webapp
install -d -m755 %buildroot%_datadir/%{name}-%{version}
install -m 0644 build/%{name}web.war \
 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
%endif

# manual

install -d -m755 %buildroot%pkgdocdir
install -p -m644 README.txt LICENSE.txt CHANGES.txt %buildroot%pkgdocdir/
cp -a docs/* %buildroot%pkgdocdir/

# javadoc

%__mkdir_p %buildroot%_javadocdir
%__cp -a build/docs/api/* \
 %buildroot%_javadocdir
%__ln_s $(relative %_javadocdir %pkgdocdir/) %buildroot%pkgdocdir/api

%if_enabled devel
# devel
%define appsourcedir  %{_usrsrc}/%{name}
%define appsourcefile %{name}-%{version}
currdir=${PWD##*/}
pushd ..
 find $currdir -type f -name \*.java -o -name \*.jj | xargs tar uf $currdir/temp-sources.tar
popd
mkdir temp-sources
pushd temp-sources
 tar xf ../temp-sources.tar
 jar cf %{appsourcefile}.jar $currdir
 mkdir -p $RPM_BUILD_ROOT%{appsourcedir}
 mv %{appsourcefile}.jar $RPM_BUILD_ROOT%{appsourcedir}/
popd
rm -r temp-sources temp-sources.tar
%endif

%files
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%if_enabled webapp
%{_datadir}/%{name}-%{version}
%endif
%dir %pkgdocdir
%pkgdocdir/*.txt

%files manual
%pkgdocdir

%files javadoc
%_javadocdir/*

%if_enabled demo
%files demo
%{_javadir}/%{name}-demos-%{version}.jar
%{_javadir}/%{name}-demos.jar
%endif

%if_enabled devel
%files devel
%{appsourcedir}
%endif

%if_enabled contrib
%files contrib
%defattr(0644,root,root,0755)
%{_javadir}/%{name}-contrib
%endif


%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin