Make the package Red Hat Enterprise Linux friendly
Red Hat Enterprise Linux doesn't provide as much packages as Fedora. python-networkx is just a setools dependency in Red Hat Enterprise Linux and needs only limited set of functionality covered by small set of requirements. - BuildRequires are limited to necessary minimum and pytest is skipped in Red Hat Enterprise Linux - -doc subpackage is not built for Red Hat Enterprise Linux
This commit is contained in:
parent
503fc314c3
commit
27bee4b858
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 2.5
|
Version: 2.5
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Creates and Manipulates Graphs and Networks
|
Summary: Creates and Manipulates Graphs and Networks
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://networkx.github.io/
|
URL: http://networkx.github.io/
|
||||||
@ -12,13 +12,16 @@ Patch0: %{name}-doc.patch
|
|||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
|
BuildRequires: make
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
BuildRequires: %{py3_dist setuptools}
|
||||||
|
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
BuildRequires: fontawesome-fonts-web
|
BuildRequires: fontawesome-fonts-web
|
||||||
BuildRequires: font(fontawesome)
|
BuildRequires: font(fontawesome)
|
||||||
BuildRequires: font(lato)
|
BuildRequires: font(lato)
|
||||||
BuildRequires: font(robotoslab)
|
BuildRequires: font(robotoslab)
|
||||||
BuildRequires: fontconfig
|
BuildRequires: fontconfig
|
||||||
BuildRequires: make
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: python3-docs
|
BuildRequires: python3-docs
|
||||||
BuildRequires: python3-numpy-doc
|
BuildRequires: python3-numpy-doc
|
||||||
BuildRequires: %{py3_dist decorator}
|
BuildRequires: %{py3_dist decorator}
|
||||||
@ -36,7 +39,6 @@ BuildRequires: %{py3_dist pytest}
|
|||||||
BuildRequires: %{py3_dist pytest-cov}
|
BuildRequires: %{py3_dist pytest-cov}
|
||||||
BuildRequires: %{py3_dist pyyaml}
|
BuildRequires: %{py3_dist pyyaml}
|
||||||
BuildRequires: %{py3_dist scipy}
|
BuildRequires: %{py3_dist scipy}
|
||||||
BuildRequires: %{py3_dist setuptools}
|
|
||||||
BuildRequires: %{py3_dist sphinx}
|
BuildRequires: %{py3_dist sphinx}
|
||||||
BuildRequires: %{py3_dist sphinx-gallery}
|
BuildRequires: %{py3_dist sphinx-gallery}
|
||||||
BuildRequires: %{py3_dist sphinx-rtd-theme}
|
BuildRequires: %{py3_dist sphinx-rtd-theme}
|
||||||
@ -46,6 +48,7 @@ BuildRequires: xdg-utils
|
|||||||
# Documentation
|
# Documentation
|
||||||
BuildRequires: tex(latex)
|
BuildRequires: tex(latex)
|
||||||
BuildRequires: tex-preview
|
BuildRequires: tex-preview
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
NetworkX is a Python package for the creation, manipulation, and
|
NetworkX is a Python package for the creation, manipulation, and
|
||||||
@ -74,6 +77,7 @@ Provides: python3-%{srcname}-test = %{version}-%{release}
|
|||||||
NetworkX is a Python 3 package for the creation, manipulation, and
|
NetworkX is a Python 3 package for the creation, manipulation, and
|
||||||
study of the structure, dynamics, and functions of complex networks.
|
study of the structure, dynamics, and functions of complex networks.
|
||||||
|
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
%package doc
|
%package doc
|
||||||
Summary: Documentation for networkx
|
Summary: Documentation for networkx
|
||||||
Requires: fontawesome-fonts-web
|
Requires: fontawesome-fonts-web
|
||||||
@ -85,6 +89,7 @@ Provides: bundled(js-underscore)
|
|||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
Documentation for networkx
|
Documentation for networkx
|
||||||
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p0 -n %{srcname}-%{srcname}-%{version}
|
%autosetup -p0 -n %{srcname}-%{srcname}-%{version}
|
||||||
@ -106,6 +111,7 @@ sed -e "s|'https://docs\.python\.org/2/': None|'https://docs.python.org/': '%{_d
|
|||||||
%build
|
%build
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
# Build the documentation
|
# Build the documentation
|
||||||
PYTHONPATH=$PWD/build/lib make -C doc html
|
PYTHONPATH=$PWD/build/lib make -C doc html
|
||||||
rst2html --no-datestamp README.rst README.html
|
rst2html --no-datestamp README.rst README.html
|
||||||
@ -124,12 +130,14 @@ ln -s $(fc-match -f "%%{file}" "lato") Lato/lato-regular.ttf
|
|||||||
ln -s $(fc-match -f "%%{file}" "robotoslab:bold") RobotoSlab/roboto-slab-v7-bold.ttf
|
ln -s $(fc-match -f "%%{file}" "robotoslab:bold") RobotoSlab/roboto-slab-v7-bold.ttf
|
||||||
ln -s $(fc-match -f "%%{file}" "robotoslab") RobotoSlab/roboto-slab-v7-regular.ttf
|
ln -s $(fc-match -f "%%{file}" "robotoslab") RobotoSlab/roboto-slab-v7-regular.ttf
|
||||||
cd -
|
cd -
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py3_install
|
%py3_install
|
||||||
mv %{buildroot}%{_docdir}/networkx-%{version} ./installed-docs
|
mv %{buildroot}%{_docdir}/networkx-%{version} ./installed-docs
|
||||||
rm -f installed-docs/INSTALL.txt
|
rm -f installed-docs/INSTALL.txt
|
||||||
|
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
# Repack uncompressed zip archives
|
# Repack uncompressed zip archives
|
||||||
for fil in $(find doc/build -name \*.zip); do
|
for fil in $(find doc/build -name \*.zip); do
|
||||||
mkdir zip
|
mkdir zip
|
||||||
@ -139,19 +147,31 @@ for fil in $(find doc/build -name \*.zip); do
|
|||||||
cd ..
|
cd ..
|
||||||
rm -fr zip
|
rm -fr zip
|
||||||
done
|
done
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
pytest
|
pytest
|
||||||
|
%endif
|
||||||
|
|
||||||
%files -n python3-networkx
|
%files -n python3-networkx
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
%doc README.html installed-docs/*
|
%doc README.html installed-docs/*
|
||||||
|
%endif
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%{python3_sitelib}/networkx*
|
%{python3_sitelib}/networkx*
|
||||||
|
|
||||||
|
%if 0%{?rhel} == 0
|
||||||
%files doc
|
%files doc
|
||||||
%doc doc/build/html/*
|
%doc doc/build/html/*
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Dec 11 2020 Petr Lautrbach <plautrba@redhat.com> - 2.5-2
|
||||||
|
- Limit BuildRequires to necessary minimum in Red Hat Enterprise Linux
|
||||||
|
- Skip pytest in Red Hat Enterprise Linux
|
||||||
|
- Do not build -doc subpackage for Red Hat Enterprise Linux
|
||||||
|
|
||||||
* Sat Aug 22 2020 Jerry James <loganjerry@gmail.com> - 2.5-1
|
* Sat Aug 22 2020 Jerry James <loganjerry@gmail.com> - 2.5-1
|
||||||
- Version 2.5
|
- Version 2.5
|
||||||
- All patches except -doc have been upstreamed; drop them
|
- All patches except -doc have been upstreamed; drop them
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user