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