File saprouter-systemd.spec of Package saprouter-systemd
#
# Spec file SAP Network Interface Router
#
# Copyright (c) 2016 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
Name: saprouter-systemd
Summary: Integration of SAP Network Interface Router into systemd
License: GPL-2.0
Version: 0.2
Release: 0
Group: Applications/System
Vendor: SUSE GmbH
BuildArch: noarch
Source0: setup-saprouter.sh
Source1: saprouter.service
Source2: sysconfig.saprouter
URL: http://www.suse.com
BuildRequires: systemd-rpm-macros
BuildRequires: shadow
Requires: shadow
Requires: /bin/sh
%{?systemd_requires}
%description
SAP Network Interface Router integration into systemd so it can be handled as system service.
%prep
%build
%install
mkdir -p %buildroot/usr/sbin/
install -m 755 %{S:0} %buildroot/usr/sbin/
mkdir -p %{buildroot}%{_unitdir}
%__install -D -m 444 %{S:1} %{buildroot}%{_unitdir}/saprouter.service
mkdir -p %{buildroot}/%{_fillupdir}/
install -m 0644 %{S:2} %{buildroot}/%{_fillupdir}/
mkdir -p %buildroot/var/lib/saprouter
ln -s /sbin/service %buildroot/usr/sbin/rcsaprouter
%clean
%post
%fillup_only -n saprouter
%service_add_post saprouter.service
useradd -d /var/lib/saprouter -s /bin/false saprouter || true
groupadd saprouter || true
chown -R saprouter:saprouter /var/lib/saprouter
/usr/sbin/setup-saprouter.sh
%pre
%service_add_pre saprouter.service
%preun
%service_del_preun saprouter.service
%postun
%service_del_postun saprouter.service
%files
%{_unitdir}/saprouter.service
/usr/sbin/setup-saprouter.sh
/usr/sbin/rcsaprouter
%dir /var/lib/saprouter
%config %{_fillupdir}/sysconfig.saprouter
%changelog