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