]> git.pld-linux.org Git - packages/php-pecl-solr.git/blame - php-pecl-solr.spec
add network_tests bcond
[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
b334e9fd
ER
11Version: 2.1.0
12Release: 1
13License: PHP v3.01
e1bb081c 14Group: Development/Languages
e1bb081c 15Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
b334e9fd 16# Source0-md5: 258865d4517312afda6890827f18f93f
026132b4 17Patch0: tests-online.patch
cbdd8c75 18URL: http://pecl.php.net/package/solr
cbdd8c75 19BuildRequires: %{php_name}-devel >= 4:5.2.3
e1bb081c 20BuildRequires: curl-devel
47345f3b 21BuildRequires: libxml2-devel >= 1:2.6.16
e1bb081c 22BuildRequires: php-packagexml2cl
511528d9 23BuildRequires: rpmbuild(macros) >= 1.666
a809e4e7
ER
24%if %{with tests}
25BuildRequires: %{php_name}-cli
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}/* .
026132b4 82%{!?with_network_tests:%patch0 -p1}
e1bb081c 83
e1bb081c
ER
84%build
85packagexml2cl package.xml > ChangeLog
86
f6a0a363 87# Check version
b334e9fd 88extver=$(awk -F'"' '/define PHP_SOLR_VERSION / {print $2}' php_solr_version.h)
f6a0a363
ER
89if test "x${extver}" != "x%{version}"; then
90 : Error: Upstream version is ${extver}, expecting %{version}.
91 exit 1
92fi
93
e1bb081c
ER
94phpize
95%configure
96%{__make}
97
98%if %{with tests}
511528d9
ER
99%{__php} -n -q \
100 -d extension_dir=modules \
a809e4e7
ER
101 -d extension=%{php_extensiondir}/curl.so \
102 -d extension=%{php_extensiondir}/json.so \
e1bb081c 103 -d extension=%{modname}.so \
511528d9
ER
104 -m > modules.log
105grep %{modname} modules.log
de2189f2
ER
106
107export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
108%{__make} test \
109 PHP_EXECUTABLE=%{__php} \
110 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="json" \
e1bb081c
ER
111%endif
112
113%install
114rm -rf $RPM_BUILD_ROOT
115install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
116%{__make} install \
117 EXTENSION_DIR=%{php_extensiondir} \
118 INSTALL_ROOT=$RPM_BUILD_ROOT
b334e9fd 119
e1bb081c
ER
120cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
121; Enable Solr extension module
122extension=%{modname}.so
123EOF
124
125%clean
126rm -rf $RPM_BUILD_ROOT
127
7a2204f2
ER
128%post
129%php_webserver_restart
130
131%postun
132if [ "$1" = 0 ]; then
133 %php_webserver_restart
134fi
135
e1bb081c
ER
136%files
137%defattr(644,root,root,755)
138%doc ChangeLog CREDITS README.SUBMITTING_CONTRIBUTIONS README.MEMORY_ALLOCATION
139%doc README.ABOUT_SOLR_EXTENSION TODO LICENSE docs/documentation.php
140%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
141%{php_extensiondir}/%{modname}.so
This page took 0.078445 seconds and 4 git commands to generate.