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