summaryrefslogtreecommitdiffstats
path: root/php-pecl-memprof.spec
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-06-23 14:00:46 +0200
committerRemi Collet <fedora@famillecollet.com>2015-06-23 14:00:46 +0200
commit4544afbad8e3cee7e1fd51621116f64f543fc74e (patch)
tree353dcc5b6e144d1ffc6de38efc48306a242430d3 /php-pecl-memprof.spec
parentceb24251dd2ac506320f293ae15cc59986af93da (diff)
php-pecl-memprof allow build against rh-php56 (as more-php56)
Diffstat (limited to 'php-pecl-memprof.spec')
-rw-r--r--php-pecl-memprof.spec65
1 files changed, 46 insertions, 19 deletions
diff --git a/php-pecl-memprof.spec b/php-pecl-memprof.spec
index 3a07d08..3dcd4d9 100644
--- a/php-pecl-memprof.spec
+++ b/php-pecl-memprof.spec
@@ -1,4 +1,7 @@
-# spec file for php-pecl-memprof
+# remirepo spec file for php-pecl-memprof
+# With SCL compatibility, from Fedora:
+#
+# Fedora spec file for php-pecl-memprof
#
# 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-memprof}
%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
%{!?__pecl: %global __pecl %{_bindir}/pecl}
@@ -21,9 +32,9 @@
%endif
Summary: Memory usage profiler
-Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 1.0.0
-Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
@@ -38,8 +49,6 @@ BuildRequires: %{?scl_prefix}php-devel > 5.3
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: Judy-devel
-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}}
@@ -51,17 +60,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
@@ -79,9 +92,10 @@ Memory usage profiler for PHP scripts.
%prep
%setup -q -c
mv %{pecl_name}-%{version} NTS
-cp %{SOURCE1} %{SOURCE2} .
cd NTS
+cp %{SOURCE1} %{SOURCE2} .
+
sed -e 's:/lib:/$PHP_LIBDIR:' -i config.m4
# Sanity check, really often broken
@@ -142,16 +156,24 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
-install -Dpm 644 LICENSE %{buildroot}%{pecl_docdir}/%{pecl_name}/LICENSE
-install -Dpm 644 README.md %{buildroot}%{pecl_docdir}/%{pecl_name}/README.md
+install -Dpm 644 NTS/LICENSE %{buildroot}%{pecl_docdir}/%{pecl_name}/LICENSE
+install -Dpm 644 NTS/README.md %{buildroot}%{pecl_docdir}/%{pecl_name}/README.md
-%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
@@ -176,6 +198,7 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -189,6 +212,10 @@ rm -rf %{buildroot}
%changelog
+* Tue Jun 23 2015 Remi Collet <rcollet@redhat.com> - 1.0.0-6
+- 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.0-5.1
- Fedora 21 SCL mass rebuild