summaryrefslogtreecommitdiffstats
path: root/php-pecl-uploadprogress.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-uploadprogress.spec')
-rw-r--r--php-pecl-uploadprogress.spec35
1 files changed, 29 insertions, 6 deletions
diff --git a/php-pecl-uploadprogress.spec b/php-pecl-uploadprogress.spec
index c5c0331..47c2fec 100644
--- a/php-pecl-uploadprogress.spec
+++ b/php-pecl-uploadprogress.spec
@@ -22,7 +22,7 @@
Summary: An extension to track progress of a file upload
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.0.3.1
-Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
@@ -31,12 +31,13 @@ Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
# http://svn.php.net/viewvc/pecl/uploadprogress/trunk/LICENSE?view=co
Source1: LICENSE
+# See https://github.com/Jan-E/uploadprogress
+Patch0: %{pecl_name}-php7.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
-Requires(post): %{__pecl}
-Requires(postun): %{__pecl}
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
@@ -60,6 +61,10 @@ Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "7.0"
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -78,12 +83,16 @@ unfortunately still have issues.
See %{pecl_docdir}/%{pecl_name}/examples
for a little example.
+Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection}.
+
%prep
%setup -q -c
mv %{pecl_name}-%{version} NTS
cd NTS
+%patch0 -p1 -b .php7
+
cp %{SOURCE1} LICENSE
# Sanity check, really often broken
@@ -153,12 +162,20 @@ do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+# when pear installed alone, after us
+%triggerin -- %{?scl_prefix}php-pear
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+# posttrans as pear can be installed after us
+%posttrans
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
%postun
-if [ $1 -eq 0 ] ; then
+if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
@@ -185,8 +202,10 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
+
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -197,6 +216,10 @@ rm -rf %{buildroot}
%changelog
+* Thu Apr 9 2015 Remi Collet <remi@fedoraproject.org> - 1.0.3.1-6
+- add fix for PHP 7
+- drop runtime dependency on pear, new scriptlets
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.0.3.1-5.1
- Fedora 21 SCL mass rebuild