File firewalld.spec of Package firewalld

#
# spec file for package firewalld
#
# Copyright (c) 2018 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/
#


#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
  %define _fillupdir /var/adm/fillup-templates
%endif

%define _name firewalld

Name:           python-firewall
Version:        0.5.2
Release:        0
Summary:        A firewall daemon with D-Bus interface providing a dynamic firewall
License:        GPL-2.0-or-later
Group:          Productivity/Networking/Security
Url:            http://www.firewalld.org
Source:         https://github.com/%{_name}/%{_name}/archive/v%{version}.tar.gz#/%{_name}-%{version}.tar.gz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  desktop-file-utils
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  fdupes
# Adding tools to BuildRequires as well so they can be autodetected
# even though it is probably unlikely for paths to change in the future
BuildRequires:  ebtables
BuildRequires:  gettext
BuildRequires:  glib2-devel
BuildRequires:  gobject-introspection
BuildRequires:  hicolor-icon-theme
BuildRequires:  intltool
BuildRequires:  ipset
BuildRequires:  iptables
BuildRequires:  libxslt-tools
BuildRequires:  python-devel
BuildRequires:  systemd-rpm-macros
Requires:       ebtables
Requires:       ipset
Requires:       iptables
Requires:       python-firewall = %{version}
Requires:       sysconfig
Requires(post): %fillup_prereq
Recommends:     %{_name}-lang
Suggests:       susefirewall2-to-firewalld
BuildArch:      noarch
%{?systemd_requires}

Requires:       dbus-1-python
Requires:       python-decorator
Requires:       python-gobject
Requires:       python-slip-dbus

%description
The python bindings for firewalld.


%prep
%setup -q -n %{_name}-%{version}

# bsc#1078223
rm config/services/high-availability.xml

%build
export PYTHON="python"
sed -i "s|/usr/bin/python -Es|/usr/bin/python -Es|g" fix_python_shebang.sh
sed -i "s|python|python|g" config/lockdown-whitelist.xml
./autogen.sh
%configure \
  --enable-sysconfig \
  --enable-rpmmacros \
  --with-ifcfgdir="/etc/sysconfig/network"

# Normally documentation is shipped but this will ensure that missing
# files will be generated.
make %{?_smp_mflags}

%install
%make_install

%py_compile %{buildroot}

# remove files that shouldn't exist in the final rpms
rm -rf %{buildroot}%{_datadir}/%{_name}/__pycache__
rm -rf %{buildroot}%{_sysconfdir}
rm -rf %{buildroot}%{_sysconfdir}/xdg/autostart/firewall-applet.desktop
rm -rf %{buildroot}%{_datadir}/icons
rm -rf %{buildroot}%{_mandir}
rm -rf %{buildroot}%{_bindir}
rm -rf %{buildroot}%{_sbindir}
rm -rf %{buildroot}%{_datadir}/firewalld
rm -rf %{buildroot}%{_datadir}/locale
rm -rf %{buildroot}%{_datadir}/polkit-1
rm -rf %{buildroot}%{_datadir}/appdata
rm -rf %{buildroot}%{_datadir}/applications
rm -rf %{buildroot}%{_datadir}/glib-2.0
rm -rf %{buildroot}%{_datadir}/bash-completion
rm -rf %{buildroot}%{_libexecdir}/firewalld
rm -rf %{buildroot}%{_libexecdir}/systemd
rm -rf %{buildroot}%{_libexecdir}/rpm

%fdupes %{buildroot}%{python_sitelib}


%files
%attr(0755,root,root) %dir %{python_sitelib}/firewall
%attr(0755,root,root) %dir %{python_sitelib}/firewall/config
%attr(0755,root,root) %dir %{python_sitelib}/firewall/core
%attr(0755,root,root) %dir %{python_sitelib}/firewall/core/io
%attr(0755,root,root) %dir %{python_sitelib}/firewall/server
%{python_sitelib}/firewall/*.py*
%{python_sitelib}/firewall/config/*.py*
%{python_sitelib}/firewall/core/*.py*
%{python_sitelib}/firewall/core/io/*.py*
%{python_sitelib}/firewall/server/*.py*
openSUSE Build Service is sponsored by