summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-06-20 18:28:15 +0200
committerRemi Collet <fedora@famillecollet.com>2015-06-20 18:28:15 +0200
commitd06e3b008f4a62e0c6b01e4d5c41ac446fd59939 (patch)
treed8e484cad09444fc47e614ed51f1a0b231b29538
parent53cdc4d2083c2501307cac7462e026b04946947b (diff)
php-pecl-fann allow build against "rh-php56" (for more-php56)
-rw-r--r--php-pecl-fann.spec71
1 files changed, 48 insertions, 23 deletions
diff --git a/php-pecl-fann.spec b/php-pecl-fann.spec
index e167f57..1e1565f 100644
--- a/php-pecl-fann.spec
+++ b/php-pecl-fann.spec
@@ -1,4 +1,7 @@
-# spec file for php-pecl-fann
+# remirepo spec file for php-pecl-fann
+# with SCL compatibility, from:
+#
+# Fedora spec file for php-pecl-fann
#
# Copyright (c) 2013-2015 Remi Collet
# License: CC-BY-SA
@@ -6,6 +9,14 @@
#
# Please, preserve the changelog entries
#
+%if 0%{?scl:1}
+%if "%{scl}" == "rh-php56"
+%global sub_prefix more-php56-
+%else
+%global sub_prefix %{scl_prefix}
+%endif
+%endif
+
%{?scl: %scl_package php-pecl-fann}
%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
%{!?__pecl: %global __pecl %{_bindir}/pecl}
@@ -21,9 +32,9 @@
%endif
Summary: Wrapper for FANN Library
-Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 1.0.7
-Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
@@ -34,8 +45,6 @@ BuildRequires: fann-devel > 2.1
BuildRequires: %{?scl_prefix}php-devel > 5.2
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}}
@@ -47,17 +56,21 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
# Other third party repo stuff
-Obsoletes: php53-pecl-%{pecl_name}
-Obsoletes: php53u-pecl-%{pecl_name}
-Obsoletes: php54-pecl-%{pecl_name}
-Obsoletes: php54w-pecl-%{pecl_name}
+Obsoletes: php53-pecl-%{pecl_name} <= %{version}
+Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php54-pecl-%{pecl_name} <= %{version}
+Obsoletes: php54w-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "5.5"
-Obsoletes: php55u-pecl-%{pecl_name}
-Obsoletes: php55w-pecl-%{pecl_name}
+Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "5.6"
-Obsoletes: php56u-pecl-%{pecl_name}
-Obsoletes: php56w-pecl-%{pecl_name}
+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
@@ -140,16 +153,6 @@ do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-
-
-%postun
-if [ $1 -eq 0 ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-
-
%check
cd NTS
: Minimal load test for NTS extension
@@ -184,6 +187,24 @@ REPORT_EXIT_STATUS=1 \
%endif
+# 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 -a -x %{__pecl} ] ; then
+ %{pecl_uninstall} %{pecl_name} >/dev/null || :
+fi
+
+
%clean
rm -rf %{buildroot}
@@ -204,6 +225,10 @@ rm -rf %{buildroot}
%changelog
+* Sat Jun 20 2015 Remi Collet <remi@fedoraproject.org> - 1.0.7-5
+- allow build against rh-php56 (as more-php56)
+- drop runtime dependency on pear, new scriptlets
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.0.7-4.1
- Fedora 21 SCL mass rebuild