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