-# NOTE: for perl binding, see perl-Search-Xapian.spec
#
# Conditional build:
%bcond_without dotnet # C# bindings
%bcond_without java # Java bindings
%bcond_without lua # Lua bindings
-%bcond_without php # PHP bindings
-%bcond_without python # Python bindings
+%bcond_without perl # Perl bindings
+%bcond_with php # PHP bindings
+%bcond_without python2 # Python 2 bindings
+%bcond_without python3 # Python 3 bindings
%bcond_without ruby # Ruby bindings
%bcond_without tcl # Tcl bindings
+%ifarch x32
+%undefine with_dotnet
+%endif
+
+%{?with_dotnet:%include /usr/lib/rpm/macros.mono}
+%{?with_perl:%include /usr/lib/rpm/macros.perl}
Summary: Bindings for Xapian
Summary(pl.UTF-8): Wiązania do Xapiana
Name: xapian-bindings
-Version: 1.2.18
-Release: 2
+Version: 1.4.4
+Release: 10
License: GPL v2+
Group: Development/Languages
-Source0: http://oligarchy.co.uk/xapian/%{version}/%{name}-%{version}.tar.xz
-# Source0-md5: c9969a7e15fbb581a3126e7babdc2f58
-URL: http://www.xapian.org/
+Source0: https://oligarchy.co.uk/xapian/%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 55f2678a029baa4f897f583e86e33ed8
+Patch0: python-install.patch
+URL: https://xapian.org/
+BuildRequires: autoconf >= 2.63
+BuildRequires: automake >= 1:1.11.2
%{?with_java:BuildRequires: jdk >= 1.2}
%{?with_java:BuildRequires: jpackage-utils}
-%{?with_lua:BuildRequires: lua51-devel >= 5.1}
+BuildRequires: libtool >= 2:2.2.6
+%{?with_lua:BuildRequires: lua51-devel >= 5.1.5-2}
# 2.6.x should be sufficient, but 2.11.1 complaints about write permissions to /usr/share/.mono/keypairs
%{?with_dotnet:BuildRequires: mono-devel >= 2.11.4}
+%{?with_perl:BuildRequires: perl-devel >= 1:5.8.0}
%{?with_php:BuildRequires: %{php_name}-devel >= 4:5.0.4}
BuildRequires: pkgconfig
-%{?with_python:BuildRequires: python-devel >= 1:2.3}
+%{?with_python2:BuildRequires: python-devel >= 1:2.6}
+%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
BuildRequires: python-modules >= 1:2.3
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.665
BuildRequires: xapian-core-devel >= %{version}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%if %{with php}
+%if "%{php_major_version}" >= "7"
+%define phpbindname php7
+%else
+%define phpbindname php
+%endif
+%endif
+
%description
Xapian is an Open Source Probabilistic Information Retrieval Library.
It offers a highly adaptable toolkit that allows developers to easily
Summary(pl.UTF-8): Pliki do tworzenia aplikacji C# wykorzystujących Xapiana
Group: Development/Languages
Requires: mono >= 2.6.7
+Requires: xapian-core-libs >= %{version}
Obsoletes: csharp-xapian
%description -n dotnet-xapian
Group: Libraries/Java
Requires: jpackage-utils
Requires: jre
+Requires: xapian-core-libs >= %{version}
%description -n java-xapian
Xapian is an Open Source Probabilistic Information Retrieval
Summary(pl.UTF-8): Pliki do tworzenia skryptów w języku Lua wykorzystujących Xapiana
Group: Development/Languages
Requires: lua51-libs
+Requires: xapian-core-libs >= %{version}
%description -n lua-xapian
Xapian is an Open Source Probabilistic Information Retrieval
indeksowania i wyszukiwania. Ten pakiet zawiera pliki potrzebne przy
tworzeniu skryptów w języku Lua wykorzystujących Xapiana.
+%package -n perl-Xapian
+Summary: Xapian - Perl XS frontend to the Xapian C++ search library
+Summary(pl.UTF-8): Xapian - interfejs Perlowy XS do biblioteki wyszukiwania Xapian
+Group: Development/Languages/Perl
+Requires: xapian-core-libs >= %{version}
+
+%description -n perl-Xapian
+This module wraps most methods of most Xapian classes. The missing
+classes and methods should be added in the future. It also provides a
+simplified, more 'perlish' interface to some common operations.
+
+%description -n perl-Xapian -l pl.UTF-8
+Ten moduł obudowuje większość metod z większości klas Xapiana.
+Brakujące klasy i metody powinny być dodane w przyszłości. Moduł
+udostępnia także uproszczony, bardziej perlowy interfejs do niektórych
+popularnych operacji.
+
%package -n %{php_name}-xapian
Summary: Files needed for developing PHP scripts which use Xapian
Summary(pl.UTF-8): Pliki do tworzenia skryptów w PHP wykorzystujących Xapiana
Group: Development/Languages/PHP
+Requires: xapian-core-libs >= %{version}
%{?requires_php_extension}
%description -n %{php_name}-xapian
tworzeniu skryptów w PHP wykorzystujących Xapiana.
%package -n python-xapian
-Summary: Files needed for developing Python scripts which use Xapian
-Summary(pl.UTF-8): Pliki do tworzenia skryptów w Pythonie wykorzystujących Xapiana
+Summary: Files needed for developing Python 2 scripts which use Xapian
+Summary(pl.UTF-8): Pliki do tworzenia skryptów w Pythonie 2 wykorzystujących Xapiana
Group: Development/Languages/Python
-%pyrequires_eq python-modules
+Requires: python-modules >= 1:2.6
+Requires: xapian-core-libs >= %{version}
%description -n python-xapian
Xapian is an Open Source Probabilistic Information Retrieval
indeksowania i wyszukiwania. Ten pakiet zawiera pliki potrzebne przy
tworzeniu skryptów w Pythonie wykorzystujących Xapiana.
+%package -n python3-xapian
+Summary: Files needed for developing Python 3 scripts which use Xapian
+Summary(pl.UTF-8): Pliki do tworzenia skryptów w Pythonie 3 wykorzystujących Xapiana
+Group: Development/Languages/Python
+Requires: python3-modules >= 1:3.2
+Requires: xapian-core-libs >= %{version}
+
+%description -n python3-xapian
+Xapian is an Open Source Probabilistic Information Retrieval
+framework. It offers a highly adaptable toolkit that allows developers
+to easily add advanced indexing and search facilities to applications.
+This package provides the files needed for developing Python scripts
+which use Xapian.
+
+%description -n python3-xapian -l pl.UTF-8
+Xapian to mająca otwarte źródła biblioteka do uzyskiwania informacji
+probabilistycznych. Oferuje wysoce adoptowalne narzędzia pozwalające
+programistom łatwo dodawać do aplikacji zaawansowane możliwości
+indeksowania i wyszukiwania. Ten pakiet zawiera pliki potrzebne przy
+tworzeniu skryptów w Pythonie wykorzystujących Xapiana.
+
%package -n ruby-xapian
Summary: Files needed for developing Ruby scripts which use Xapian
Summary(pl.UTF-8): Pliki do tworzenia skryptów w języku Ruby wykorzystujących Xapiana
Group: Development/Languages
+Requires: xapian-core-libs >= %{version}
%description -n ruby-xapian
Xapian is an Open Source Probabilistic Information Retrieval
Summary(pl.UTF-8): Pliki do tworzenia skryptów w Tcl-u wykorzystujących Xapiana
Group: Development/Languages/Tcl
Requires: tcl >= 8.1
+Requires: xapian-core-libs >= %{version}
%description -n tcl-xapian
Xapian is an Open Source Probabilistic Information Retrieval
%prep
%setup -q
+%patch0 -p1
%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
CLASSPATH="." \
-RUBY_LIB=%{ruby_vendorlibdir} \
-RUBY_LIB_ARCH=%{ruby_vendorarchdir} \
%configure \
- %{?with_lua:LUA=/usr/bin/lua51 LUA_INC=/usr/include/lua51} \
+ PERL_ARCH=%{perl_vendorarch} \
+ PERL_LIB=%{perl_vendorlib} \
+ RUBY_LIB=%{ruby_vendorlibdir} \
+ RUBY_LIB_ARCH=%{ruby_vendorarchdir} \
+ %{?with_lua:LUA=/usr/bin/lua5.1 LUA_INC=/usr/include/lua51} \
%{?with_dotnet:--with-csharp} \
%{?with_java:--with-java} \
%{?with_lua:--with-lua} \
- %{?with_python:--with-python} \
- %{?with_php:--with-php} \
+ %{?with_perl:--with-perl} \
+ %{?with_python2:--with-python} \
+ %{?with_python3:--with-python3} \
+ %{?with_php:--with-%{phpbindname}} \
%{?with_ruby:--with-ruby} \
%{?with_tcl:--with-tcl}
-%{__make}
+%{__make} \
+ JAVA_CPPFLAGS="-I%{_jvmdir}/java/include -I%{_jvmdir}/java/include/linux"
%install
rm -rf $RPM_BUILD_ROOT
%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
%if %{with java}
-install -D java/built/xapian_jni.jar $RPM_BUILD_ROOT%{_javadir}/xapian_jni-%{version}.jar
-ln -sf xapian_jni-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/xapian_jni.jar
+install -D java/built/xapian.jar $RPM_BUILD_ROOT%{_javadir}/xapian-%{version}.jar
+ln -sf xapian-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/xapian.jar
%endif
-for binding in %{?with_dotnet:csharp} %{?with_php:php} %{?with_python:python} %{?with_ruby:ruby} %{?with_tcl:tcl8}; do
+for binding in %{?with_dotnet:csharp} %{?with_perl:perl} %{?with_php:%{phpbindname}} %{?with_python2:python} %{?with_python3:python3} %{?with_ruby:ruby} %{?with_tcl:tcl8}; do
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$binding
- cp -a $binding/docs/{index.html,examples} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$binding
+ [ ! -f $binding/docs/index.html ] || cp -p $binding/docs/index.html $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$binding
+ cp -pr $binding/docs/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/$binding
done
+%if %{with python2}
%py_postclean
+%endif
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{py3_sitedir}/xapian/__pycache__
+%{__mv} $RPM_BUILD_ROOT%{py3_sitedir}/xapian/*.py[co] $RPM_BUILD_ROOT%{py3_sitedir}/xapian/__pycache__
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files -n java-xapian
%defattr(644,root,root,755)
%attr(755,root,root) %{_jnidir}/libxapian_jni.so
-%{_javadir}/xapian_jni-%{version}.jar
-%{_javadir}/xapian_jni.jar
+%{_javadir}/xapian-%{version}.jar
+%{_javadir}/xapian.jar
%endif
%if %{with lua}
%attr(755,root,root) %{_libdir}/lua/5.1/xapian.so
%endif
+%if %{with perl}
+%files -n perl-Xapian
+%defattr(644,root,root,755)
+%{perl_vendorlib}/Xapian.pm
+%dir %{perl_vendorlib}/Xapian
+%{perl_vendorlib}/Xapian/*.pm
+%dir %{perl_vendorarch}/auto/Xapian
+%attr(755,root,root) %{perl_vendorarch}/auto/Xapian/Xapian.so
+%endif
+
%if %{with php}
%files -n %{php_name}-xapian
%defattr(644,root,root,755)
%{php_data_dir}/xapian.php
%endif
-%if %{with python}
+%if %{with python2}
%files -n python-xapian
%defattr(644,root,root,755)
%dir %{py_sitedir}/xapian
%{py_sitedir}/xapian/__init__.py[co]
%endif
+%if %{with python3}
+%files -n python3-xapian
+%defattr(644,root,root,755)
+%dir %{py3_sitedir}/xapian
+%attr(755,root,root) %{py3_sitedir}/xapian/_xapian.cpython-*.so
+%{py3_sitedir}/xapian/__init__.py
+%{py3_sitedir}/xapian/__pycache__
+%endif
+
%if %{with ruby}
%files -n ruby-xapian
%defattr(644,root,root,755)