File postgresql-init.spec of Package postgresql-init

# spec file for package postgresql-init
# 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

Summary:        Init script and other infrastructure for PostgreSQL
License:        PostgreSQL
Group:          Productivity/Databases/Servers

Name:           postgresql-init
Version:        9.4
Release:        0
Source0:        postgresql-init
Source1:        postgresql-sysconfig
Source2:        postgresql-firewall
Source3:        postgresql-tmpfiles.conf
BuildRequires:  pwdutils
BuildRequires:  systemd
Requires(pre):  pwdutils
Requires(post): %fillup_prereq
Requires(postun): %insserv_prereq
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%if 0%{?suse_version} > 1100
    %define fwdir /etc/sysconfig/SuSEfirewall2.d/services
    %define fwname postgresql
    %define fwdir /etc/sysconfig/scripts
    %define fwname SuSEfirewall2-postgresql

This package contains the init script, sysconfig template and firewall
service file for the PostgreSQL server. It was separated from the
postgresql*-server binary package to allow parallel installation of
several server versions.



install -m755 -d %buildroot/etc/init.d
install -m755 %{S:0} %buildroot/etc/init.d/postgresql

install -m755 -d %buildroot/var/adm/fillup-templates
install -m644 %{S:1} %buildroot/var/adm/fillup-templates/sysconfig.postgresql

install -m755 -d %buildroot%fwdir
install -m644 %{S:2} %buildroot%fwdir/%fwname

install -m755 -d %buildroot/%_tmpfilesdir
install -m644 %{S:3} %buildroot%_tmpfilesdir/postgresql.conf

install -m755 -d %buildroot/usr/sbin
ln -sf /etc/init.d/postgresql %buildroot/usr/sbin/rcpostgresql

groupadd -g 26 -o -r postgres >/dev/null 2>/dev/null || :
useradd -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
	-c "PostgreSQL Server" -u 26 postgres 2>/dev/null || :

%fillup_only -n postgresql
systemd-tmpfiles --create postgresql.conf
test -x /bin/systemctl && /bin/systemctl daemon-reload || :

%stop_on_removal postgresql

test -x /bin/systemctl && /bin/systemctl daemon-reload || :

%config /etc/init.d/postgresql
%dir %fwdir
%config %fwdir/%fwname

openSUSE Build Service is sponsored by