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