summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-zookeeper.spec43
1 files changed, 30 insertions, 13 deletions
diff --git a/php-pecl-zookeeper.spec b/php-pecl-zookeeper.spec
index 96eb646..5db128c 100644
--- a/php-pecl-zookeeper.spec
+++ b/php-pecl-zookeeper.spec
@@ -7,9 +7,6 @@
# Please, preserve the changelog entries
#
%{?scl: %scl_package php-pecl-zookeeper}
-%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
-%{!?__pecl: %global __pecl %{_bindir}/pecl}
-%{!?__php: %global __php %{_bindir}/php}
%global pecl_name zookeeper
%global with_zts 0%{?__ztsphp:1}
@@ -22,7 +19,7 @@
Summary: PHP extension for interfacing with Apache ZooKeeper
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 0.2.2
-Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://github.com/andreiz/php-zookeeper
@@ -37,15 +34,15 @@ BuildRequires: zookeeper-devel
BuildRequires: zookeeper-lib-devel
%endif
-Requires(post): %{__pecl}
-Requires(postun): %{__pecl}
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
-Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
# Other third party repo stuff
@@ -73,6 +70,8 @@ Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
%description
This extension provides API for communicating with ZooKeeper service.
+Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
+
%prep
%setup -q -c
@@ -81,6 +80,8 @@ mv %{pecl_name}-%{version} NTS
# https://github.com/andreiz/php-zookeeper/issues/31
sed -e '/examples/s/role="php"/role="doc"/' -i package.xml
+%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
+
cd NTS
# https://github.com/andreiz/php-zookeeper/issues/27
sed -e 's:/lib:/$PHP_LIBDIR:' -i config.m4
@@ -150,21 +151,31 @@ make -C ZTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
-# Test & Documentation
+# Documentation
cd NTS
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+%if 0%{?fedora} < 24
+# 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
+%endif
%check
@@ -189,6 +200,7 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -202,6 +214,11 @@ rm -rf %{buildroot}
%changelog
+* Wed Mar 9 2016 Remi Collet <remi@fedoraproject.org> - 0.2.2-6
+- adapt for F24
+- drop runtime dependency on pear, new scriptlets
+- fix license management
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 0.2.2-5
- F21 have zookeeper-devel instead of zookeeper-lib-devel