Fix whitespace irregularities in code
[xapian.git] / xapian-bindings / xapian-bindings.spec.in
blob0707c7f5d288e121d8c62314cd9e7072830c1a8b
1 # RedHat-style .spec file for Xapian
2 # @configure_input@
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]")
16 %endif
18 %if 0%{?!_without_php:1}
19 %define php_extension_dir %(php-config --extension-dir)
20 %endif
22 %if 0%{?!_without_ruby:1}
23 %define ruby_ver %(ruby -e "print RUBY_VERSION")
24 %endif
26 %if 0%{?!_without_tcl8:1}
27 %define tcl_lib %(echo 'foreach d $tcl_pkgPath {if {![regexp {/share(/|$)} $d]} {break}};puts $d'|tclsh)
28 %endif
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}')
33 %endif
35 Summary: Bindings for the Xapian Probabilistic Information Retrieval Library
36 Name: xapian-bindings
37 Version: @VERSION@
38 Release: 1
39 License: GPL
40 Vendor: xapian.org
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
46 %endif
47 %if 0%{?!_without_php:1}
48 BuildRequires: php-devel >= 5.0
49 %endif
50 %if 0%{?!_without_ruby:1}
51 BuildRequires: ruby-devel >= 1.8
52 %endif
53 %if 0%{?!_without_tcl8:1}
54 BuildRequires: tcl-devel >= 8.1
55 %endif
56 %if 0%{?!_without_csharp:1}
57 BuildRequires: mono-devel >= 1.1
58 %endif
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)
63 %endif
64 BuildRequires: autoconf automake libtool
65 Source0: http://oligarchy.co.uk/xapian/%{version}/%{name}-%{version}.tar.xz
66 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
68 %description
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}
75 %package ruby
76 Group: Development/Libraries
77 Summary: Files needed for Ruby scripts which use Xapian.
78 Requires: %{name} = %{version}, ruby >= %{ruby_ver}
80 %description ruby
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.
85 %endif
87 %if 0%{?!_without_python:1}
88 %package python
89 Group: Development/Libraries
90 Summary: Files needed for Python scripts which use Xapian.
91 Requires: %{name} = %{version}, python >= %{python_ver}
93 %description python
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.
98 %endif
100 %if 0%{?!_without_php:1}
101 %package php
102 Group: Development/Libraries
103 Summary: Files needed for PHP scripts which use Xapian.
104 Requires: %{name} = %{version}, php
106 %description 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.
111 %endif
113 %if 0%{?!_without_tcl8:1}
114 %package tcl8
115 Group: Development/Libraries
116 Summary: Files needed for Tcl scripts which use Xapian.
117 Requires: %{name} = %{version}, tcl
119 %description tcl8
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.
124 %endif
126 %if 0%{?!_without_csharp:1}
127 %package csharp
128 Group: Development/Libraries
129 Summary: Files needed for C# applications which use Xapian.
130 Requires: %{name} = %{version}, mono-core
132 %description csharp
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.
137 %endif
139 %if 0%{?!_without_perl:1}
140 %package perl
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)
147 %description perl
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.
152 %endif
154 %prep
155 %setup -q -n %{name}-%{version}
157 %build
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.
164 #autoreconf --force
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}
167 make
169 %install
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}}
182 %clean
183 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
185 %files
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}
191 %files python
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}
198 %endif
200 %if 0%{?!_without_php:1}
201 %files php
202 %defattr(-, root, root)
203 %{php_extension_dir}/xapian.so
204 %{_datadir}/php/xapian.php
205 %doc %{_datadir}/doc/%{name}-php-%{version}
206 %endif
208 %if 0%{?!_without_ruby:1}
209 %files ruby
210 %defattr(-, root, root)
211 %{_libdir}/ruby
212 /usr/lib/ruby
213 %defattr(0644, root, root)
214 %{_docdir}/xapian-bindings/ruby/
215 %endif
217 %if 0%{?!_without_tcl8:1}
218 %files tcl8
219 %defattr(-, root, root)
220 %{tcl_lib}/xapian%{version}
221 %doc %{_datadir}/doc/%{name}-tcl8-%{version}
222 %endif
224 %if 0%{?!_without_csharp:1}
225 %files csharp
226 %defattr(-, root, root)
227 %{_libdir}/_XapianSharp.so
228 %{_libdir}/mono/XapianSharp
229 %{_libdir}/mono/gac/XapianSharp
230 %doc %{_datadir}/doc/%{name}-csharp-%{version}
231 %endif
233 %if 0%{?!_without_perl:1}
234 %files perl
235 %defattr(-, root, root)
236 %{perl_arch}/auto/Xapian/Xapian.so
237 %{perl_lib}/Xapian.pm
238 %{perl_lib}/Xapian
239 %doc %{_datadir}/doc/%{name}/perl
240 %endif