File HANA-Firewall.spec of Package HANA-Firewall.5492

#
# spec file for package HANA-Firewall
#
# 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:           HANA-Firewall
Version:        1.1.5
Release:        0
License:        GPL-2.0+
Summary:        Set up system firewall for SAP HANA database
Url:            https://gitlab.suse.de/SLES4SAP/HANA-Firewall
Group:          Productivity/Networking/Security
Source0:        %{name}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
Requires:      perl-base iptables iproute2 SuSEfirewall2
%{?systemd_requires}

%description
A utility program that manages system firewall configuration for SAP HANA systems running on this host.

Authors:
--------
    MGuertler@suse.com
    varkoly@suse.com
    hguo@suse.com

%prep
%setup -q

%build
gzip hana-firewall.8

%install
mkdir -p %{buildroot}%{_sbindir}/
install -m 0755 hana-firewall %{buildroot}%{_sbindir}/

mkdir -p %{buildroot}%{_unitdir}/
install -m 0644 hana-firewall.service %{buildroot}%{_unitdir}/
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rchana-firewall

mkdir -p %{buildroot}/var/adm/fillup-templates/
install -m 0644 sysconfig.hana-firewall %{buildroot}/var/adm/fillup-templates/

install -d -m 0755 %{buildroot}%{_sysconfdir}/hana-firewall.d
cp -R hana-firewall.d/* %{buildroot}%{_sysconfdir}/hana-firewall.d/
# Service definitions should carry permission 644 and script should carry 755
chmod 644  %{buildroot}%{_sysconfdir}/hana-firewall.d/*
chmod 755  %{buildroot}%{_sysconfdir}/hana-firewall.d/create_new_service

mkdir -p %{buildroot}%{_mandir}/man8/
install -m 0644 hana-firewall.8.gz %{buildroot}%{_mandir}/man8/

%pre
%service_add_pre hana-firewall.service

%post
%service_add_post hana-firewall.service
%fillup_only -n hana-firewall

%preun
%service_del_preun hana-firewall.service

%postun
%service_del_postun hana-firewall.service

%files
%defattr(-,root,root)
%config %{_sysconfdir}/hana-firewall.d/
%{_sbindir}/hana-firewall
%{_sbindir}/rchana-firewall
%{_unitdir}/hana-firewall.service
%{_mandir}/man8/hana-firewall.8.gz
/var/adm/fillup-templates/sysconfig.hana-firewall

%changelog
openSUSE Build Service is sponsored by