]>
Commit | Line | Data |
---|---|---|
e1bb081c ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
cbdd8c75 | 5 | %define php_name php%{?php_suffix} |
e1bb081c ER |
6 | %define modname solr |
7 | Summary: Object oriented API to Apache Solr | |
5d3d0344 | 8 | Summary(fr.UTF-8): API orientée objet pour Apache Solr |
cbdd8c75 | 9 | Name: %{php_name}-pecl-solr |
b334e9fd ER |
10 | Version: 2.1.0 |
11 | Release: 1 | |
12 | License: PHP v3.01 | |
e1bb081c | 13 | Group: Development/Languages |
e1bb081c | 14 | Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz |
b334e9fd | 15 | # Source0-md5: 258865d4517312afda6890827f18f93f |
cbdd8c75 | 16 | URL: http://pecl.php.net/package/solr |
33f3983b | 17 | BuildRequires: %{php_name}-cli |
cbdd8c75 ER |
18 | %{?with_tests:BuildRequires: %{php_name}-curl} |
19 | BuildRequires: %{php_name}-devel >= 4:5.2.3 | |
ba057a01 | 20 | BuildRequires: %{php_name}-xml |
e1bb081c | 21 | BuildRequires: curl-devel |
47345f3b | 22 | BuildRequires: libxml2-devel >= 1:2.6.16 |
e1bb081c | 23 | BuildRequires: php-packagexml2cl |
511528d9 | 24 | BuildRequires: rpmbuild(macros) >= 1.666 |
17a4a157 | 25 | %{?requires_php_extension} |
203c0eb5 | 26 | Requires: %{php_name}-cli |
cbdd8c75 ER |
27 | Requires: %{php_name}-xml |
28 | Provides: php(solr) = %{version} | |
17a4a157 | 29 | Obsoletes: php-pecl-solr < 1.0.2-6 |
e1bb081c ER |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | Feature-rich library that allows PHP developers to communicate easily | |
34 | and efficiently with Apache Solr server instances using an | |
35 | object-oriented API. | |
36 | ||
37 | It effectively simplifies the process of interacting with Apache Solr | |
38 | using PHP5 and it already comes with built-in readiness for the latest | |
39 | features available in Solr 1.4. The extension has features such as | |
40 | built-in, serializable query string builder objects which effectively | |
41 | simplifies the manipulation of name-value pair request parameters | |
42 | across repeated requests. The response from the Solr server is also | |
43 | automatically parsed into native php objects whose properties can be | |
44 | accessed as array keys or object properties without any additional | |
45 | configuration on the client-side. Its advanced HTTP client reuses the | |
46 | same connection across multiple requests and provides built-in support | |
47 | for connecting to Solr servers secured behind HTTP Authentication or | |
48 | HTTP proxy servers. It is also able to connect to SSL-enabled | |
49 | containers. | |
50 | ||
b334e9fd ER |
51 | Notice: PECL Solr 2.x is not compatible with Apache Solr Server 3.x |
52 | ||
5d3d0344 | 53 | %description -l fr.UTF-8 |
e1bb081c ER |
54 | Bibliothèque riche en fonctionnalités qui permet aux développeurs PHP |
55 | de communiquer facilement et efficacement avec des instances du | |
56 | serveur Apache Solr en utilisant une API orientée objet. | |
57 | ||
58 | Cela simplifie réellement le processus d'interaction avec Apache Solr | |
59 | en utilisant PHP5 et fournit dores et déjà des facilités pour les | |
60 | dernières fonctionnalités disponibles dans Solr 1.4. L'extension | |
61 | possède des fonctionnalités telles qu'un constructeur de requêtes | |
62 | embarqué et sérialisable qui simplifie réellement la manipulation des | |
63 | couples de paramètres nom-valeur entre différentes requêtes. La | |
64 | réponse de Solr est également analysée automatiquement en objets php | |
65 | natifs dont les propriétés sont accessibles en tant que clés de | |
66 | tableaux ou en tant que propriétés d'objets sans la moindre | |
67 | configuration supplémentaire sur le client. Son client HTTP avancé | |
68 | utilise la même connexion entre différentes requêtes et fournit un | |
69 | support embarqué pour la connexion aux serveurs Solr protégés par | |
70 | authentification HTTP ou par un serveur mandataire. Il est également | |
71 | possible de se connecter à des serveurs via SSL. | |
72 | ||
73 | %prep | |
b334e9fd | 74 | %setup -qc |
e1bb081c ER |
75 | mv %{modname}-%{version}/* . |
76 | ||
e1bb081c ER |
77 | %build |
78 | packagexml2cl package.xml > ChangeLog | |
79 | ||
f6a0a363 | 80 | # Check version |
b334e9fd | 81 | extver=$(awk -F'"' '/define PHP_SOLR_VERSION / {print $2}' php_solr_version.h) |
f6a0a363 ER |
82 | if test "x${extver}" != "x%{version}"; then |
83 | : Error: Upstream version is ${extver}, expecting %{version}. | |
84 | exit 1 | |
85 | fi | |
86 | ||
e1bb081c ER |
87 | phpize |
88 | %configure | |
89 | %{__make} | |
90 | ||
91 | %if %{with tests} | |
92 | ln -sf %{php_extensiondir}/curl.so modules | |
511528d9 ER |
93 | %{__php} -n -q \ |
94 | -d extension_dir=modules \ | |
e1bb081c ER |
95 | -d extension=curl.so \ |
96 | -d extension=%{modname}.so \ | |
511528d9 ER |
97 | -m > modules.log |
98 | grep %{modname} modules.log | |
99 | %{__rm} modules/curl.so | |
e1bb081c ER |
100 | %endif |
101 | ||
102 | %install | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} | |
105 | %{__make} install \ | |
106 | EXTENSION_DIR=%{php_extensiondir} \ | |
107 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
b334e9fd | 108 | |
e1bb081c ER |
109 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
110 | ; Enable Solr extension module | |
111 | extension=%{modname}.so | |
112 | EOF | |
113 | ||
114 | %clean | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
117 | %files | |
118 | %defattr(644,root,root,755) | |
119 | %doc ChangeLog CREDITS README.SUBMITTING_CONTRIBUTIONS README.MEMORY_ALLOCATION | |
120 | %doc README.ABOUT_SOLR_EXTENSION TODO LICENSE docs/documentation.php | |
121 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
122 | %{php_extensiondir}/%{modname}.so |