Files
mininet/mininet.spec
Erico Mendonca d614d436f2 Accepting request 1063638 from home:emendonca:branches:network
- Update to upstream 2.3.0 (yes, 2.3.0 is newer than 2.3.0d6 for upstream):
  * adds better Python 3 compatibility
  * updated PIP URL
  * removed unencrypted git protocol use
- With the upgrade to 2.3.0d6 obsoleted these patches:
  * mininet-2.2.1-private-mount.patch
  * mininet-2.2.1-fallback-to-ovs-testcontroller.patch
  * mininet-2.2.1-add-ovs-testcontroller.patch
  * mininet-2.2.1-default-ofport.patch
- Rename back to mininet as it is simple tool only
- Build with just python3 in mind
- Upgraded to version 2.3.0d6.
- Removed previous patches, as they seem to have been merged upstream.
- SPEC remade to conform to python single-spec.
- Enabled tests (but they seem to required a root user).
- Adjust openvswitch dependencies since the openvswitch and openvswitch-dpdk
  packages have been merged into a single 'openvswitch' package.
- Use the openvswitch capabilities as dependencies to accept the
  openvswitch-dpdk packages as well.
- Cherry-pick upstream patches (and one from PR) to fix compatibility
  with latest OVS releases.
  * Add mininet-2.2.1-add-ovs-testcontroller.patch: Take renamed
    ovs-testcontroller into consideration when checking for existing
    OVS controllers.
  * Add mininet-2.2.1-fallback-to-ovs-testcontroller: Fixes previous
    upstream patch to use the ovs-testcontroller if it's present.
  * Add mininet-2.2.1-default-ofport: Adds support for the new OpenFlow
    port if the controller listens to it.
- Initial commit of version 2.2.1
  * Add upstream mininet-2.2.1-private-mount.patch: Fixes mounts
    with newer systemd

OBS-URL: https://build.opensuse.org/request/show/1063638
OBS-URL: https://build.opensuse.org/package/show/network/mininet?expand=0&rev=14
2023-02-07 14:50:43 +00:00

81 lines
2.6 KiB
RPMSpec

#
# spec file for package mininet
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: mininet
Version: 2.3.0
Release: 0
Summary: Network emulator for rapid prototyping of Software Defined Networks (SDN)
# mininet is MIT and util/sch_htb-ofbuf/sch_htb.c is GPL-2.0+
License: MIT AND GPL-2.0-or-later
Group: Productivity/Networking/Other
URL: http://mininet.org
Source0: https://github.com/mininet/mininet/archive/%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: help2man
BuildRequires: python-rpm-macros
BuildRequires: python3-setuptools
Requires: ethtool
Requires: iperf
Requires: iproute2
Requires: openvswitch
Requires: socat
Requires: telnet
# In case we do not have a controller already.
Suggests: openvswitch-test
%description
Mininet emulates a complete network of hosts, links, and switches on a single
machine. Mininet is useful for interactive development, testing, and demos, especially
those using OpenFlow and SDN. OpenFlow-based network controllers prototyped in
Mininet can usually be transferred to hardware with minimal changes for full
line-rate execution.
%prep
%setup -q -n mininet-%{version}
# remove shebang to make rpmlint happy
sed -i "/#\!\/usr\/bin\/env python$/d" mininet/topo.py
# fix the shebangs
sed -i "s/#\!\/usr\/bin\/env python$/\#\!\/usr\/bin\/python3/g" examples/*py
# add missing shebangs
sed -i "1s/^/\#\!\/usr\/bin\/python3\n/" mininet/examples/__init__.py
%build
make %{?_smp_mflags} CFLAGS="%{optflags}" man mnexec PYTHON=%{_bindir}/python3
%python3_build
%install
%python3_install
%fdupes %{buildroot}%{python3_sitelib}
install -Dm 644 mn.1 %{buildroot}%{_mandir}/man1/mn.1
install -Dm 644 mnexec.1 %{buildroot}%{_mandir}/man1/mnexec.1
install -Dm 755 mnexec %{buildroot}%{_bindir}/mnexec
%files
%license LICENSE
%doc README.md
%{_bindir}/mn
%{_mandir}/man1/mn.1%{?ext_man}
%{_bindir}/mnexec
%{_mandir}/man1/mnexec.1%{?ext_man}
%{python3_sitelib}/*
%changelog