File gufw.spec of Package gufw

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


Name:           gufw 
Version:        16.04.0 
Release:        0
Summary:        Uncomplicated Firewall
License:        GPL-3.0
Group:          Productivity/Networking/Security
Url:            http://gufw.org/
Source0:        https://launchpad.net/gui-ufw/16.04/16.04/+download/gui-ufw-%{version}.tar.gz 
BuildArch:      noarch

BuildRequires:  autoconf
BuildRequires:  fdupes
BuildRequires:  intltool
BuildRequires:  python-devel
BuildRequires:  python-distutils-extra
BuildRequires:  python-netifaces
BuildRequires:  update-desktop-files
Requires:       dbus-1-python
Requires:       girepository-1_0
Requires:       gufw-lang
Requires:       notification-daemon
Requires:       python-distutils-extra
Requires:       python-gobject >= 3.0.1
Requires:       python-netifaces
Requires:       typelib-1_0-WebKit-3_0
Requires:       ufw
Recommends:     %{name}-lang

%description
An easy, intuitive, way to manage your Linux firewall. It supports common tasks such as allowing or blocking pre-configured, common p2p, or individual ports port(s), and many others!

%lang_package

%prep
%setup -q -n gui-ufw-%{version}
#Submited patch through ufw's bug report
#Fix directory locations instead of #CONFIG_PREFIX#
#http://bugs.launchpad.net/ufw/+bug/819600
%build

%install
python setup.py install --prefix=%{_prefix} \
--root %{buildroot}
rm %{buildroot}%{python_sitelib}/gufw/model/__init__.py
rm %{buildroot}%{python_sitelib}/gufw/view/__init__.py
rm %{buildroot}%{python_sitelib}/gufw/model/__init__.pyc
rm %{buildroot}%{python_sitelib}/gufw/view/__init__.pyc
chmod 755 %{buildroot}%{python_sitelib}/gufw/gufw.py
chmod 755 %{buildroot}%{python_sitelib}/gufw/model/ufw_backend.py
%suse_update_desktop_file -r gufw System Security
%find_lang gufw
%fdupes %{buildroot}

%post
cp %{python_sitelib}/gufw/__init__.py %{python_sitelib}/gufw/model/__init__.py
cp %{python_sitelib}/gufw/__init__.py %{python_sitelib}/gufw/view/__init__.py
%desktop_database_post

%postun
%desktop_database_postun

%files 
%defattr(-,root,root)
%doc COPYING.GPL3
%dir %{_sysconfdir}/gufw/app_profiles
%config %{_sysconfdir}/gufw/app_profiles/*
%{_bindir}/gufw
%{_bindir}/gufw-pkexec
%{python_sitelib}/gufw-%{version}-py%python_version.egg-info
%{python_sitelib}/gufw/__init__.py
%{python_sitelib}/gufw/__init__.pyc
%{python_sitelib}/gufw/controller.py
%{python_sitelib}/gufw/controller.pyc
%{python_sitelib}/gufw/gufw.py
%{python_sitelib}/gufw/gufw.pyc
%{_datadir}/applications/gufw.desktop
%{_datadir}/doc/gufw/README
%{_datadir}/gufw/ui/add.ui
#%{_datadir}/gufw/ui/main.ui
%{_datadir}/gufw/ui/preferences.ui
%{_datadir}/icons/hicolor/48x48/apps/gufw.png
%{_datadir}/man/man8/gufw.8.gz
%{_datadir}/polkit-1/actions/com.ubuntu.pkexec.gufw.policy
%{python_sitelib}/gufw
%{python_sitelib}/gufw/model
%{python_sitelib}/gufw/view
%{_datadir}/doc/gufw
%{_datadir}/gufw
%{_datadir}/gufw/media
%{_datadir}/gufw/ui
%{_datadir}/icons/hicolor
%{_datadir}/icons/hicolor/48x48
%{_datadir}/icons/hicolor/48x48/apps
%{_sysconfdir}/gufw
%{_datadir}/polkit-1
%{_datadir}/polkit-1/actions

%files lang -f gufw.lang
%defattr(-,root,root,-)

%changelog