summaryrefslogtreecommitdiffstats
path: root/php-pecl-termbox.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-termbox.spec')
-rw-r--r--php-pecl-termbox.spec29
1 files changed, 22 insertions, 7 deletions
diff --git a/php-pecl-termbox.spec b/php-pecl-termbox.spec
index 6e97532..7f0cec9 100644
--- a/php-pecl-termbox.spec
+++ b/php-pecl-termbox.spec
@@ -2,7 +2,7 @@
#
# Copyright (c) 2014-2015 Remi Collet
# License: CC-BY-SA
-# http://creativecommons.org/licenses/by-sa/3.0/
+# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
@@ -23,12 +23,15 @@
Summary: A termbox wrapper for PHP
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 0.1.2
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: ASL 2.0
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+# Upstream patch
+Patch0: %{pecl_name}-php7.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: termbox-devel
BuildRequires: %{?scl_prefix}php-devel
@@ -36,8 +39,6 @@ BuildRequires: %{?scl_prefix}php-pear
# For tests
BuildRequires: %{?scl_prefix}php-mbstring
-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}}
@@ -88,6 +89,8 @@ sed -e '/role="test"/d' -i package.xml
cd NTS
+%patch0 -p1 -b .php7
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_TERMBOX_VERSION/{s/.* "//;s/".*$//;p}' php_termbox.h)
if test "x${extver}" != "x%{version}"; then
@@ -147,12 +150,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
@@ -211,6 +222,10 @@ rm -rf %{buildroot}
%changelog
+* Sat Mar 28 2015 Remi Collet <remi@fedoraproject.org> - 0.1.2-2
+- add fix for PHP 7
+- drop runtime dependency on pear, new scriptlets
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 0.1.2-1.1
- Fedora 21 SCL mass rebuild