]> git.pld-linux.org Git - packages/php-pecl-solr.git/blob - php-pecl-solr.spec
always test for module load
[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.4.0
12 Release:        1
13 License:        PHP v3.01
14 Group:          Development/Languages
15 Source0:        https://pecl.php.net/get/%{modname}-%{version}.tgz
16 # Source0-md5:  2c9accf66681a3daaaf371bc07e44902
17 Patch0:         tests-online.patch
18 URL:            https://pecl.php.net/package/solr
19 BuildRequires:  %{php_name}-cli
20 BuildRequires:  %{php_name}-devel >= 4:5.3.0
21 BuildRequires:  curl-devel
22 BuildRequires:  libxml2-devel >= 1:2.6.16
23 BuildRequires:  php-packagexml2cl
24 BuildRequires:  rpmbuild(macros) >= 1.666
25 %if %{with tests}
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 cat <<'EOF' > run-tests.sh
85 #!/bin/sh
86 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
87 exec %{__make} test \
88         PHP_EXECUTABLE=%{__php} \
89         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="json" \
90         RUN_TESTS_SETTINGS="-q $*"
91 EOF
92 chmod +x run-tests.sh
93
94 %build
95 packagexml2cl package.xml > ChangeLog
96
97 # Check version
98 extver=$(awk -F'"' '/define PHP_SOLR_VERSION / {print $2}' src/php%{php_major_version}/php_solr_version.h)
99 if test "x${extver}" != "x%{version}"; then
100         : Error: Upstream version is ${extver}, expecting %{version}.
101         exit 1
102 fi
103
104 phpize
105 %configure
106 %{__make}
107
108 %{__php} -n -q \
109         -d extension_dir=modules \
110         -d extension=%{php_extensiondir}/curl.so \
111         -d extension=%{php_extensiondir}/json.so \
112         -d extension=%{modname}.so \
113         -m > modules.log
114 grep %{modname} modules.log
115
116 %if %{with tests}
117 ./run-tests.sh --show-diff
118 %endif
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
123 %{__make} install \
124         EXTENSION_DIR=%{php_extensiondir} \
125         INSTALL_ROOT=$RPM_BUILD_ROOT
126
127 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
128 ; Enable Solr extension module
129 extension=%{modname}.so
130 EOF
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %post
136 %php_webserver_restart
137
138 %postun
139 if [ "$1" = 0 ]; then
140         %php_webserver_restart
141 fi
142
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.046145 seconds and 3 git commands to generate.