-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxapian-bindings.spec.in
260 lines (223 loc) · 8.66 KB
/
xapian-bindings.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# RedHat-style .spec file for Xapian
# @configure_input@
#
# If you don't want to try building packages for all the supported bindings,
# you can disable particular bindings by passing these options to rpmbuild:
#
# --without csharp Disable C# bindings
# --without perl Disable Perl bindings
# --without php Disable PHP bindings
# --without python Disable Python bindings
# --without ruby Disable Ruby bindings
# --without tcl8 Disable Tcl8 bindings
%if 0%{?!_without_python:1}
%define python_ver %(%{__python} -c "import sys; print sys.version[:3]")
%endif
%if 0%{?!_without_php:1}
%define php_extension_dir %(php-config --extension-dir)
%endif
%if 0%{?!_without_ruby:1}
%define ruby_ver %(ruby -e "print RUBY_VERSION")
%endif
%if 0%{?!_without_tcl8:1}
%define tcl_lib %(echo 'foreach d $tcl_pkgPath {if {![regexp {/share(/|$)} $d]} {break}};puts $d'|tclsh)
%endif
%if 0%{?!_without_perl:1}
%define perl_lib %(%{__perl} -MConfig -e 'print $Config{installsitelib}')
%define perl_arch %(%{__perl} -MConfig -e 'print $Config{installsitearch}')
%endif
Summary: Bindings for the Xapian Search Engine Library
Name: xapian-bindings
Version: @VERSION@
Release: 1
License: GPL
Vendor: xapian.org
Group: Development/Libraries
URL: https://xapian.org/
Requires: xapian-core-libs = %{version}
%if 0%{?!_without_python:1}
BuildRequires: python-devel >= 2.3
%endif
%if 0%{?!_without_php:1}
BuildRequires: php-devel >= 5.0
%endif
%if 0%{?!_without_ruby:1}
BuildRequires: ruby-devel >= 1.8
%endif
%if 0%{?!_without_tcl8:1}
BuildRequires: tcl-devel >= 8.1
%endif
%if 0%{?!_without_csharp:1}
BuildRequires: mono-devel >= 1.1
%endif
%if 0%{?!_without_perl:1}
# https://fedoraproject.org/wiki/Packaging:Perl
# perl-devel doesn't exist on RHEL 5 so use ExtUtils::MakeMaker for perl.h
BuildRequires: perl(ExtUtils::MakeMaker)
%endif
BuildRequires: autoconf automake libtool
Source0: https://oligarchy.co.uk/xapian/%{version}/%{name}-%{version}.tar.xz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for scripts which use Xapian.
%if 0%{?!_without_ruby:1}
%package ruby
Group: Development/Libraries
Summary: Files needed for Ruby scripts which use Xapian.
Requires: %{name} = %{version}, ruby >= %{ruby_ver}
%description ruby
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for developing and running
Ruby scripts which use Xapian.
%endif
%if 0%{?!_without_python:1}
%package python
Group: Development/Libraries
Summary: Files needed for Python scripts which use Xapian.
Requires: %{name} = %{version}, python >= %{python_ver}
%description python
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for developing and running
Python scripts which use Xapian.
%endif
%if 0%{?!_without_php:1}
%package php
Group: Development/Libraries
Summary: Files needed for PHP scripts which use Xapian.
Requires: %{name} = %{version}, php
%description php
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for developing and running
PHP scripts which use Xapian.
%endif
%if 0%{?!_without_tcl8:1}
%package tcl8
Group: Development/Libraries
Summary: Files needed for Tcl scripts which use Xapian.
Requires: %{name} = %{version}, tcl
%description tcl8
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for developing and running
Tcl scripts which use Xapian.
%endif
%if 0%{?!_without_csharp:1}
%package csharp
Group: Development/Libraries
Summary: Files needed for C# applications which use Xapian.
Requires: %{name} = %{version}, mono-core
%description csharp
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for developing and running
C# applications which use Xapian.
%endif
%if 0%{?!_without_perl:1}
%package perl
Group: Development/Libraries
Summary: Files needed for Perl applications which use Xapian.
Requires: %{name} = %{version}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(Exporter) perl(DynaLoader)
%description perl
Xapian is a highly adaptable toolkit which allows developers to easily
add advanced indexing and search facilities to their own applications.
It has built-in support for several families of weighting models and
also supports a rich set of boolean query operators.
This package provides the files needed for developing and running
Perl applications which use Xapian.
%endif
%prep
%setup -q -n %{name}-%{version}
%build
# As of 1.1.0, Xapian uses libtool 2.2.x which allows us to override libtool's
# sometimes conservative take on which directories are in the default dynamic
# linker search path, so we no longer incorrectly try to set rpath for
# /usr/lib64. Hence there's no longer a need to run "autoreconf --force" here
# and it's better not to as it avoids having to cope with incompatibilities
# with older versions of the autotools which older distros have.
#autoreconf --force
# Only build the bindings we want.
%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}
make
%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
mkdir -p %{buildroot}
# Installation of some files does not obey prefix, so use make install with
# DESTDIR instead of makeinstall.
make install DESTDIR=%{buildroot}
# Move the docs to the right places.
%{?!_without_python: mv %{buildroot}%{_datadir}/doc/%{name}/python %{buildroot}%{_datadir}/doc/%{name}-python-%{version}}
%{?!_without_php: mv %{buildroot}%{_datadir}/doc/%{name}/php %{buildroot}%{_datadir}/doc/%{name}-php-%{version}}
%{?!_without_php: [ -d "%{buildroot}%{_datadir}/php5" ] && mv %{buildroot}%{_datadir}/php5 %{buildroot}%{_datadir}/php}
%{?!_without_tcl8: mv %{buildroot}%{_datadir}/doc/%{name}/tcl8 %{buildroot}%{_datadir}/doc/%{name}-tcl8-%{version}}
%{?!_without_csharp: mv %{buildroot}%{_datadir}/doc/%{name}/csharp %{buildroot}%{_datadir}/doc/%{name}-csharp-%{version}}
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%files
%defattr(-, root, root)
# There are no common files at the moment
%doc AUTHORS ChangeLog COPYING NEWS README
%if 0%{?!_without_python:1}
%files python
%defattr(-, root, root)
%{_libdir}/python%{python_ver}/site-packages/xapian/_xapian.so
%{_libdir}/python%{python_ver}/site-packages/xapian/__init__.py
%{_libdir}/python%{python_ver}/site-packages/xapian/__init__.pyc
%ghost %{_libdir}/python%{python_ver}/site-packages/xapian/__init__.pyo
%doc %{_datadir}/doc/%{name}-python-%{version}
%endif
%if 0%{?!_without_php:1}
%files php
%defattr(-, root, root)
%{php_extension_dir}/xapian.so
%{_datadir}/php/xapian.php
%doc %{_datadir}/doc/%{name}-php-%{version}
%endif
%if 0%{?!_without_ruby:1}
%files ruby
%defattr(-, root, root)
%{_libdir}/ruby
/usr/lib/ruby
%defattr(0644, root, root)
%{_docdir}/xapian-bindings/ruby/
%endif
%if 0%{?!_without_tcl8:1}
%files tcl8
%defattr(-, root, root)
%{tcl_lib}/xapian%{version}
%doc %{_datadir}/doc/%{name}-tcl8-%{version}
%endif
%if 0%{?!_without_csharp:1}
%files csharp
%defattr(-, root, root)
%{_libdir}/_XapianSharp.so
%{_libdir}/mono/XapianSharp
%{_libdir}/mono/gac/XapianSharp
%doc %{_datadir}/doc/%{name}-csharp-%{version}
%endif
%if 0%{?!_without_perl:1}
%files perl
%defattr(-, root, root)
%{perl_arch}/auto/Xapian/Xapian.so
%{perl_lib}/Xapian.pm
%{perl_lib}/Xapian
%doc %{_datadir}/doc/%{name}/perl
%endif