X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=php-pecl-solr.spec;h=46ff258d4e08c3fc93ec878eb652028b68aa8dfe;hb=d7ce20a;hp=5d654c469d4b5004363c33800db424094517251e;hpb=cbdd8c750e9a0b707df297c6253754511f19cb44;p=packages%2Fphp-pecl-solr.git diff --git a/php-pecl-solr.spec b/php-pecl-solr.spec index 5d654c4..46ff258 100644 --- a/php-pecl-solr.spec +++ b/php-pecl-solr.spec @@ -1,29 +1,38 @@ # # 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: 1.0.2 -Release: 3 -License: PHP +Version: 2.1.0 +Release: 1 +License: PHP v3.01 Group: Development/Languages -Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz -# Source0-md5: 1632144b462ab22b91d03e4d59704fab -Patch0: do-not-screw-with-random-seed.patch -URL: http://pecl.php.net/package/solr -%{?with_tests:BuildRequires: %{php_name}-curl} -BuildRequires: %{php_name}-devel >= 4:5.2.3 +Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz +# Source0-md5: 258865d4517312afda6890827f18f93f +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.650 +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} -%{?requires_php_extension} +Obsoletes: php-pecl-solr < 1.0.2-6 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -45,6 +54,8 @@ for connecting to Solr servers secured behind HTTP Authentication or HTTP proxy servers. It is also able to connect to SSL-enabled containers. +Notice: PECL Solr 2.x is not compatible with Apache Solr Server 3.x + %description -l fr.UTF-8 Bibliothèque riche en fonctionnalités qui permet aux développeurs PHP de communiquer facilement et efficacement avec des instances du @@ -66,29 +77,37 @@ authentification HTTP ou par un serveur mandataire. Il est également possible de se connecter à des serveurs via SSL. %prep -%setup -q -c +%setup -qc mv %{modname}-%{version}/* . - -# avoid 1970 dates in doc -find -newer TODO -o -print | xargs touch --reference %{SOURCE0} - -%patch0 -p1 +#%{!?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) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream version is ${extver}, expecting %{version}. + exit 1 +fi + phpize %configure %{__make} %if %{with tests} -ln -sf %{php_extensiondir}/curl.so modules -%{__php} \ - -n -q -d extension_dir=modules \ - -d extension=curl.so \ +%{__php} -n -q \ + -d extension_dir=modules \ + -d extension=%{php_extensiondir}/curl.so \ + -d extension=%{php_extensiondir}/json.so \ -d extension=%{modname}.so \ - --modules | grep %{modname} -rm -f modules/curl.so + -m > modules.log +grep %{modname} modules.log + +export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 +%{__make} test \ + PHP_EXECUTABLE=%{__php} \ + PHP_TEST_SHARED_SYSTEM_EXTENSIONS="json" \ %endif %install @@ -97,6 +116,7 @@ install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}} %{__make} install \ EXTENSION_DIR=%{php_extensiondir} \ INSTALL_ROOT=$RPM_BUILD_ROOT + cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini ; Enable Solr extension module extension=%{modname}.so @@ -105,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