summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-jsond.spec16
1 files changed, 12 insertions, 4 deletions
diff --git a/php-pecl-jsond.spec b/php-pecl-jsond.spec
index 65e2222..d3d7e55 100644
--- a/php-pecl-jsond.spec
+++ b/php-pecl-jsond.spec
@@ -150,12 +150,20 @@ do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%triggerin -- php-pear
-%{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
-%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