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 Search Engine 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 # https://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: https
://oligarchy.co.uk
/xapian
/%{version}/%{name}-%{version}.tar.xz
66 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
69 Xapian is a highly adaptable toolkit which allows developers to easily
70 add advanced indexing and search facilities to their own applications.
71 It has built
-in support
for several families of weighting models and
72 also supports a rich
set of boolean query operators.
74 This package provides the files needed
for scripts which use Xapian.
76 %if 0%{?!_without_ruby:1}
78 Group: Development
/Libraries
79 Summary: Files needed
for Ruby scripts which use Xapian.
80 Requires: %{name} = %{version}, ruby >= %{ruby_ver}
83 Xapian is a highly adaptable toolkit which allows developers to easily
84 add advanced indexing and search facilities to their own applications.
85 It has built
-in support
for several families of weighting models and
86 also supports a rich
set of boolean query operators.
88 This package provides the files needed
for developing and running
89 Ruby scripts which use Xapian.
92 %if 0%{?!_without_python:1}
94 Group: Development
/Libraries
95 Summary: Files needed
for Python scripts which use Xapian.
96 Requires: %{name} = %{version}, python >= %{python_ver}
99 Xapian is a highly adaptable toolkit which allows developers to easily
100 add advanced indexing and search facilities to their own applications.
101 It has built
-in support
for several families of weighting models and
102 also supports a rich
set of boolean query operators.
104 This package provides the files needed
for developing and running
105 Python scripts which use Xapian.
108 %if 0%{?!_without_php:1}
110 Group: Development
/Libraries
111 Summary: Files needed
for PHP scripts which use Xapian.
112 Requires: %{name} = %{version}, php
115 Xapian is a highly adaptable toolkit which allows developers to easily
116 add advanced indexing and search facilities to their own applications.
117 It has built
-in support
for several families of weighting models and
118 also supports a rich
set of boolean query operators.
120 This package provides the files needed
for developing and running
121 PHP scripts which use Xapian.
124 %if 0%{?!_without_tcl8:1}
126 Group: Development
/Libraries
127 Summary: Files needed
for Tcl scripts which use Xapian.
128 Requires: %{name} = %{version}, tcl
131 Xapian is a highly adaptable toolkit which allows developers to easily
132 add advanced indexing and search facilities to their own applications.
133 It has built
-in support
for several families of weighting models and
134 also supports a rich
set of boolean query operators.
136 This package provides the files needed
for developing and running
137 Tcl scripts which use Xapian.
140 %if 0%{?!_without_csharp:1}
142 Group: Development
/Libraries
143 Summary: Files needed
for C
# applications which use Xapian.
144 Requires: %{name} = %{version}, mono
-core
147 Xapian is a highly adaptable toolkit which allows developers to easily
148 add advanced indexing and search facilities to their own applications.
149 It has built
-in support
for several families of weighting models and
150 also supports a rich
set of boolean query operators.
152 This package provides the files needed
for developing and running
153 C
# applications which use Xapian.
156 %if 0%{?!_without_perl:1}
158 Group: Development
/Libraries
159 Summary: Files needed
for Perl applications which use Xapian.
160 Requires: %{name} = %{version}
161 Requires: perl
(:MODULE_COMPAT_%
(eval "`
%{__perl} -V
:version`"
; echo $version
))
162 Requires: perl
(Exporter
) perl
(DynaLoader
)
165 Xapian is a highly adaptable toolkit which allows developers to easily
166 add advanced indexing and search facilities to their own applications.
167 It has built
-in support
for several families of weighting models and
168 also supports a rich
set of boolean query operators.
170 This package provides the files needed
for developing and running
171 Perl applications which use Xapian.
175 %setup -q
-n
%{name}-%{version}
178 # As of 1.1.0, Xapian uses libtool 2.2.x which allows us to override libtool's
179 # sometimes conservative take on which directories are in the default dynamic
180 # linker search path, so we no longer incorrectly try to set rpath for
181 # /usr/lib64. Hence there's no longer a need to run "autoreconf --force" here
182 # and it's better not to as it avoids having to cope with incompatibilities
183 # with older versions of the autotools which older distros have.
185 # Only build the bindings we want.
186 %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}
190 [ "
%{buildroot}" != "/" ] && rm -rf %{buildroot}
191 mkdir -p
%{buildroot}
192 # Installation of some files does not obey prefix, so use make install with
193 # DESTDIR instead of makeinstall.
194 make install DESTDIR
=%{buildroot}
195 # Move the docs to the right places.
196 %{?!_without_python: mv %{buildroot}%{_datadir}/doc/%{name}/python %{buildroot}%{_datadir}/doc/%{name}-python-%{version}}
197 %{?!_without_php: mv %{buildroot}%{_datadir}/doc/%{name}/php %{buildroot}%{_datadir}/doc/%{name}-php-%{version}}
198 %{?!_without_php: [ -d "%{buildroot}%{_datadir}/php5" ] && mv %{buildroot}%{_datadir}/php5 %{buildroot}%{_datadir}/php}
199 %{?!_without_tcl8: mv %{buildroot}%{_datadir}/doc/%{name}/tcl8 %{buildroot}%{_datadir}/doc/%{name}-tcl8-%{version}}
200 %{?!_without_csharp: mv %{buildroot}%{_datadir}/doc/%{name}/csharp %{buildroot}%{_datadir}/doc/%{name}-csharp-%{version}}
203 [ "
%{buildroot}" != "/" ] && rm -rf %{buildroot}
206 %defattr(-, root
, root
)
207 # There are no common files at the moment
208 %doc AUTHORS ChangeLog COPYING NEWS README
210 %if 0%{?!_without_python:1}
212 %defattr(-, root
, root
)
213 %{_libdir}/python%{python_ver}/site
-packages
/xapian
/_xapian.so
214 %{_libdir}/python%{python_ver}/site
-packages
/xapian
/__init__.py
215 %{_libdir}/python%{python_ver}/site
-packages
/xapian
/__init__.pyc
216 %ghost %{_libdir}/python%{python_ver}/site
-packages
/xapian
/__init__.pyo
217 %doc %{_datadir}/doc/%{name}-python-%{version}
220 %if 0%{?!_without_php:1}
222 %defattr(-, root
, root
)
223 %{php_extension_dir}/xapian.so
224 %{_datadir}/php
/xapian.php
225 %doc %{_datadir}/doc/%{name}-php-%{version}
228 %if 0%{?!_without_ruby:1}
230 %defattr(-, root
, root
)
233 %defattr(0644, root
, root
)
234 %{_docdir}/xapian
-bindings
/ruby
/
237 %if 0%{?!_without_tcl8:1}
239 %defattr(-, root
, root
)
240 %{tcl_lib}/xapian%{version}
241 %doc %{_datadir}/doc/%{name}-tcl8-%{version}
244 %if 0%{?!_without_csharp:1}
246 %defattr(-, root
, root
)
247 %{_libdir}/_XapianSharp.so
248 %{_libdir}/mono
/XapianSharp
249 %{_libdir}/mono
/gac
/XapianSharp
250 %doc %{_datadir}/doc/%{name}-csharp-%{version}
253 %if 0%{?!_without_perl:1}
255 %defattr(-, root
, root
)
256 %{perl_arch}/auto
/Xapian
/Xapian.so
257 %{perl_lib}/Xapian.pm
259 %doc %{_datadir}/doc/%{name}/perl