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