summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-xdebug.spec78
1 files changed, 60 insertions, 18 deletions
diff --git a/php-pecl-xdebug.spec b/php-pecl-xdebug.spec
index 758a7f2..626824c 100644
--- a/php-pecl-xdebug.spec
+++ b/php-pecl-xdebug.spec
@@ -1,5 +1,18 @@
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
-
+# spec file for php-pecl-xdebug
+#
+# Copyright (c) 2010-2014 Remi Collet
+# Copyright (c) 2006-2009 Christopher Stone
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please, preserve the changelog entries
+#
+%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
+%{!?__pecl: %global __pecl %{_bindir}/pecl}
+%{!?__php: %global __php %{_bindir}/php}
+
+%global with_zts 0%{?__ztsphp:1}
%global pecl_name xdebug
#global commit b1ce1e3ecc95c2e24d2df73cffce7e501df53215
#global gitver %(c=%{commit}; echo ${c:0:7})
@@ -7,8 +20,8 @@
Name: php-pecl-xdebug
Summary: PECL package for debugging PHP scripts
-Version: 2.2.3
-Release: 1%{?dist}.1
+Version: 2.2.4
+Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
%if 0%{?gitver:1}
Source0: https://github.com/%{pecl_name}/%{pecl_name}/archive/%{commit}/%{pecl_name}-%{version}-%{gitver}.tar.gz
%else
@@ -46,10 +59,15 @@ Obsoletes: php54-pecl-%{pecl_name}
%if "%{php_version}" > "5.5"
Obsoletes: php55u-pecl-%{pecl_name}
%endif
+%if "%{php_version}" > "5.6"
+Obsoletes: php56u-pecl-%{pecl_name}
+%endif
+%if 0%{?fedora} < 20
# Filter private shared
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
+%endif
%description
@@ -76,10 +94,12 @@ Xdebug also provides:
%if 0%{?gitver:1}
sed -e '/release/s/2.2.1/%{version}%{?prever}/' \
%{pecl_name}-%{commit}/package.xml >package.xml
-mv %{pecl_name}-%{commit} %{pecl_name}-%{version}%{?prever}
+mv %{pecl_name}-%{commit} NTS
+%else
+mv %{pecl_name}-%{version}%{?prever} NTS
%endif
-cd %{pecl_name}-%{version}%{?prever}
+cd NTS
# Check extension version
ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h)
@@ -87,15 +107,20 @@ if test "$ver" != "%{version}%{?prever}"; then
: Error: Upstream XDEBUG_VERSION version is ${ver}, expecting %{version}%{?prever}.
exit 1
fi
-
cd ..
-cp -r %{pecl_name}-%{version}%{?prever} %{pecl_name}-zts
+
+%if %{with_zts}
+# Duplicate source tree for NTS / ZTS build
+cp -pr NTS ZTS
+%endif
%build
-cd %{pecl_name}-%{version}%{?prever}
+cd NTS
%{_bindir}/phpize
-%configure --enable-xdebug --with-php-config=%{_bindir}/php-config
+%configure \
+ --enable-xdebug \
+ --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
# Build debugclient
@@ -106,21 +131,24 @@ pushd debugclient
make %{?_smp_mflags}
popd
-cd ../%{pecl_name}-zts
+%if %{with_zts}
+cd ../ZTS
%{_bindir}/zts-phpize
-%configure --enable-xdebug --with-php-config=%{_bindir}/zts-php-config
+%configure \
+ --enable-xdebug \
+ --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
+%endif
%install
rm -rf %{buildroot}
# install NTS extension
-make -C %{pecl_name}-%{version}%{?prever} \
- install INSTALL_ROOT=%{buildroot}
+make -C NTS install INSTALL_ROOT=%{buildroot}
# install debugclient
-install -Dpm 755 %{pecl_name}-%{version}%{?prever}/debugclient/debugclient \
+install -Dpm 755 NTS/debugclient/debugclient \
%{buildroot}%{_bindir}/debugclient
# install package registration file
@@ -135,9 +163,9 @@ zend_extension=%{php_extdir}/%{pecl_name}.so
; see http://xdebug.org/docs/all_settings
EOF
+%if %{with_zts}
# Install ZTS extension
-make -C %{pecl_name}-zts \
- install INSTALL_ROOT=%{buildroot}
+make -C ZTS install INSTALL_ROOT=%{buildroot}
install -d %{buildroot}%{php_ztsinidir}
cat > %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini << 'EOF'
@@ -146,6 +174,12 @@ zend_extension=%{php_ztsextdir}/%{pecl_name}.so
; see http://xdebug.org/docs/all_settings
EOF
+%endif
+
+# Test & Documentation
+for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+done
%check
@@ -155,10 +189,12 @@ EOF
--define zend_extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep Xdebug
+%if %{with_zts}
%{_bindir}/zts-php \
--no-php-ini \
--define zend_extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep Xdebug
+%endif
%post
@@ -177,17 +213,23 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc %{pecl_name}-%{version}%{?prever}/{CREDITS,LICENSE,NEWS,README}
+%doc %{pecl_docdir}/%{pecl_name}
%config(noreplace) %{php_inidir}/%{pecl_name}.ini
%{php_extdir}/%{pecl_name}.so
%{_bindir}/debugclient
%{pecl_xmldir}/%{name}.xml
+%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
%{php_ztsextdir}/%{pecl_name}.so
+%endif
%changelog
+* Sun Mar 02 2014 Remi Collet <remi@fedoraproject.org> - 2.2.4-1
+- Update to 2.2.4 (stable)
+- move documentation in pecl_docdir
+
* Wed May 22 2013 Remi Collet <remi@fedoraproject.org> - 2.2.3-1
- Update to 2.2.3