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