summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-03-09 11:03:16 +0100
committerRemi Collet <fedora@famillecollet.com>2016-03-09 11:03:16 +0100
commit2e25e9b7a968e8a0ca8d9db1eccd3ee7cd2062b7 (patch)
treecc016e367697d0a62a7662af0a595d5df058c70b
parent14af4f2b320d0df8d9559041c1bf277f0f2e74d0 (diff)
php-pecl-yp: F24
-rw-r--r--php-pecl-yp.spec56
1 files changed, 37 insertions, 19 deletions
diff --git a/php-pecl-yp.spec b/php-pecl-yp.spec
index 13bf1bf..b872bbb 100644
--- a/php-pecl-yp.spec
+++ b/php-pecl-yp.spec
@@ -1,4 +1,4 @@
-# spec file for php-pecl-yp
+# remirepo spec file for php-pecl-yp
#
# Copyright (c) 2014-2016 Remi Collet
# License: CC-BY-SA
@@ -7,9 +7,6 @@
# Please, preserve the changelog entries
#
%{?scl: %scl_package php-pecl-yp}
-%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
-%{!?__pecl: %global __pecl %{_bindir}/pecl}
-%{!?__php: %global __php %{_bindir}/php}
%global with_zts 0%{?__ztsphp:1}
%global pecl_name yp
@@ -22,7 +19,7 @@
Summary: YP/NIS functions
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 1.0.1
-Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1
+Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
@@ -32,16 +29,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel > 5.3
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}}
-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
@@ -70,11 +67,18 @@ Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
NIS (formerly called Yellow Pages) allows network management
of important administrative files (e.g. the password file).
+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
mv %{pecl_name}-%{version}%{?prever} NTS
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' \
+ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -i package.xml
+
cd NTS
# Fix version
#sed -e '/PHP_YP_VERSION/s/1.0.0RC1/%{version}/' -i php_yp.h
@@ -134,23 +138,30 @@ make -C ZTS \
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
-# Test & Documentation
-for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
-done
+# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 NTS/$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
@@ -175,9 +186,10 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
-%doc %{pecl_testdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
+
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -188,6 +200,12 @@ rm -rf %{buildroot}
%changelog
+* Wed Mar 9 2016 Remi Collet <remi@fedoraproject.org> - 1.0.1-3
+- adapt for F24
+- drop runtime dependency on pear, new scriptlets
+- fix license management
+- don't install/register tests
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.0.1-2.1
- Fedora 21 SCL mass rebuild
@@ -208,4 +226,4 @@ rm -rf %{buildroot}
* Sat Feb 22 2014 Remi Collet <remi@fedoraproject.org> - 1.0.0-0.1.RC1
- initial package, version 1.0.0RC1 (beta)
-- open https://bugs.php.net/66753 missing License \ No newline at end of file
+- open https://bugs.php.net/66753 missing License