File gns3-server.spec of Package gns3-server

#
# spec file for package gns3-server
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%if %{undefined suse_version}

# get python versions
%global py3_ver %(if [ -f "%{__python3}" ]; then %{__python3} -c "import sys; sys.stdout.write(sys.version[:3])"; else echo 0; fi;)

%endif

Name:           gns3-server
Summary:        GNS3 is a graphical network simulator
License:        GPL-3.0+
Group:          Productivity/Networking/Other
Version:        1.3.1
Release:        0
Url:            http://www.gns3.net/
Source0:        %{name}-%{version}.tar.gz
BuildRequires:  python3-devel >= 3.3
BuildRequires:  python3-netifaces
BuildRequires:  python3-pip
BuildRequires:  python3-setuptools
Requires:       cpulimit
Requires:       dynamips >= 0.2.11
Requires:       iouyap
Requires:       python3-Jinja2 >= 2.7.3
Requires:       python3-aiohttp
Requires:       python3-jsonschema >= 2.3.0
Requires:       python3-netifaces
Requires:       python3-raven
Requires:       qemu
Requires:       vpcs >= 0.5b1
Requires:       wireshark
%if 0%{?suse_version}
Recommends:     virtualbox
%endif
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The GNS3 server manages emulators such as Dynamips, VirtualBox or Qemu/KVM.
Clients like the GNS3 GUI controls the server using a JSON-RPC API over Websockets.

You will need the new GNS3 GUI (gns3-gui repository) to control the server.

%prep
%setup -q

%build
python3 setup.py build

%install
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}
chmod +x %{buildroot}/%{python3_sitelib}/gns3server/main.py
chmod +x %{buildroot}/%{python3_sitelib}/gns3server/modules/iou/ioucon.py
rm -rf %{buildroot}/%{python3_sitelib}/tests

%files
%defattr(-, root, root, 0755)
%doc AUTHORS LICENSE README.rst
%{_bindir}/gns3server
%{_bindir}/gns3dms
%{python3_sitelib}/gns3server
%{python3_sitelib}/gns3_server-%{version}-py%{py3_ver}.egg-info

%changelog