[python-matplotlib] Add conditional for optionally building doc sub-package
Jonathan G. Underwood
jgu at fedoraproject.org
Mon Feb 21 22:33:58 UTC 2011
commit a706a1d6d8a3e5c3326d6fe5ac8b72fc3a197104
Author: Jonathan G. Underwood <jonathan.underwood at gmail.com>
Date: Mon Feb 21 22:11:02 2011 +0000
Add conditional for optionally building doc sub-package
python-matplotlib.spec | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/python-matplotlib.spec b/python-matplotlib.spec
index 7940fd0..f8f9281 100644
--- a/python-matplotlib.spec
+++ b/python-matplotlib.spec
@@ -7,9 +7,16 @@
%filter_setup
}
+# We include capability for building a doc subpackage for
+# documentation. However, building the documentation requires python-basemap,
+# and python-basemap requires python-matplotlib to build, so we have a
+# circular dependence, and so we need to be able to turn off building of the
+# documents
+%global withdocs 1
+
Name: python-matplotlib
Version: 1.0.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Python plotting library
Group: Development/Libraries
@@ -49,6 +56,7 @@ Requires: tkinter
%description tk
%{summary}
+%if %{withdocs}
%package doc
Summary: Documentation files for python-matplotlib
Group: Documentation
@@ -65,7 +73,7 @@ BuildRequires: python-basemap
%description doc
%{summary}
-
+%endif
%prep
%setup -q -n matplotlib-%{version} -b1
@@ -83,6 +91,7 @@ cp %{SOURCE2} ./setup.cfg
%{__python} setup.py build
# Build html documentation
+%if %{withdocs}
%global py_ver %(echo `python -c "import sys; sys.stdout.write(sys.version[:3])"`)
%global sampledatadir %{_builddir}/mpl_sampledata-%{version}
%global libpath %{_builddir}/matplotlib-%{version}/build/lib.linux-%{_arch}-%{py_ver}
@@ -94,6 +103,7 @@ echo $PYTHONPATH
export PYTHONPATH=%{libpath}
%{__python} make.py html && %{__python} make.py html
popd
+%endif
%install
rm -rf $RPM_BUILD_ROOT
@@ -126,11 +136,16 @@ rm -rf $RPM_BUILD_ROOT
%{python_sitearch}/matplotlib/backends/tkagg.py*
%{python_sitearch}/matplotlib/backends/_tkagg.so
+%if %{withdocs}
%files doc
%doc doc/build/html
%doc examples
+%endif
%changelog
+* Mon Feb 21 2011 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 1.0.1-3
+- Add conditional for optionally building doc sub-package
+
* Sat Feb 19 2011 Jonathan G. Underwood <jonathan.underwood at gmail.com> - 1.0.1-2
- Build and package HTML documentation in -doc sub-package
- Move examples to -doc sub-package
More information about the scm-commits
mailing list