-
Notifications
You must be signed in to change notification settings - Fork 0
/
php74-pecl-sphinx.spec
258 lines (189 loc) · 8.2 KB
/
php74-pecl-sphinx.spec
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
# IUS spec file for php74-pecl-sphinx, forked from:
#
# we don't want -z defs linker flag
%undefine _strict_symbol_defs_build
# https://github.com/ClassifiedAds/pecl-search_engine-sphinx
%global gh_project pecl-search_engine-sphinx
%global pecl_name sphinx
%global ini_name 40-%{pecl_name}.ini
%global php php74
%bcond_with zts
Name: %{php}-pecl-%{pecl_name}
Version: 3.1.1
Release: 2%{?dist}
Summary: PECL extension for Sphinx SQL full-text search engine
Group: Development/Languages
License: PHP
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://github.com/ClassifiedAds/%{gh_project}/releases/download/%{pecl_name}-%{version}/%{pecl_name}-%{version}.tgz
BuildRequires: libsphinxclient-devel
BuildRequires: %{php}-devel
BuildRequires: pear1
Requires: php(api) = %{php_core_api}
Requires: php(zend-abi) = %{php_zend_api}
Provides: php-%{pecl_name} = %{version}
Provides: php-%{pecl_name}%{?_isa} = %{version}
Provides: php-pecl(%{pecl_name}) = %{version}
Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
Provides: php-pecl-sphinx = %{version}-%{release}
Provides: php-pecl-sphinx%{?_isa} = %{version}-%{release}
Conflicts: php-pecl-sphinx% < %{version}-%{release}
%description
This extension provides PHP bindings for libsphinxclient,
client library for Sphinx the SQL full-text search engine.
%prep
%setup -q -c
mv %{pecl_name}-%{version} NTS
sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
# Upstream often forget this
extver=$(sed -n '/#define PHP_SPHINX_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_sphinx.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream version is ${extver}, expecting %{version}.
exit 1
fi
cat > %{ini_name} << 'EOF'
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
EOF
%if %{with zts}
# duplicate for ZTS build
cp -pr NTS ZTS
%endif
%build
pushd NTS
%{_bindir}/phpize
%configure --with-php-config=%{_bindir}/php-config
%make_build
popd
%if %{with zts}
pushd ZTS
%{_bindir}/zts-phpize
%configure --with-php-config=%{_bindir}/zts-php-config
%make_build
popd
%endif
%check
: simple module load test for the NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
%if %{with zts}
: simple module load test for the ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
%endif
%install
make -C NTS install INSTALL_ROOT=%{buildroot}
# Install XML package description
install -D -p -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{pecl_name}.xml
# install config file
install -D -p -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with zts}
# Install the ZTS stuff
make -C ZTS install INSTALL_ROOT=%{buildroot}
install -D -p -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -D -p -m 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%triggerin -- pear1
if [ -x %{__pecl} ]; then
%{pecl_install} %{pecl_xmldir}/%{pecl_name}.xml >/dev/null || :
fi
%posttrans
if [ -x %{__pecl} ]; then
%{pecl_install} %{pecl_xmldir}/%{pecl_name}.xml >/dev/null || :
fi
%postun
if [ $1 -eq 0 -a -x %{__pecl} ]; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%files
%license NTS/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{pecl_name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
%if %{with zts}
%config(noreplace) %{php_ztsinidir}/%{ini_name}
%{php_ztsextdir}/%{pecl_name}.so
%endif
%changelog
* Thu Dec 12 2019 Matt Linscott <[email protected]> - 3.1.1-2
- Rebuild for PHP 7.4
* Tue May 21 2019 Matt Linscott <[email protected]> - 3.1.1-1
- Rebuild repackaged upstream
- Remove patch
* Fri May 10 2019 Matt Linscott <[email protected]> - 1.4.0-0.8.20170203gitd958afb
- Patch sphinx.c to remove methods remove from libsphinxclient
* Thu May 09 2019 Matt Linscott <[email protected]> - 1.4.0-0.8.20170203gitd958afb
- Port from Fedora to IUS
- Install package.xml as %%{pecl_name}.xml, not %%{name}.xml
- Add pear1 and scriptlets
* Thu Oct 11 2018 Remi Collet <[email protected]> - 1.4.0-0.8.20170203git201eb00
- Rebuild for https://fedoraproject.org/wiki/Changes/php73
* Fri Jul 13 2018 Fedora Release Engineering <[email protected]> - 1.4.0-0.7.20170203git201eb00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <[email protected]> - 1.4.0-0.6.20170203git201eb00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jan 25 2018 Remi Collet <[email protected]> - 1.4.0-0.5.20170203git201eb00
- undefine _strict_symbol_defs_build
* Tue Oct 03 2017 Remi Collet <[email protected]> - 1.4.0-0.4.20170203git201eb00
- rebuild for https://fedoraproject.org/wiki/Changes/php72
* Thu Aug 03 2017 Fedora Release Engineering <[email protected]> - 1.4.0-0.3.20170203git201eb00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <[email protected]> - 1.4.0-0.2.20170203git201eb00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Remi Collet <[email protected]> - 1.4.0-0.1.20170203git201eb00
- update to 1.4.0-dev (git snapshot) for PHP 7
- fix license installation
* Sat Feb 13 2016 Remi Collet <[email protected]> - 1.3.2-6
- F24: drop scriptlets (replaced by file triggers in php-pear)
* Thu Feb 04 2016 Fedora Release Engineering <[email protected]> - 1.3.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Jun 18 2015 Fedora Release Engineering <[email protected]> - 1.3.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Wed Nov 12 2014 Dan Horák <dan[at]danny.cz> - 1.3.2-3
- drop ExclusiveArch, sphinx has been fixed
* Wed Oct 29 2014 Remi Collet <[email protected]> - 1.3.2-2
- set ExclusiveArch, as sphinx (detected by Koschei)
* Fri Aug 29 2014 Remi Collet <[email protected]> - 1.3.2-1
- update to 1.3.2
- install doc in pecl_docdir
- add LICENSE provided by upstream
- enable ZTS build
- provides php-sphinx
- fix private shared filter
* Sun Aug 17 2014 Fedora Release Engineering <[email protected]> - 1.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Thu Jun 19 2014 Remi Collet <[email protected]> - 1.2.0-4
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
- add numerical prefix to extension configuration file
* Sat Jun 07 2014 Fedora Release Engineering <[email protected]> - 1.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <[email protected]> - 1.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri Mar 22 2013 Remi Collet <[email protected]> - 1.1.0-6
- update to 1.2.0
- rebuild for http://fedoraproject.org/wiki/Features/Php55
* Thu Feb 14 2013 Fedora Release Engineering <[email protected]> - 1.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <[email protected]> - 1.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Thu Jan 19 2012 Remi Collet <[email protected]> - 1.1.0-3
- build against php 5.4, with patch
- add filter to fix private-shared-object-provides
* Sat Jan 14 2012 Fedora Release Engineering <[email protected]> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Fri Jul 15 2011 Andrew Colin Kissa <[email protected]> - 1.1.0-1
- Update to latest upstream
- Fix bugzilla #715830
* Wed Feb 09 2011 Fedora Release Engineering <[email protected]> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Sep 06 2009 Andrew Colin Kissa <[email protected]> - 1.0.0-2
- Add checks
- Add php-devel version requirement
* Wed Aug 05 2009 Andrew Colin Kissa <[email protected]> - 1.0.0-1
- Initial package