[botan] Use _pkgdocdir.

Thomas Moschny thm at fedoraproject.org
Fri Feb 6 17:35:15 UTC 2015


commit 4083bc67434b9c92cd6044e16b4e487d80158052
Author: Thomas Moschny <thm at fedoraproject.org>
Date:   Fri Feb 6 18:34:45 2015 +0100

    Use _pkgdocdir.

 botan.spec |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)
---
diff --git a/botan.spec b/botan.spec
index 2dfe915..1ddb878 100644
--- a/botan.spec
+++ b/botan.spec
@@ -28,6 +28,8 @@ BuildRequires:  openssl-devel
 # do not check .so files in the python_sitelib directory
 %global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$
 
+%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
+
 %description
 Botan is a BSD-licensed crypto library written in C++. It provides a
 wide variety of basic cryptographic algorithms, X.509 certificates and
@@ -79,7 +81,6 @@ interfaces may change in the future.
 %setup -q -n Botan-%{version}
 %patch0 -p1
 %patch1 -p1
-cp -av %{SOURCE1} .
 
 
 %build
@@ -98,7 +99,8 @@ cp -av %{SOURCE1} .
         --enable-modules=%{enable_modules} \
         --disable-modules=%{disable_modules} \
         --with-boost-python \
-        --with-python-version=%{python_version}
+        --with-python-version=%{python_version} \
+        --with-sphinx
 
 # (ab)using CXX as an easy way to inject our CXXFLAGS
 make CXX="g++ ${CXXFLAGS:-%{optflags}}" %{?_smp_mflags}
@@ -109,7 +111,7 @@ make -f Makefile.python \
 %install
 make install \
      DESTDIR=%{buildroot}%{_prefix} \
-     DOCDIR=_doc \
+     DOCDIR=%{buildroot}%{_pkgdocdir} \
      INSTALL_CMD_EXEC="install -p -m 755" \
      INSTALL_CMD_DATA="install -p -m 644"
 
@@ -119,8 +121,10 @@ make -f Makefile.python install \
 # fixups
 find doc/examples -type f -exec chmod -x {} \;
 mv doc/examples/python doc/python-examples
-rm _doc/manual/.buildinfo
-rm -r _doc/manual/.doctrees
+cp -a doc/{examples,python-examples,license.txt} \
+   %{buildroot}%{_pkgdocdir}
+cp -a %{SOURCE1} %{buildroot}%{_pkgdocdir}
+rm -r %{buildroot}%{_pkgdocdir}/manual/{.doctrees,.buildinfo}
 
 
 %post -p /sbin/ldconfig
@@ -130,14 +134,15 @@ rm -r _doc/manual/.doctrees
 
 
 %files
-%doc _doc/readme.txt
-%doc doc/license.txt
-%doc README.fedora
+%dir %{_pkgdocdir}
+%{_pkgdocdir}/readme.txt
+%{_pkgdocdir}/license.txt
+%{_pkgdocdir}/README.fedora
 %{_libdir}/libbotan-%{major_version}.so.*
 
 
 %files devel
-%doc doc/examples
+%{_pkgdocdir}/examples
 %{_bindir}/botan-config-%{major_version}
 %{_includedir}/*
 %exclude %{_libdir}/libbotan-%{major_version}.a
@@ -146,13 +151,19 @@ rm -r _doc/manual/.doctrees
 
 
 %files doc
-%doc _doc/manual
-%doc _doc/readme.txt
-%doc doc/license.txt
+%dir %{_pkgdocdir}
+%{_pkgdocdir}/manual
+# next files duplicated on purpose, because -doc doesn't depend on the
+# main package
+%{_pkgdocdir}/readme.txt
+%{_pkgdocdir}/license.txt
+%{_pkgdocdir}/README.fedora
 
 
 %files python
-%doc doc/python-examples
+%{_pkgdocdir}/python-examples
+%exclude %{_pkgdocdir}/python-examples/*.pyc
+%exclude %{_pkgdocdir}/python-examples/*.pyo
 %{python_sitearch}/%{name}
 
 
@@ -169,6 +180,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./check --validate
 %changelog
 * Thu Feb  5 2015 Thomas Moschny <thomas.moschny at gmx.de> - 1.10.9-3
 - Disable gmp engine (see bug 1116406).
+- Use _pkgdocdir.
 
 * Thu Feb  5 2015 Thomas Moschny <thomas.moschny at gmx.de> - 1.10.9-2
 - Remove workaround for bug 1186014.


More information about the scm-commits mailing list