[bzr] Move the documentation in the bzr-doc subpackage into _pkgdocdir. This is

Toshio くらとみ toshio at fedoraproject.org
Tue Aug 6 15:49:04 UTC 2013


commit f6c663e53a012708ba23a6e65b686f10ade690b6
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Tue Aug 6 08:48:49 2013 -0700

    Move the documentation in the bzr-doc subpackage into _pkgdocdir.  This is
    
      a cleanup prompted by
      https://fedoraproject.org/wiki/Changes/UnversionedDocdirs but in addition to
      that feature also puts the documentation into the documentation directory for
      the main package.

 bzr.spec |   41 +++++++++++++++++++++++++++++++----------
 1 files changed, 31 insertions(+), 10 deletions(-)
---
diff --git a/bzr.spec b/bzr.spec
index 423a16d..9772229 100644
--- a/bzr.spec
+++ b/bzr.spec
@@ -4,6 +4,11 @@
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 %endif
 
+# Fedora 20 introduced unversioned docdirs.  In F20 and beyond, _pkgdocdir is
+# already defined as %%{_docdir}/%%{name}.  This macro defines a suitable
+# %%_pkgdocdir for previous releases and EPEL
+%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
+
 # All package versioning is found here:
 # the actual version is composed from these below, including leading 0 for release candidates
 #   bzrmajor:  main bzr version
@@ -13,7 +18,7 @@
 %global bzrmajor 2.6
 %global bzrminor .0
 #global bzrrc b6
-%global release 1
+%global release 2
 
 Name:           bzr
 Version:        %{bzrmajor}%{?bzrminor}
@@ -102,16 +107,16 @@ rm contrib/bash/bzr
 rm -rf $RPM_BUILD_ROOT%{python_sitearch}/bzrlib/util/elementtree/
 
 # Install documents
-install -d $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/
-install -d $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/pdf
+install -d $RPM_BUILD_ROOT/%{_pkgdocdir}/pdf
+cp -pr NEWS README TODO COPYING.txt contrib/ $RPM_BUILD_ROOT/%{_pkgdocdir}/
 cd doc
 for dir in *; do
     if [ -d $dir/_build/html ]; then
-        cp -R $dir/_build/html $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir
-        rm -f $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir/.buildinfo 
-        rm -f $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir/_static/$dir/Makefile
-        find $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/$dir -name '*.pdf' | while read pdf; do
-            ln $pdf $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}-doc-%{version}/pdf/
+        cp -R $dir/_build/html $RPM_BUILD_ROOT%{_pkgdocdir}/$dir
+        rm -f $RPM_BUILD_ROOT%{_pkgdocdir}/$dir/.buildinfo 
+        rm -f $RPM_BUILD_ROOT%{_pkgdocdir}/$dir/_static/$dir/Makefile
+        find $RPM_BUILD_ROOT%{_pkgdocdir}/$dir -name '*.pdf' | while read pdf; do
+            ln $pdf $RPM_BUILD_ROOT%{_pkgdocdir}/pdf/
         done
     fi
 done
@@ -128,7 +133,11 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -f bzr.lang
 %defattr(-,root,root,-)
-%doc NEWS README TODO COPYING.txt contrib/
+%doc %{_pkgdocdir}/NEWS
+%doc %{_pkgdocdir}/README
+%doc %{_pkgdocdir}/TODO
+%doc %{_pkgdocdir}/COPYING.txt
+%doc %{_pkgdocdir}/contrib/
 %{_bindir}/bzr
 %{_mandir}/man1/*
 %{python_sitearch}/bzrlib/
@@ -140,9 +149,21 @@ rm -rf $RPM_BUILD_ROOT
 
 %files doc
 %defattr(-,root,root,-)
-%doc %{_defaultdocdir}/%{name}-doc-%{version}/*
+%doc %{_pkgdocdir}/*
+%exclude %{_pkgdocdir}/NEWS
+%exclude %{_pkgdocdir}/README
+%exclude %{_pkgdocdir}/TODO
+%exclude %{_pkgdocdir}/COPYING.txt
+%exclude %{_pkgdocdir}/contrib/
 
 %changelog
+* Tue Aug  6 2013 Toshio Kuratomi <toshio at fedoraproject.org> - -
+- Move the documentation in the bzr-doc subpackage into _pkgdocdir.  This is
+  a cleanup prompted by
+  https://fedoraproject.org/wiki/Changes/UnversionedDocdirs but in addition to
+  that feature also puts the documentation into the documentation directory for
+  the main package.
+
 * Sat Jul 27 2013 Henrik Nordstrom <henirk at henriknordstrom.net> - 2.6.0-1
 - Upstream 2.6.0 release
 


More information about the scm-commits mailing list