Spec file cleanups for readability
This commit is contained in:
parent
c7aa1a060f
commit
664c62f2ee
@ -8,15 +8,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
# We include capability for building a doc subpackage for
|
# We include capability for building a doc subpackage for
|
||||||
# documentation. However, building the documentation requires python-basemap,
|
# documentation. However, building the html documentation requires
|
||||||
# and python-basemap requires python-matplotlib to build, so we have a
|
# python-basemap, and python-basemap requires python-matplotlib to build, so
|
||||||
# circular dependence, and so we need to be able to turn off building of the
|
# we have a circular dependence, and so we need to be able to turn off
|
||||||
# documents
|
# building of the html documents
|
||||||
%global withdocs 1
|
%global withhtmldocs 1
|
||||||
|
|
||||||
Name: python-matplotlib
|
Name: python-matplotlib
|
||||||
Version: 1.0.1
|
Version: 1.0.1
|
||||||
Release: 9%{?dist}
|
Release: 10%{?dist}
|
||||||
Summary: Python plotting library
|
Summary: Python plotting library
|
||||||
|
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -27,13 +27,15 @@ URL: http://sourceforge.net/projects/matplotlib
|
|||||||
#sha1sum matplotlib-1.0.1-without-gpc.tar.gz
|
#sha1sum matplotlib-1.0.1-without-gpc.tar.gz
|
||||||
#a8ccbf4c4b9b90c773380cac83e792673837d3de matplotlib-1.0.1-without-gpc.tar.gz
|
#a8ccbf4c4b9b90c773380cac83e792673837d3de matplotlib-1.0.1-without-gpc.tar.gz
|
||||||
Source0: matplotlib-%{version}-without-gpc.tar.gz
|
Source0: matplotlib-%{version}-without-gpc.tar.gz
|
||||||
|
%if %{withhtmldocs}
|
||||||
Source1: http://downloads.sourceforge.net/matplotlib/mpl_sampledata-%{version}.tar.gz
|
Source1: http://downloads.sourceforge.net/matplotlib/mpl_sampledata-%{version}.tar.gz
|
||||||
|
%endif
|
||||||
Source2: setup.cfg
|
Source2: setup.cfg
|
||||||
|
# This patch taken from upstream SVN and will not be needed for releases later than 1.0.1
|
||||||
Patch0: matplotlib-1.0.1-plot_directive.patch
|
Patch0: matplotlib-1.0.1-plot_directive.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
BuildRequires: python-devel, freetype-devel, libpng-devel, zlib-devel
|
BuildRequires: python-devel, freetype-devel, libpng-devel, zlib-devel
|
||||||
BuildRequires: pygtk2-devel, gtk2-devel, tkinter, tk-devel
|
BuildRequires: pygtk2-devel, gtk2-devel
|
||||||
BuildRequires: pytz, python-dateutil, numpy
|
BuildRequires: pytz, python-dateutil, numpy
|
||||||
Requires: numpy, pytz, python-dateutil
|
Requires: numpy, pytz, python-dateutil
|
||||||
Requires: pycairo >= 1.2.0
|
Requires: pycairo >= 1.2.0
|
||||||
@ -50,6 +52,7 @@ of output back-ends.
|
|||||||
Summary: Tk backend for python-matplotlib
|
Summary: Tk backend for python-matplotlib
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
BuildRequires: tkinter, tk-devel
|
||||||
Requires: tkinter
|
Requires: tkinter
|
||||||
|
|
||||||
%description tk
|
%description tk
|
||||||
@ -65,11 +68,11 @@ BuildRequires: wxPython-devel
|
|||||||
%description wx
|
%description wx
|
||||||
%{summary}
|
%{summary}
|
||||||
|
|
||||||
%if %{withdocs}
|
|
||||||
%package doc
|
%package doc
|
||||||
Summary: Documentation files for python-matplotlib
|
Summary: Documentation files for python-matplotlib
|
||||||
Group: Documentation
|
Group: Documentation
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
%if %{withhtmldocs}
|
||||||
BuildRequires: python-sphinx
|
BuildRequires: python-sphinx
|
||||||
BuildRequires: tex(latex)
|
BuildRequires: tex(latex)
|
||||||
BuildRequires: dvipng
|
BuildRequires: dvipng
|
||||||
@ -79,37 +82,38 @@ BuildRequires: python-basemap
|
|||||||
# request isn't yet complete for this package. See:
|
# request isn't yet complete for this package. See:
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=613766
|
# https://bugzilla.redhat.com/show_bug.cgi?id=613766
|
||||||
# BuildRequires: python-xlwt
|
# BuildRequires: python-xlwt
|
||||||
|
%endif
|
||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
%{summary}
|
%{summary}
|
||||||
%endif
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
|
%if %{withhtmldocs}
|
||||||
%setup -q -n matplotlib-%{version} -b1
|
%setup -q -n matplotlib-%{version} -b1
|
||||||
|
%else
|
||||||
|
%setup -q -n matplotlib-%{version}
|
||||||
|
%endif
|
||||||
|
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
chmod -x lib/matplotlib/mpl-data/images/*.svg
|
chmod -x lib/matplotlib/mpl-data/images/*.svg
|
||||||
|
|
||||||
# Ensure all example files are non-executable so that the -doc package doesn't
|
|
||||||
# drag in dependencies
|
|
||||||
find examples -name '*.py' -exec chmod a-x '{}' \;
|
|
||||||
|
|
||||||
# Fix line ending in this example file
|
|
||||||
sed -i 's/\r//' examples/api/font_family_rc.py
|
|
||||||
|
|
||||||
%build
|
|
||||||
cp %{SOURCE2} ./setup.cfg
|
cp %{SOURCE2} ./setup.cfg
|
||||||
%{__python} setup.py build
|
|
||||||
|
|
||||||
# Build html documentation
|
%if %{withhtmldocs}
|
||||||
%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}
|
|
||||||
pushd doc
|
pushd doc
|
||||||
echo "examples.download : False" >> matplotlibrc
|
echo "examples.download : False" >> matplotlibrc
|
||||||
echo "examples.directory : %{sampledatadir}" >> matplotlibrc
|
echo "examples.directory : %{_builddir}/mpl_sampledata-%{version}" >> matplotlibrc
|
||||||
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%build
|
||||||
|
%{__python} setup.py build
|
||||||
|
|
||||||
|
%if %{withhtmldocs}
|
||||||
|
pushd doc
|
||||||
|
%global py_ver %(echo `python -c "import sys; sys.stdout.write(sys.version[:3])"`)
|
||||||
|
export PYTHONPATH=%{_builddir}/matplotlib-%{version}/build/lib.linux-%{_arch}-%{py_ver}
|
||||||
# This really does need to be ran twice
|
# This really does need to be ran twice
|
||||||
export PYTHONPATH=%{libpath}
|
|
||||||
%{__python} make.py --small html && %{__python} make.py --small html
|
%{__python} make.py --small html && %{__python} make.py --small html
|
||||||
rm -f build/html/.buildinfo
|
rm -f build/html/.buildinfo
|
||||||
chmod -x build/html/pyplots/make.py
|
chmod -x build/html/pyplots/make.py
|
||||||
@ -118,6 +122,13 @@ sed -i 's/\r//' build/html/examples/api/font_family_rc.py
|
|||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Ensure all example files are non-executable so that the -doc package doesn't
|
||||||
|
# drag in dependencies
|
||||||
|
find examples -name '*.py' -exec chmod a-x '{}' \;
|
||||||
|
|
||||||
|
# Fix line ending in this example file
|
||||||
|
sed -i 's/\r//' examples/api/font_family_rc.py
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
%{__python} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT
|
%{__python} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT
|
||||||
@ -156,14 +167,17 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{python_sitearch}/matplotlib/backends/backend_wx.py*
|
%{python_sitearch}/matplotlib/backends/backend_wx.py*
|
||||||
%{python_sitearch}/matplotlib/backends/backend_wxagg.py*
|
%{python_sitearch}/matplotlib/backends/backend_wxagg.py*
|
||||||
|
|
||||||
%if %{withdocs}
|
|
||||||
%files doc
|
%files doc
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc doc/build/html
|
|
||||||
%doc examples
|
%doc examples
|
||||||
|
%if %{withhtmldocs}
|
||||||
|
%doc doc/build/html
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Feb 26 2011 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 1.0.1-10
|
||||||
|
- Spec file cleanups for readability
|
||||||
|
|
||||||
* Sat Feb 26 2011 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 1.0.1-9
|
* Sat Feb 26 2011 Jonathan G. Underwood <jonathan.underwood@gmail.com> - 1.0.1-9
|
||||||
- Bump and rebuild
|
- Bump and rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user