]> git.pld-linux.org Git - packages/php-pecl-solr.git/blobdiff - php-pecl-solr.spec
up to 2.4.0; adds php7 support
[packages/php-pecl-solr.git] / php-pecl-solr.spec
index 1353f3fe8c0f9c05bb3f1c4e6d9259c182aaee2c..0b988c6d432a6f60f4b5fb36a239e443cec69adb 100644 (file)
@@ -1,29 +1,35 @@
 #
 # Conditional build:
 %bcond_without tests           # build without tests
+%bcond_with    network_tests   # run tests requiring setup Solr Server on localhost:8983
 
 %define                php_name        php%{?php_suffix}
 %define                modname solr
 Summary:       Object oriented API to Apache Solr
 Summary(fr.UTF-8):     API orientée objet pour Apache Solr
 Name:          %{php_name}-pecl-solr
-Version:       2.1.0
+Version:       2.4.0
 Release:       1
 License:       PHP v3.01
 Group:         Development/Languages
-Source0:       http://pecl.php.net/get/%{modname}-%{version}.tgz
-# Source0-md5: 258865d4517312afda6890827f18f93f
-URL:           http://pecl.php.net/package/solr
-BuildRequires: %{php_name}-cli
-%{?with_tests:BuildRequires:   %{php_name}-curl}
-BuildRequires: %{php_name}-devel >= 4:5.2.3
-BuildRequires: %{php_name}-xml
+Source0:       https://pecl.php.net/get/%{modname}-%{version}.tgz
+# Source0-md5: 2c9accf66681a3daaaf371bc07e44902
+Patch0:                tests-online.patch
+URL:           https://pecl.php.net/package/solr
+BuildRequires: %{php_name}-devel >= 4:5.3.0
 BuildRequires: curl-devel
 BuildRequires: libxml2-devel >= 1:2.6.16
 BuildRequires: php-packagexml2cl
 BuildRequires: rpmbuild(macros) >= 1.666
+%if %{with tests}
+BuildRequires: %{php_name}-cli
+BuildRequires: %{php_name}-curl
+BuildRequires: %{php_name}-json
+BuildRequires: %{php_name}-xml
+%endif
 %{?requires_php_extension}
 Requires:      %{php_name}-cli
+Requires:      %{php_name}-json
 Requires:      %{php_name}-xml
 Provides:      php(solr) = %{version}
 Obsoletes:     php-pecl-solr < 1.0.2-6
@@ -73,12 +79,13 @@ possible de se connecter à des serveurs via SSL.
 %prep
 %setup -qc
 mv %{modname}-%{version}/* .
+%{!?with_network_tests:%patch0 -p1}
 
 %build
 packagexml2cl package.xml > ChangeLog
 
 # Check version
-extver=$(awk -F'"' '/define PHP_SOLR_VERSION / {print $2}' php_solr_version.h)
+extver=$(awk -F'"' '/define PHP_SOLR_VERSION / {print $2}' src/php%{php_major_version}/php_solr_version.h)
 if test "x${extver}" != "x%{version}"; then
        : Error: Upstream version is ${extver}, expecting %{version}.
        exit 1
@@ -89,14 +96,18 @@ phpize
 %{__make}
 
 %if %{with tests}
-ln -sf %{php_extensiondir}/curl.so modules
 %{__php} -n -q \
        -d extension_dir=modules \
-       -d extension=curl.so \
+       -d extension=%{php_extensiondir}/curl.so \
+       -d extension=%{php_extensiondir}/json.so \
        -d extension=%{modname}.so \
        -m > modules.log
 grep %{modname} modules.log
-%{__rm} modules/curl.so
+
+export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
+%{__make} test \
+       PHP_EXECUTABLE=%{__php} \
+       PHP_TEST_SHARED_SYSTEM_EXTENSIONS="json" \
 %endif
 
 %install
@@ -114,6 +125,14 @@ EOF
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+%php_webserver_restart
+
+%postun
+if [ "$1" = 0 ]; then
+       %php_webserver_restart
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog CREDITS README.SUBMITTING_CONTRIBUTIONS README.MEMORY_ALLOCATION
This page took 0.152372 seconds and 4 git commands to generate.