]>
Commit | Line | Data |
---|---|---|
c6a4b25a AG |
1 | # TODO: |
2 | # - package for ruby API | |
aa4b3fd5 ER |
3 | # - subpackage for driver backend deps if code patched to support it: |
4 | # sphinx-0.9.9-2.i686: required "libodbc.so.1" is provided by following packages: | |
5 | # libmysqlclient.so.16 libmysqlclient.so.16(libmysqlclient_16) libpq.so.5 | |
f1ac865a JB |
6 | # |
7 | # Conditional build: | |
1f2de170 | 8 | %bcond_without java # without Java support |
c6a4b25a | 9 | %bcond_without libstemmer # without libstemmer support |
1f2de170 JB |
10 | %bcond_without mysql # without MySQL support |
11 | %bcond_without pgsql # without PostgreSQL support | |
443cfccc | 12 | |
443cfccc | 13 | %undefine with_java |
443cfccc ER |
14 | |
15 | %{?with_java:%include /usr/lib/rpm/macros.java} | |
1e7134e7 ER |
16 | %include /usr/lib/rpm/macros.php |
17 | %define php_min_version 5.0.4 | |
910da407 | 18 | Summary: Free open-source SQL full-text search engine |
68b62e17 | 19 | Summary(pl.UTF-8): Silnik przeszukiwania pełnotekstowego SQL open-source |
910da407 | 20 | Name: sphinx |
9d9b76b9 | 21 | Version: 0.9.9 |
71cde6ea | 22 | Release: 7 |
910da407 ER |
23 | License: GPL v2 |
24 | Group: Applications/Databases | |
c6a4b25a | 25 | Source0: http://www.sphinxsearch.com/downloads/%{name}-%{version}.tar.gz |
9d9b76b9 | 26 | # Source0-md5: 7b9b618cb9b378f949bb1b91ddcc4f54 |
13c36946 | 27 | Source1: %{name}.init |
db04d92c | 28 | Source2: %{name}.logrotate |
c6a4b25a | 29 | Patch0: %{name}-system-libstemmer.patch |
91a58c85 | 30 | Patch1: bug-468.patch |
16577646 | 31 | Patch2: bug-297.patch |
910da407 ER |
32 | URL: http://www.sphinxsearch.com/ |
33 | BuildRequires: autoconf | |
34 | BuildRequires: automake | |
c6a4b25a | 35 | BuildRequires: expat-devel |
ff8e46de | 36 | %{?with_java:BuildRequires: jdk} |
13c36946 | 37 | BuildRequires: libstdc++-devel |
c6a4b25a | 38 | %{?with_libstemmer:BuildRequires: libstemmer-devel} |
4d294510 | 39 | BuildRequires: libtool |
c6a4b25a | 40 | %{?with_mysql:BuildRequires: mysql-devel} |
3bdbac33 | 41 | %{?with_pgsql:BuildRequires: postgresql-devel} |
4d294510 | 42 | BuildRequires: python |
43 | BuildRequires: python-modules | |
13c36946 | 44 | BuildRequires: rpm-javaprov |
1e7134e7 | 45 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
4d294510 | 46 | BuildRequires: rpm-pythonprov |
b7f79218 | 47 | BuildRequires: rpmbuild(macros) >= 1.461 |
91a58c85 ER |
48 | Requires(postun): /usr/sbin/groupdel |
49 | Requires(postun): /usr/sbin/userdel | |
50 | Requires(pre): /bin/id | |
51 | Requires(pre): /usr/bin/getgid | |
52 | Requires(pre): /usr/sbin/groupadd | |
53 | Requires(pre): /usr/sbin/useradd | |
54 | Provides: group(sphinx) | |
55 | Provides: user(sphinx) | |
910da407 ER |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
57 | ||
6688ccc8 ER |
58 | %define _sysconfdir /etc/%{name} |
59 | ||
910da407 ER |
60 | %description |
61 | Sphinx is a a standalone search engine, meant to provide fast, | |
62 | size-efficient and relevant fulltext search functions to other | |
63 | applications. Sphinx was specially designed to integrate well with SQL | |
64 | databases and scripting languages. Currently built-in data sources | |
65 | support fetching data either via direct connection to MySQL, or from | |
66 | an XML pipe. | |
67 | ||
68b62e17 | 68 | %description -l pl.UTF-8 |
69 | Sphinx jest samodzielnym silnikiem przeszukującym, dostarczającym | |
70 | innym aplikacjom szybkie, zoptymalizowane rozmiarowo funkcje | |
71 | przeszukiwania pełnotekstowego. Sphinx został specjalnie | |
72 | zaprojektowany z myślą o dobrej integracji z bazami danych SQL oraz | |
73 | językami skryptowymi. Obecnie wbudowane źródła danych wspierają | |
3bdbac33 ER |
74 | pobieranie danych poprzez bezpośrednie połączenie z MySQL lub z potoku |
75 | XML. | |
68b62e17 | 76 | |
c6a4b25a AG |
77 | %package -n libsphinxclient |
78 | Summary: Client library for Sphinx | |
79 | Summary(pl.UTF-8): Biblioteka kliencka do Sphinx | |
80 | Group: Libraries | |
81 | ||
82 | %description -n libsphinxclient | |
83 | This package provides a client library for Sphinx search engine. | |
84 | ||
adb1201d | 85 | %description -n libsphinxclient -l pl.UTF-8 |
1f2de170 | 86 | Ten pakiet dostarcza bibliotekę kliencką do silnika Sphinx. |
c6a4b25a AG |
87 | |
88 | %package -n libsphinxclient-devel | |
89 | Summary: Header files for sphinxclient library | |
90 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki sphinxclient | |
91 | Group: Development/Libraries | |
92 | Requires: libsphinxclient = %{version}-%{release} | |
93 | ||
94 | %description -n libsphinxclient-devel | |
95 | Header files for sphinxclient library. | |
96 | ||
97 | %description -n libsphinxclient-devel -l pl.UTF-8 | |
98 | Pliki nagłówkowe biblioteki sphinxclient. | |
99 | ||
100 | %package -n libsphinxclient-static | |
101 | Summary: Static sphinxclient library | |
102 | Summary(pl.UTF-8): Statyczna biblioteka sphinxclient | |
103 | Group: Development/Libraries | |
104 | Requires: libsphinxclient-devel = %{version}-%{release} | |
105 | ||
106 | %description -n libsphinxclient-static | |
107 | Static sphinxclient library. | |
108 | ||
109 | %description -n libsphinxclient-static -l pl.UTF-8 | |
110 | Statyczna biblioteka sphinxclient. | |
111 | ||
13c36946 ER |
112 | %package -n java-sphinx |
113 | Summary: Java API for Sphinx | |
37ac51db | 114 | Summary(pl.UTF-8): API Javy dla Sphinksa |
13c36946 ER |
115 | Group: Development/Languages/Java |
116 | Requires: jpackage-utils | |
117 | ||
118 | %description -n java-sphinx | |
119 | Java API for Sphinx. | |
120 | ||
37ac51db JB |
121 | %description -n java-sphinx -l pl.UTF-8 |
122 | API Javy dla Sphinksa. | |
123 | ||
b8b1e75a ER |
124 | %package -n php-sphinx |
125 | Summary: PHP API for Sphinx | |
56d91f88 | 126 | Summary(pl.UTF-8): API PHP dla Sphinksa |
b8b1e75a | 127 | Group: Libraries |
1e7134e7 | 128 | Requires: php-common >= 4:%{php_min_version} |
80101f7f | 129 | Provides: php(sphinx) |
b8b1e75a ER |
130 | |
131 | %description -n php-sphinx | |
132 | PHP API for Sphinx. | |
133 | ||
56d91f88 JB |
134 | %description -n php-sphinx -l pl.UTF-8 |
135 | API PHP dla Sphinksa. | |
136 | ||
c6a4b25a AG |
137 | %package -n python-sphinx |
138 | Summary: Python API for Sphinx | |
139 | Summary(pl.UTF-8): API Python dla Sphinksa | |
140 | Group: Development/Languages/Python | |
141 | %pyrequires_eq python | |
142 | ||
143 | %description -n python-sphinx | |
144 | Python API for Sphinx. | |
145 | ||
146 | %description -n python-sphinx -l pl.UTF-8 | |
147 | API Pythona dla Sphinksa. | |
148 | ||
910da407 | 149 | %prep |
c6a4b25a | 150 | %setup -q |
910da407 | 151 | %patch0 -p1 |
91a58c85 | 152 | %patch1 -p1 |
16577646 | 153 | %patch2 -p1 |
910da407 | 154 | |
2d2e893b ER |
155 | sed -i -e ' |
156 | s#/var/run/#/var/run/sphinx/# | |
157 | s#@CONFDIR@/log/searchd.pid#/var/run/sphinx/searchd.pid# | |
158 | s#@CONFDIR@/log/#/var/log/sphinx/#g | |
159 | s#@CONFDIR@/data/#/var/lib/sphinx/#g | |
160 | ' sphinx*.conf.in | |
161 | ||
910da407 ER |
162 | %build |
163 | %{__aclocal} | |
164 | %{__autoconf} | |
165 | %{__autoheader} | |
166 | %{__automake} | |
d9cd41fd | 167 | CPPFLAGS=-D_FILE_OFFSET_BITS=64 |
46bfcba0 | 168 | %configure \ |
c6a4b25a AG |
169 | --with%{!?with_libstemmer:out}-libstemmer \ |
170 | --with%{!?with_pgsql:out}-pgsql \ | |
171 | --with%{!?with_mysql:out}-mysql | |
90d211da | 172 | %{__make} -j1 |
6688ccc8 ER |
173 | # use .conf ext for %doc |
174 | cp -f sphinx.conf.dist sphinx.conf | |
175 | cp -f sphinx-min.conf.dist sphinx-min.conf | |
c6a4b25a AG |
176 | |
177 | # libsphinxclient | |
178 | cd api/libsphinxclient | |
179 | %{__libtoolize} | |
180 | %{__aclocal} | |
181 | %{__autoconf} | |
182 | %{__autoheader} | |
183 | %{__automake} | |
184 | CPPFLAGS=-D_FILE_OFFSET_BITS=64 | |
185 | %configure | |
90d211da | 186 | %{__make} -j1 |
c6a4b25a | 187 | cd ../.. |
910da407 | 188 | |
c6a4b25a AG |
189 | # java api |
190 | %if %{with java} | |
13c36946 ER |
191 | export JAVA_HOME="%{java_home}" |
192 | %{__make} -j1 -C api/java | |
c6a4b25a | 193 | %endif |
13c36946 | 194 | |
910da407 ER |
195 | %install |
196 | rm -rf $RPM_BUILD_ROOT | |
4b37062a | 197 | install -d $RPM_BUILD_ROOT{%{_sbindir},/etc/{logrotate.d,rc.d/init.d},/var/{log,run,lib}/%{name},/var/log/archive/%{name}} |
910da407 | 198 | |
90d211da | 199 | %{__make} -j1 install \ |
910da407 ER |
200 | DESTDIR=$RPM_BUILD_ROOT |
201 | ||
6688ccc8 ER |
202 | rm $RPM_BUILD_ROOT%{_sysconfdir}/example.sql |
203 | rm $RPM_BUILD_ROOT%{_sysconfdir}/sphinx.conf.dist | |
204 | ||
205 | # create default config with no index definition | |
206 | sed -e '/## data source definition/,/## indexer settings/d' sphinx.conf > $RPM_BUILD_ROOT%{_sysconfdir}/sphinx.conf | |
207 | ||
91a58c85 | 208 | rm $RPM_BUILD_ROOT%{_sysconfdir}/sphinx-min.conf.dist |
cf28692c | 209 | mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/searchd |
9d9b76b9 | 210 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
db04d92c | 211 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} |
910da407 | 212 | |
b7f79218 ER |
213 | install -d $RPM_BUILD_ROOT%{php_data_dir} |
214 | cp -a api/sphinxapi.php $RPM_BUILD_ROOT%{php_data_dir} | |
b8b1e75a | 215 | |
c6a4b25a AG |
216 | # libsphinxclient |
217 | %{__make} -C api/libsphinxclient install \ | |
218 | DESTDIR=$RPM_BUILD_ROOT | |
219 | ||
220 | # python api | |
221 | install -d $RPM_BUILD_ROOT%{py_sitescriptdir} | |
9d9b76b9 | 222 | cp -a api/sphinxapi.py $RPM_BUILD_ROOT%{py_sitescriptdir} |
c6a4b25a AG |
223 | %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir} |
224 | %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir} | |
225 | %py_postclean | |
226 | ||
227 | # ruby api | |
228 | ||
229 | # java api | |
230 | %if %{with java} | |
13c36946 ER |
231 | install -d $RPM_BUILD_ROOT%{_javadir} |
232 | cp -a api/java/sphinxapi.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar | |
233 | ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar | |
c6a4b25a | 234 | %endif |
13c36946 | 235 | |
910da407 ER |
236 | %clean |
237 | rm -rf $RPM_BUILD_ROOT | |
238 | ||
1f2de170 JB |
239 | %post -n libsphinxclient -p /sbin/ldconfig |
240 | %postun -n libsphinxclient -p /sbin/ldconfig | |
c6a4b25a | 241 | |
91a58c85 ER |
242 | %pre |
243 | %groupadd -g 249 sphinx | |
2d2e893b | 244 | %useradd -u 249 -d /var/lib/%{name} -g sphinx -c "Sphinx Search" sphinx |
91a58c85 ER |
245 | |
246 | %post | |
247 | /sbin/chkconfig --add sphinx | |
248 | %service sphinx restart | |
249 | ||
250 | %preun | |
6688ccc8 | 251 | if [ "$1" = 0 ]; then |
91a58c85 ER |
252 | %service sphinx stop |
253 | /sbin/chkconfig --del sphinx | |
254 | fi | |
255 | ||
910da407 ER |
256 | %files |
257 | %defattr(644,root,root,755) | |
6688ccc8 | 258 | %doc doc/sphinx.txt example.sql sphinx.conf sphinx-min.conf |
aa4b3fd5 ER |
259 | %dir %attr(750,root,sphinx) %{_sysconfdir} |
260 | %config(noreplace) %verify(not md5 mtime size) %attr(640,root,sphinx) %{_sysconfdir}/sphinx.conf | |
db04d92c | 261 | %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} |
6688ccc8 | 262 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
910da407 | 263 | %attr(755,root,root) %{_bindir}/indexer |
9d9b76b9 | 264 | %attr(755,root,root) %{_bindir}/indextool |
910da407 | 265 | %attr(755,root,root) %{_bindir}/search |
c6a4b25a | 266 | %attr(755,root,root) %{_bindir}/spelldump |
cf28692c | 267 | %attr(755,root,root) %{_sbindir}/searchd |
b8b1e75a | 268 | |
2d2e893b ER |
269 | %dir %attr(771,root,sphinx) /var/run/sphinx |
270 | %dir %attr(770,root,sphinx) /var/log/sphinx | |
4b37062a | 271 | %dir %attr(770,root,sphinx) /var/log/archive/sphinx |
2d2e893b ER |
272 | %dir %attr(770,root,sphinx) /var/lib/sphinx |
273 | ||
c6a4b25a AG |
274 | %files -n libsphinxclient |
275 | %defattr(644,root,root,755) | |
276 | %doc api/libsphinxclient/README | |
277 | %attr(755,root,root) %{_libdir}/libsphinxclient-*.*.*.so | |
278 | ||
279 | %files -n libsphinxclient-devel | |
280 | %defattr(644,root,root,755) | |
281 | %attr(755,root,root) %{_libdir}/libsphinxclient.so | |
1f2de170 | 282 | %{_libdir}/libsphinxclient.la |
c6a4b25a AG |
283 | %{_includedir}/*.h |
284 | ||
285 | %files -n libsphinxclient-static | |
286 | %defattr(644,root,root,755) | |
1f2de170 | 287 | %{_libdir}/libsphinxclient.a |
c6a4b25a AG |
288 | |
289 | %if %{with java} | |
13c36946 ER |
290 | %files -n java-sphinx |
291 | %defattr(644,root,root,755) | |
292 | %doc api/java/README | |
37ac51db | 293 | %{_javadir}/sphinx*.jar |
c6a4b25a | 294 | %endif |
13c36946 | 295 | |
b8b1e75a | 296 | %files -n php-sphinx |
56d91f88 | 297 | %defattr(644,root,root,755) |
b7f79218 | 298 | %{php_data_dir}/sphinxapi.php |
c6a4b25a AG |
299 | |
300 | %files -n python-sphinx | |
301 | %defattr(644,root,root,755) | |
9d9b76b9 | 302 | %{py_sitescriptdir}/*.py[co] |