%global srcname ryu # Not yet packaged for Fedora: %bcond_with ncclient Name: python-%{srcname} Version: 4.34 Release: 2%{?dist} Summary: Component-based software-defined networking framework License: ASL 2.0 URL: https://ryu-sdn.org/ Source0: https://github.com/faucetsdn/%{srcname}/archive/v%{version}.tar.gz Source1: rpmify-requirements-files.py # Support msgpack 1.0.0 and later. # https://github.com/faucetsdn/ryu/pull/122 Patch0: %{name}-4.34-msgpack-1.0.patch # Fix TLS on Python 3.7+ # https://github.com/faucetsdn/ryu/pull/100 Patch1: %{name}-4.34-pr-100.patch # Fix a SyntaxWarning # https://github.com/faucetsdn/ryu/pull/106 Patch2: %{name}-4.34-pr-106.patch BuildArch: noarch %global common_description %{expand: Ryu is a component-based software defined networking framework. Ryu provides software components with well defined API that make it easy for developers to create new network management and control applications. Ryu supports various protocols for managing network devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow, Ryu supports fully 1.0, 1.2, 1.3, 1.4, 1.5 and Nicira Extensions. Ryu means “flow” in Japanese. Ryu is pronounced “ree-yooh.”} %description %{common_description} %package -n python3-%{srcname} Summary: %{summary} %if 0%{?fedora} && 0%{?fedora} < 33 %py_provides python3-%{srcname} Provides: python-%{srcname}-common = %{version}-%{release} Obsoletes: python-%{srcname}-common < 4.29-2 %endif BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(packaging) BuildRequires: pyproject-rpm-macros # For rpmify-requirements-files.py: BuildRequires: %{_rpmconfigdir}/pythondistdeps.py # fedpkg prep && # python3 rpmify-requirements-files.py ryu-[0-9]*/tools/optional-requires | # awk '{ printf("Recommends: %s\n", $0) }' Recommends: (python3dist(cryptography) < 1.5.2 or python3dist(cryptography) > 1.5.2) Recommends: ((python3dist(lxml) < 3.7 or python3dist(lxml) > 3.7) with python3dist(lxml) >= 2.3) %if %{with ncclient} Recommends: python3dist(ncclient) %endif Recommends: python3dist(paramiko) Recommends: python3dist(sqlalchemy) >= 1.0.10 %description -n python3-%{srcname} %{common_description} %generate_buildrequires %pyproject_buildrequires -r # Additional requires that pyproject_buildrequires cannot find (even if we gave # it -t to let it try to handle tox.ini): %{__python3} %{SOURCE1} \ tools/doc-requires \ %{?with_ncclient:tools/}%{?!with_ncclient:filtered-}optional-requires \ tools/test-requires %package doc Summary: Documentation for Ryu BuildRequires: make %description doc Documentation for Ryu %prep %autosetup -n %{srcname}-%{version} -p1 # Loosen SQLAlchemy version requirement by removing the maximum version; Fedora # will not be providing old versions, and something is better than nothing! sed -i -r 's/^(SQLAlchemy>.*),[[:blank:]]*<.*$/\1/' tools/optional-requires %if %{without ncclient} sed -r '/ncclient/d' tools/optional-requires > filtered-optional-requires %endif %build %pyproject_wheel make -C doc man html %install %pyproject_install %pyproject_save_files %{srcname} install -d %{buildroot}%{_sysconfdir}/%{srcname} mv %{buildroot}%{_prefix}%{_sysconfdir}/%{srcname}/%{srcname}.conf \ %{buildroot}%{_sysconfdir}/%{srcname}/%{srcname}.conf install -d %{buildroot}%{_mandir}/man8 install -t %{buildroot}%{_mandir}/man8 -m 0644 -p doc/build/man/*.8 %check # TODO: There are still SSL/TLS problems. PYTHON=%{__python3} ./run_tests.sh \ --no-virtual-env --no-pycodestyle --verbose || : %files -n python3-%{srcname} -f %{pyproject_files} %license LICENSE %{_bindir}/%{srcname} %{_bindir}/%{srcname}-manager %{_mandir}/man8/%{srcname}.8* %{_mandir}/man8/%{srcname}-manager.8* %dir %{_sysconfdir}/%{srcname} %config(noreplace) %{_sysconfdir}/%{srcname}/%{srcname}.conf %files doc %license LICENSE %doc CONTRIBUTING.rst %doc README.rst %doc doc/build/html %changelog * Wed Jan 27 2021 Fedora Release Engineering - 4.34-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Tue Dec 29 2020 Benjamin A. Beasley - 4.34-1 - Update to 4.34 - Add BR on make - Add patch for msgpack 1.0 compatibility - Add patch for TLS support in Python 3.7+ - Add patch for SyntaxWarning * Tue Dec 29 2020 Benjamin A. Beasley - 4.29-13 - Change pypi_name macro to srcname - Drop EL7 Python 2 support macros - Fix License field, changing Apache-2.0 to ASL 2.0 - Fix outdated URL - Use pypi_source macro - Update description from upstream - Use generated BR’s and Requires wherever possible - Stop removing requires files - Add missing LICENSE file - Build HTML documentation and add a -doc subpackage - Add Recommends for optional dependencies - Properly mark config file as such, and own the config file directory - Actually install man pages - No longer conditionalize check section/tests; a few still fail * Sat Aug 01 2020 Fedora Release Engineering - 4.29-12 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Wed Jul 29 2020 Fedora Release Engineering - 4.29-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Tue May 26 2020 Miro Hrončok - 4.29-10 - Rebuilt for Python 3.9 * Thu Apr 02 2020 Björn Esser - 4.29-9 - Fix string quoting for rpm >= 4.16 * Thu Jan 30 2020 Fedora Release Engineering - 4.29-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Thu Jan 09 2020 Alfredo Moralejo - 4.29-7 - Removed pep8 as BR * Thu Oct 03 2019 Miro Hrončok - 4.29-6 - Rebuilt for Python 3.8.0rc1 (#1748018) * Mon Aug 19 2019 Miro Hrončok - 4.29-5 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 4.29-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 4.29-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Mon Oct 22 2018 Miro Hrončok - 4.29-2 - Remove python2 subpackage on Fedora (#1638709) * Sun Sep 30 2018 Slawek Kaplonski 4.29-1 - Update to 4.29 * Thu Aug 16 2018 Slawek Kaplonski 4.27-2 - Stop removing integration tests code before build, it requires docker to run properly but it shouldn't be run if docker is not available on build machine * Tue Aug 07 2018 Slawek Kaplonski 4.27-1 - Update to 4.27 * Sat Jul 14 2018 Fedora Release Engineering - 4.25-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Tue Jul 03 2018 Alan Pevec 4.25-1 - Update to 4.25 * Tue Jun 19 2018 Miro Hrončok - 4.15-4 - Rebuilt for Python 3.7 * Mon Mar 26 2018 Iryna Shcherbina - 4.15-3 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Fri Feb 09 2018 Fedora Release Engineering - 4.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Jul 27 2017 Alan Pevec 4.15-1 - Update to 4.15 * Thu Jul 27 2017 Fedora Release Engineering - 4.13-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Mon May 29 2017 Lumír Balhar - 4.13-2 - Tests enabled * Mon May 29 2017 Alan Pevec 4.13-1 - Update to 4.13 - Add missing dependencies * Sat Feb 11 2017 Fedora Release Engineering - 4.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 4.3-5 - Rebuild for Python 3.6 * Wed Sep 07 2016 Arie Bregman - 4.3-4 - Moved tests related lines to depend on with_check * Tue Jul 19 2016 Fedora Release Engineering - 4.3-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Fri Jul 01 2016 Matthias Runge - 4.3-2 - add python_provides for python2 package * Thu Jun 23 2016 Haïkel Guémar - 4.3-1 - Upstream 4.3 - Enable python3 subpackage * Thu Apr 7 2016 Haïkel Guémar - 3.30-1 - Upstream 3.30 * Thu Feb 04 2016 Fedora Release Engineering - 3.26-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sun Nov 22 2015 Arie Bregman - 3.26-1 - Initial package.