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