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