File pdns-common.spec of Package pdns-common

# spec file for package pdns-common
# Copyright (c) 2016 SUSE LINUX Products 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

# norootforbuild
%if 0%{?suse_version} > 1230
%bcond_without systemd
%define  _localstatedir /run/pdns
%bcond_with    systemd
%define  _localstatedir /var/run/pdns

%define home           %{_var}/lib/pdns

%{!?_tmpfilesdir: %global _tmpfilesdir /usr/lib/tmpfiles.d }

Name:           pdns-common
Version:        4.0
Release:        0
License:        MIT
Summary:        Shared directories between PowerDNS Packages
Group:          Productivity/Networking/DNS/Servers
Source:         pdns-common.tmpfiles.d
BuildArch:      noarch
%if %{with systemd}
BuildRequires:  pkgconfig(systemd)
%if 0%{?suse_version}
PreReq:         pwdutils
PreReq:         shadow-utils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Shared directories between PowerDNS Packages



install -Dd -m 0755 %{buildroot}%{home}
install -Dd -m 0755 %{buildroot}%{_sysconfdir}/pdns

%if %{with systemd}
install -D    -m 0644 %{SOURCE0} %{buildroot}%{_tmpfilesdir}/%{name}.conf
install -D -d -m 0750 %{buildroot}%{_localstatedir}

/usr/sbin/groupadd -r pdns >/dev/null 2>&1 || :
/usr/sbin/useradd -g pdns -s /bin/false -r -c "PowerDNS" -d %{home} pdns >/dev/null 2>&1 || :

%if %{with systemd}
systemd-tmpfiles --create /usr/lib/tmpfiles.d/%{name}.conf ||:

%if %{with systemd}
%dir %attr(750,pdns,pdns) %ghost %{_localstatedir}/
%dir %attr(750,pdns,pdns)        %{_localstatedir}/
%dir %attr(750,root,pdns)        %{_sysconfdir}/pdns/
%dir %attr(750,pdns,pdns)        %{home}/