- 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

(cherry picked from commit 07557792d0)
This commit is contained in:
Remi Collet 2013-11-22 12:05:28 +01:00
parent ad3d0888b0
commit 0d71d9ec83
3 changed files with 65 additions and 23 deletions

3
.gitignore vendored
View File

@ -1,6 +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
@ -11,3 +11,4 @@ package-*.xml
/pecl_http-2.0.0beta3.tgz
/pecl_http-2.0.0beta4.tgz
/pecl_http-2.0.0beta5.tgz
/pecl_http-2.0.0.tgz

View File

@ -6,16 +6,19 @@
#
# Please, preserve the changelog entries
#
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%{!?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 beta5
%global with_zts 0%{?__ztsphp:1}
Name: php-pecl-http
Version: 2.0.0
Release: 0.18.%{prever}%{?dist}
Release: 1%{?dist}
Summary: Extended HTTP support
License: BSD
@ -43,10 +46,16 @@ Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
%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
@ -58,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
@ -93,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.
@ -105,38 +117,52 @@ 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 propro raphf; do
if [ -f %{php_extdir}/${mod}.so ]; then
@ -144,17 +170,19 @@ for mod in json hash iconv propro raphf; do
fi
done
# Minimal load test for NTS extension
: Minimal load test for NTS extension
%{__php} --no-php-ini \
$modules \
--define extension=$PWD/%{proj_name}-%{version}%{?prever}/modules/%{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 \
$modules \
--define extension=$PWD/%{proj_name}-zts/modules/%{pecl_name}.so \
--define extension=$PWD/ZTS/modules/%{pecl_name}.so \
--modules | grep %{pecl_name}
%endif
%post
@ -168,19 +196,32 @@ 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 <remi@fedoraproject.org> - 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 <remi@fedoraproject.org> - 2.0.0-0.18.beta5
- update to 2.0.0 beta5
- requires propro and raphf extensions

View File

@ -1 +1 @@
98e66858a41537478f24839dd160582a pecl_http-2.0.0beta5.tgz
1e79f5d34124f816e204d41cae8cc11a pecl_http-2.0.0.tgz