1 # RedHat-style .spec file for Xapian
4 # If you don't want to try building packages for all the supported bindings,
5 # you can disable particular bindings by passing these options to rpmbuild:
7 # --without csharp Disable C# bindings
8 # --without perl Disable Perl bindings
9 # --without php Disable PHP bindings
10 # --without python Disable Python bindings
11 # --without ruby Disable Ruby bindings
12 # --without tcl8 Disable Tcl8 bindings
14 %if 0%{?!_without_python:1}
15 %define python_ver %
(%{__python} -c "import sys
; print sys.version
[:3]"
)
18 %if 0%{?!_without_php:1}
19 %define php_extension_dir %
(php
-config
--extension
-dir
)
22 %if 0%{?!_without_ruby:1}
23 %define ruby_ver %
(ruby
-e "print RUBY_VERSION"
)
26 %if 0%{?!_without_tcl8:1}
27 %define tcl_lib %
(echo 'foreach d $tcl_pkgPath
{if {![regexp
{/share
(/|$
)} $d
]} {break}};puts $d'|tclsh
)
30 %if 0%{?!_without_perl:1}
31 %define perl_lib %
(%{__perl} -MConfig -e 'print $Config{installsitelib}'
)
32 %define perl_arch %
(%{__perl} -MConfig -e 'print $Config{installsitearch}'
)
35 Summary: Bindings
for the Xapian Probabilistic Information Retrieval Library
41 Group: Development
/Libraries
42 URL: https
://xapian.org
/
43 Requires: xapian
-core
-libs
= %{version}
44 %if 0%{?!_without_python:1}
45 BuildRequires
: python
-devel
>= 2.3
47 %if 0%{?!_without_php:1}
48 BuildRequires
: php
-devel
>= 5.0
50 %if 0%{?!_without_ruby:1}
51 BuildRequires
: ruby
-devel
>= 1.8
53 %if 0%{?!_without_tcl8:1}
54 BuildRequires
: tcl
-devel
>= 8.1
56 %if 0%{?!_without_csharp:1}
57 BuildRequires
: mono
-devel
>= 1.1
59 %if 0%{?!_without_perl:1}
60 # http://fedoraproject.org/wiki/Packaging/Perl
61 # perl-devel doesn't exist on RHEL 5 so use ExtUtils::MakeMaker for perl.h
62 BuildRequires
: perl
(ExtUtils
::MakeMaker
)
64 BuildRequires
: autoconf automake libtool
65 Source0: http
://oligarchy.co.uk
/xapian
/%{version}/%{name}-%{version}.tar.xz
66 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
69 Xapian is an Open
Source Probabilistic Information Retrieval Library. It
70 offers a highly adaptable toolkit that allows developers to easily add advanced
71 indexing and search facilities to applications. This package provides the
72 files needed
for scripts which use Xapian.
74 %if 0%{?!_without_ruby:1}
76 Group: Development
/Libraries
77 Summary: Files needed
for Ruby scripts which use Xapian.
78 Requires: %{name} = %{version}, ruby >= %{ruby_ver}
81 Xapian is an Open
Source Probabilistic Information Retrieval framework. It
82 offers a highly adaptable toolkit that allows developers to easily add advanced
83 indexing and search facilities to applications. This package provides the
84 files needed
for developing and running Ruby scripts which use Xapian.
87 %if 0%{?!_without_python:1}
89 Group: Development
/Libraries
90 Summary: Files needed
for Python scripts which use Xapian.
91 Requires: %{name} = %{version}, python >= %{python_ver}
94 Xapian is an Open
Source Probabilistic Information Retrieval framework. It
95 offers a highly adaptable toolkit that allows developers to easily add advanced
96 indexing and search facilities to applications. This package provides the
97 files needed
for developing and running Python scripts which use Xapian.
100 %if 0%{?!_without_php:1}
102 Group: Development
/Libraries
103 Summary: Files needed
for PHP scripts which use Xapian.
104 Requires: %{name} = %{version}, php
107 Xapian is an Open
Source Probabilistic Information Retrieval framework. It
108 offers a highly adaptable toolkit that allows developers to easily add advanced
109 indexing and search facilities to applications. This package provides the
110 files needed
for developing and running PHP scripts which use Xapian.
113 %if 0%{?!_without_tcl8:1}
115 Group: Development
/Libraries
116 Summary: Files needed
for Tcl scripts which use Xapian.
117 Requires: %{name} = %{version}, tcl
120 Xapian is an Open
Source Probabilistic Information Retrieval framework. It
121 offers a highly adaptable toolkit that allows developers to easily add advanced
122 indexing and search facilities to applications. This package provides the
123 files needed
for developing and running Tcl scripts which use Xapian.
126 %if 0%{?!_without_csharp:1}
128 Group: Development
/Libraries
129 Summary: Files needed
for C
# applications which use Xapian.
130 Requires: %{name} = %{version}, mono
-core
133 Xapian is an Open
Source Probabilistic Information Retrieval framework. It
134 offers a highly adaptable toolkit that allows developers to easily add advanced
135 indexing and search facilities to applications. This package provides the
136 files needed
for developing and running C
# applications which use Xapian.
139 %if 0%{?!_without_perl:1}
141 Group: Development
/Libraries
142 Summary: Files needed
for Perl applications which use Xapian.
143 Requires: %{name} = %{version}
144 Requires: perl
(:MODULE_COMPAT_%
(eval "`
%{__perl} -V
:version`"
; echo $version
))
145 Requires: perl
(Exporter
) perl
(DynaLoader
)
148 Xapian is an Open
Source Probabilistic Information Retrieval framework. It
149 offers a highly adaptable toolkit that allows developers to easily add advanced
150 indexing and search facilities to applications. This package provides the
151 files needed
for developing and running Perl applications which use Xapian.
155 %setup -q
-n
%{name}-%{version}
158 # As of 1.1.0, Xapian uses libtool 2.2.x which allows us to override libtool's
159 # sometimes conservative take on which directories are in the default dynamic
160 # linker search path, so we no longer incorrectly try to set rpath for
161 # /usr/lib64. Hence there's no longer a need to run "autoreconf --force" here
162 # and it's better not to as it avoids having to cope with incompatibilities
163 # with older versions of the autotools which older distros have.
165 # Only build the bindings we want.
166 %configure %{?!_without_python:--with-python} %{?!_without_php:--with-php} %{?!_without_tcl8:--with-tcl} %{?!_without_csharp:--with-csharp} %{?!_without_ruby:--with-ruby} %{?!_without_perl:--with-perl}
170 [ "
%{buildroot}" != "/" ] && rm -rf %{buildroot}
171 mkdir -p
%{buildroot}
172 # Installation of some files does not obey prefix, so use make install with
173 # DESTDIR instead of makeinstall.
174 make install DESTDIR
=%{buildroot}
175 # Move the docs to the right places.
176 %{?!_without_python: mv %{buildroot}%{_datadir}/doc/%{name}/python %{buildroot}%{_datadir}/doc/%{name}-python-%{version}}
177 %{?!_without_php: mv %{buildroot}%{_datadir}/doc/%{name}/php %{buildroot}%{_datadir}/doc/%{name}-php-%{version}}
178 %{?!_without_php: [ -d "%{buildroot}%{_datadir}/php5" ] && mv %{buildroot}%{_datadir}/php5 %{buildroot}%{_datadir}/php}
179 %{?!_without_tcl8: mv %{buildroot}%{_datadir}/doc/%{name}/tcl8 %{buildroot}%{_datadir}/doc/%{name}-tcl8-%{version}}
180 %{?!_without_csharp: mv %{buildroot}%{_datadir}/doc/%{name}/csharp %{buildroot}%{_datadir}/doc/%{name}-csharp-%{version}}
183 [ "
%{buildroot}" != "/" ] && rm -rf %{buildroot}
186 %defattr(-, root
, root
)
187 # There are no common files at the moment
188 %doc AUTHORS ChangeLog COPYING NEWS README
190 %if 0%{?!_without_python:1}
192 %defattr(-, root
, root
)
193 %{_libdir}/python%{python_ver}/site
-packages
/xapian
/_xapian.so
194 %{_libdir}/python%{python_ver}/site
-packages
/xapian
/__init__.py
195 %{_libdir}/python%{python_ver}/site
-packages
/xapian
/__init__.pyc
196 %ghost %{_libdir}/python%{python_ver}/site
-packages
/xapian
/__init__.pyo
197 %doc %{_datadir}/doc/%{name}-python-%{version}
200 %if 0%{?!_without_php:1}
202 %defattr(-, root
, root
)
203 %{php_extension_dir}/xapian.so
204 %{_datadir}/php
/xapian.php
205 %doc %{_datadir}/doc/%{name}-php-%{version}
208 %if 0%{?!_without_ruby:1}
210 %defattr(-, root
, root
)
213 %defattr(0644, root
, root
)
214 %{_docdir}/xapian
-bindings
/ruby
/
217 %if 0%{?!_without_tcl8:1}
219 %defattr(-, root
, root
)
220 %{tcl_lib}/xapian%{version}
221 %doc %{_datadir}/doc/%{name}-tcl8-%{version}
224 %if 0%{?!_without_csharp:1}
226 %defattr(-, root
, root
)
227 %{_libdir}/_XapianSharp.so
228 %{_libdir}/mono
/XapianSharp
229 %{_libdir}/mono
/gac
/XapianSharp
230 %doc %{_datadir}/doc/%{name}-csharp-%{version}
233 %if 0%{?!_without_perl:1}
235 %defattr(-, root
, root
)
236 %{perl_arch}/auto
/Xapian
/Xapian.so
237 %{perl_lib}/Xapian.pm
239 %doc %{_datadir}/doc/%{name}/perl