[php-pecl-yaml/epel7] - provides php-yaml - install doc in pecl_docdir - cleanup

Remi Collet remi at fedoraproject.org
Fri Aug 29 12:27:41 UTC 2014


commit 71f8cb997a27bd20b8d983a8de20ae3e274f39ab
Author: Remi Collet <remi at fedoraproject.org>
Date:   Fri Aug 29 14:27:42 2014 +0200

    - provides php-yaml
    - install doc in pecl_docdir
    - cleanup

 .gitignore         |    1 +
 php-pecl-yaml.spec |   42 +++++++++++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 17 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 119f933..3d3e512 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+clog
 /yaml-1.0.1.tgz
 /yaml-1.1.0.tgz
 /yaml-1.1.1.tgz
diff --git a/php-pecl-yaml.spec b/php-pecl-yaml.spec
index 26e27a2..af52c51 100644
--- a/php-pecl-yaml.spec
+++ b/php-pecl-yaml.spec
@@ -5,12 +5,11 @@
 %global ini_name  40-%{pecl_name}.ini
 %endif
 
-%{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
-%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}
+%{!?__pecl:      %global __pecl      %{_bindir}/pecl}
 
 Name:           php-pecl-yaml
 Version:        1.1.1
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Support for YAML 1.1 serialization using the LibYAML library
 Group:          Development/Languages
 
@@ -19,19 +18,23 @@ URL:            http://code.google.com/p/php-yaml/
 Source0:        http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
 
 BuildRequires:      php-devel >= 5.2.0
-BuildRequires:      php-pear libyaml-devel
+BuildRequires:      php-pear
+BuildRequires:      libyaml-devel
 Requires:           php(zend-abi) = %{php_zend_api}
 Requires:           php(api) = %{php_core_api}
 Requires(post):     %{__pecl}
 Requires(postun):   %{__pecl}
 
+Provides:       php-%{pecl_name} = %{version}
+Provides:       php-%{pecl_name}%{?_isa} = %{version}
 Provides:       php-pecl(%{pecl_name}) = %{version}
+Provides:       php-pecl(%{pecl_name})%{?_isa} = %{version}
 
-# RPM 4.8
-%{?filter_provides_in: %filter_provides_in %{php_extdir}/.*\.so$}
+%if 0%{?fedora} < 20 && 0%{?rhel} < 7
+# Filter private shared
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
 %{?filter_setup}
-# RPM 4.9
-%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{php_extdir}/.*\\.so$
+%endif
 
 
 %description
@@ -41,7 +44,8 @@ constructs as valid YAML 1.1 documents.
 
 %prep
 %setup -q -c
-mv package.xml %{pecl_name}-%{version}/package.xml
+# Remove test file to avoid regsitration (pecl list-files yaml)
+sed -e '/role="test"/d' package.xml >%{pecl_name}-%{version}/package.xml
 
 
 %build
@@ -53,14 +57,10 @@ make %{?_smp_mflags}
 
 %check
 cd %{pecl_name}-%{version}
-make test NO_INTERACTION=1 | tee ../rpmtests.log
-if grep -q "FAILED TEST" ../rpmtests.log; then
-  exit 1
-fi
+make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1
 
 
 %install
-rm -rf %{buildroot}
 cd %{pecl_name}-%{version}
 make install INSTALL_ROOT=%{buildroot}
 
@@ -92,6 +92,11 @@ EOF
 mkdir -p %{buildroot}%{pecl_xmldir}
 install -p -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
 
+# Documentation
+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 || :
@@ -104,15 +109,18 @@ fi
 
 
 %files
-%defattr(-,root,root,-)
-%doc %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/LICENSE
-%doc %{pecl_name}-%{version}/README
+%doc %{pecl_docdir}/%{pecl_name}
 %config(noreplace) %{_sysconfdir}/php.d/%{ini_name}
 %{php_extdir}/%{pecl_name}.so
 %{pecl_xmldir}/%{name}.xml
 
 
 %changelog
+* Fri Aug 29 2014 Remi Collet <remi at fedoraproject.org> - 1.1.1-5
+- provides php-yaml
+- install doc in pecl_docdir
+- cleanup
+
 * Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1.1-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 


More information about the scm-commits mailing list