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