diff --git a/.gitignore b/.gitignore index 27fd6f5..a198f4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ +clog package-*.xml -*spec~ +php-pecl-http.spec~ /pecl_http-2.0.0dev6.tgz /pecl_http-2.0.0dev7.tgz /pecl_http-2.0.0dev8.tgz @@ -8,3 +9,6 @@ package-*.xml /pecl_http-2.0.0beta1.tgz /pecl_http-2.0.0beta2.tgz /pecl_http-2.0.0beta3.tgz +/pecl_http-2.0.0beta4.tgz +/pecl_http-2.0.0beta5.tgz +/pecl_http-2.0.0.tgz diff --git a/php-pecl-http.spec b/php-pecl-http.spec index 43beeb8..d4449e2 100644 --- a/php-pecl-http.spec +++ b/php-pecl-http.spec @@ -1,13 +1,24 @@ -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +# spec file for php-pecl-http +# +# Copyright (c) 2012-2013 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/3.0/ +# +# Please, preserve the changelog entries +# +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?php_incldir: %global php_incldir %{_includedir}/php} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} # The project is pecl_http but the extension is only http %global proj_name pecl_http %global pecl_name http -%global prever beta3 +%global with_zts 0%{?__ztsphp:1} Name: php-pecl-http Version: 2.0.0 -Release: 0.13.%{prever}%{?dist} +Release: 1%{?dist} Summary: Extended HTTP support License: BSD @@ -28,16 +39,25 @@ BuildRequires: pcre-devel BuildRequires: zlib-devel >= 1.2.0.4 BuildRequires: libevent-devel >= 1.4 BuildRequires: curl-devel >= 7.18.2 -# No yet available on fedora: BuildRequires: libserf-devel +BuildRequires: php-pecl-propro-devel +BuildRequires: php-pecl-raphf-devel Requires(post): %{__pecl} Requires(postun): %{__pecl} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} -Requires: php-hash -Requires: php-iconv -Requires: php-json -Requires: php-spl +%if "%{php_version}" < "5.4" +# php 5.3.3 in EL-6 don't use arched virtual provides +# so only requires real packages instead +Requires: php-common%{?_isa} +%else +Requires: php-hash%{?_isa} +Requires: php-iconv%{?_isa} +Requires: php-json%{?_isa} +Requires: php-spl%{?_isa} +%endif +Requires: php-pecl(propro)%{?_isa} +Requires: php-pecl(raphf)%{?_isa} Conflicts: php-event Provides: php-pecl(%{proj_name}) = %{version}%{?prever} @@ -47,9 +67,11 @@ Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}%{?prever} Provides: php-%{pecl_name} = %{version}%{?prever} Provides: php-%{pecl_name}%{?_isa} = %{version}%{?prever} +%if 0%{?fedora} < 20 # Filter shared private %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} +%endif %description @@ -82,9 +104,10 @@ These are the files needed to compile programs using HTTP extension. %prep %setup -c -q -cd %{proj_name}-%{version}%{?prever} +mv %{proj_name}-%{version}%{?prever} NTS +cd NTS -extver=$(sed -n '/#define PHP_HTTP_EXT_VERSION/{s/.* "//;s/".*$//;p}' php_http.h) +extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h) if test "x${extver}" != "x%{version}%{?prever}"; then : Error: Upstream HTTP version is now ${extver}, expecting %{version}%{?prever}. : Update the pdover macro and rebuild. @@ -94,60 +117,72 @@ cd .. cp %{SOURCE1} %{pecl_name}.ini -cp -pr %{proj_name}-%{version}%{?prever} %{proj_name}-zts +%if %{with_zts} +# Duplicate source tree for NTS / ZTS build +cp -pr NTS ZTS +%endif %build -cd %{proj_name}-%{version}%{?prever} +cd NTS %{_bindir}/phpize %configure --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} -cd ../%{proj_name}-zts +%if %{with_zts} +cd ../ZTS %{_bindir}/zts-phpize %configure --with-php-config=%{_bindir}/zts-php-config make %{?_smp_mflags} +%endif %install -make -C %{proj_name}-%{version}%{?prever} \ - install INSTALL_ROOT=%{buildroot} - -make -C %{proj_name}-zts \ - install INSTALL_ROOT=%{buildroot} +make -C NTS install INSTALL_ROOT=%{buildroot} # Install XML package description install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml # install config file (z-http.ini to be loaded after json) install -Dpm644 %{pecl_name}.ini %{buildroot}%{php_inidir}/z-%{pecl_name}.ini + +%if %{with_zts} +make -C ZTS install INSTALL_ROOT=%{buildroot} install -Dpm644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/z-%{pecl_name}.ini +%endif + +# Test & Documentation +cd NTS +for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{proj_name}/$i +done +for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{proj_name}/$i +done %check -# Install needed extensions +# Shared needed extensions modules="" -for mod in json hash iconv; do +for mod in json hash iconv propro raphf; do if [ -f %{php_extdir}/${mod}.so ]; then - ln -sf %{php_extdir}/${mod}.so %{proj_name}-%{version}%{?prever}/modules - ln -sf %{php_ztsextdir}/${mod}.so %{proj_name}-zts/modules modules="$modules --define extension=${mod}.so" fi done -# Minimal load test for NTS extension +: Minimal load test for NTS extension %{__php} --no-php-ini \ - --define extension_dir=%{proj_name}-%{version}%{?prever}/modules \ $modules \ - --define extension=%{pecl_name}.so \ + --define extension=$PWD/NTS/modules/%{pecl_name}.so \ --modules | grep %{pecl_name} -# Minimal load test for ZTS extension +%if %{with_zts} +: Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ - --define extension_dir=%{proj_name}-zts/modules \ $modules \ - --define extension=%{pecl_name}.so \ + --define extension=$PWD/ZTS/modules/%{pecl_name}.so \ --modules | grep %{pecl_name} +%endif %post @@ -161,19 +196,45 @@ fi %files -%doc %{proj_name}-%{version}%{?prever}/{CREDITS,LICENSE,ThanksTo.txt} +%doc %{pecl_docdir}/%{proj_name} %config(noreplace) %{php_inidir}/z-%{pecl_name}.ini -%config(noreplace) %{php_ztsinidir}/z-%{pecl_name}.ini %{php_extdir}/%{pecl_name}.so -%{php_ztsextdir}/%{pecl_name}.so %{pecl_xmldir}/%{name}.xml +%if %{with_zts} +%config(noreplace) %{php_ztsinidir}/z-%{pecl_name}.ini +%{php_ztsextdir}/%{pecl_name}.so +%endif + %files devel +%doc %{pecl_testdir}/%{proj_name} %{php_incldir}/ext/%{pecl_name} + +%if %{with_zts} %{php_ztsincldir}/ext/%{pecl_name} +%endif %changelog +* Fri Nov 22 2013 Remi Collet - 2.0.0-1 +- update to 2.0.0 (stable) +- install doc in pecl doc_dir +- install tests in pecl test_dir (in devel) +- spec cleanups, and EPEL-6 compatibility + +* Tue Aug 20 2013 Remi Collet - 2.0.0-0.18.beta5 +- update to 2.0.0 beta5 +- requires propro and raphf extensions + +* Fri Mar 22 2013 Remi Collet - 2.0.0-0.16.beta4 +- rebuild for http://fedoraproject.org/wiki/Features/Php55 + +* Thu Feb 14 2013 Fedora Release Engineering - 2.0.0-0.15.beta4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Dec 30 2012 Remi Collet - 2.0.0-0.14.beta4 +- update to 2.0.0beta4 + * Thu Dec 13 2012 Remi Collet - 2.0.0-0.13.beta3 - update to 2.0.0beta3 - fix requires diff --git a/sources b/sources index 12b499b..dce8e43 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -dec6f1ccee0e7ee613b16b931af94b1d pecl_http-2.0.0beta3.tgz +1e79f5d34124f816e204d41cae8cc11a pecl_http-2.0.0.tgz