From 9436c6f388b15ddefd800ed7968040d7f0ba8dab Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Dec 2014 11:00:24 +0100 Subject: php-pecl-zip: fix scriptlets --- php-pecl-zip.spec | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/php-pecl-zip.spec b/php-pecl-zip.spec index 7a79671..05c4ad2 100644 --- a/php-pecl-zip.spec +++ b/php-pecl-zip.spec @@ -6,7 +6,8 @@ # # Please, preserve the changelog entries # -%{?scl: %scl_package php-pecl-zip} +%{?scl: %scl_package php-pecl-zip} +%{!?__pecl: %global __pecl %{_bindir}/pecl} %global with_zts 0%{?__ztsphp:1} %global pecl_name zip @@ -201,13 +202,20 @@ TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \ %clean rm -rf %{buildroot} +# when pear installed alone, after us +%triggerin -- %{?scl_prefix}php-pear +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi -%triggerin -- php-pear -%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : - +# posttrans as pear can be installed after us +%posttrans +if [ -x %{__pecl} ] ; then + %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +fi -%triggerun -- php-pear -if [ $1 -eq 0 -o $2 -eq 0 ] ; then +%postun +if [ $1 -eq 0 -a -x %{__pecl} ] ; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi -- cgit