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