Files
netoik-db/netoik-db.spec
samuel 36d936f5de
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 39s
fix: add init cluster
2026-04-04 07:20:48 +02:00

48 lines
1.2 KiB
RPMSpec

%define debug_package %{nil}
Name: %(make name)
Version: %(make version)
Release: %(make release)
Summary: %(make summary)
License: %(make license)
URL: %(make url)
Source0: %(make source0)
Buildarch: %(make arch)
BuildRequires: make
Requires: postgresql-server postgresql
%description
Install the database management system called postgresql with a predefined configuration and unix-base authentications.
%prep
%autosetup -v
%install
%make_install
%post
# Create sock directory if not existing
chown postgres:postgres "%{_rundir}/postgresql"
# Init cluster if necessary
runuser --user=postgres -- if [ ! -d $PGDATA ]; then postgresql-setup --initdb; fi
# Restart services
systemctl daemon-reload
systemctl reenable postgresql.service
systemctl restart postgresql.service
%files
%dir %attr(755, root, root) %{_sysconfdir}/postgres
%attr(644, root, root) %{_sysconfdir}/postgres/postgresql.conf
%attr(644, root, root) %{_sysconfdir}/postgres/pg_hba.conf
%dir %attr(755, root, root) %{_unitdir}/postgresql.service.d
%attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf
%dir %attr(755, -, -) %{_rundir}/postgresql
%changelog
%autochangelog