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