File gns3.spec of Package gns3

# spec file for package gns3
# 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

%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;)


Name:           gns3
Summary:        A graphical network simulator
License:        GPL-3.0+
Group:          Productivity/Networking/Other
Version:        1.3.1
Release:        0
Source0:        %{name}-gui-%{version}.tar.gz
Source1:        %{name}.png
Source2:        %{name}.xml
Source3:        %{name}.desktop
Source4:        application-x-%{name}.png
Patch0:         %{name}-1.3.0-requires.patch
BuildArch:      noarch
BuildRequires:  desktop-file-utils
BuildRequires:  python3-devel >= 3.3
BuildRequires:  python3-pip
BuildRequires:  python3-qt4-devel
BuildRequires:  python3-setuptools
%if %{defined suse_version}
BuildRequires:  update-desktop-files
Requires:       gns3-converter
Requires:       gns3-server
Requires:       gns3-server = %{version}
Requires:       python3-apache-libcloud >= 0.14.1
Requires:       python3-configobj
Requires:       python3-paramiko
Requires:       python3-qt4
Requires:       python3-raven
Requires:       python3-requests
Requires:       python3-sip
Provides:       gns3-gui > %{version}
Obsoletes:      gns3-gui <= %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

GNS3 is a excellent complementary tool to real labs for administrators
of Cisco networks or people wanting to pass their CCNA,
CCNP, CCIP or CCIE certifications.

It can also be used to experiment features of Cisco IOS or to check configurations
that need to be deployed later on real routers.

Important notice: users must provide their own Cisco IOS to use GNS3.

%setup -q -n %{name}-gui-%{version}
%patch0 -p1

python3 build

python3 install --root=%{buildroot} --prefix=%{_prefix}
chmod +x %{buildroot}/%{python3_sitelib}/%{name}/
find %{buildroot}/%{python3_sitelib}/%{name} -name "*.ui" -exec chmod -x {} \;

mkdir -p %buildroot/%{_datadir}/pixmaps
mkdir -p %buildroot/%{_datadir}/mime/packages
mkdir -p %buildroot/%{_datadir}/applications
mkdir -p %buildroot/%{_datadir}/icons/hicolor/48x48/mimetypes
%__cp %SOURCE1 %buildroot/%{_datadir}/pixmaps
%__cp %SOURCE2 %buildroot/%{_datadir}/mime/packages/
%__cp %SOURCE3 %buildroot/%{_datadir}/applications/
%__cp %SOURCE4 %buildroot/%{_datadir}/icons/hicolor/48x48/mimetypes/
rm -rf %{buildroot}/%{python3_sitelib}/tests

/usr/bin/update-mime-database %{_datadir}/mime > /dev/null 2>&1 || :

/usr/bin/update-mime-database %{_datadir}/mime > /dev/null 2>&1 || :

%defattr(-, root, root, 0755)
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/48x48
%dir %{_datadir}/icons/hicolor/48x48/mimetypes

openSUSE Build Service is sponsored by