diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index e0f9c44..af6936a 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -17,4 +17,4 @@ jobs: - name: Build tarball run: make tarball - name: Build rpm file - run: rpmbuild -ba netoik-rp.spec + run: rpmbuild -ba %(make name).spec diff --git a/Makefile b/Makefile index 0f950ed..9ddc139 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,9 @@ build_arch: .PHONY: install install: - install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres + install --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres $(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d install --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/nginx/default.conf + install --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d filrs/systemd/postgres.conf $(RPM_TARBALL_PATH): * git archive --format=tar.gz \ diff --git a/files/systemd/postgres.conf b/files/systemd/postgres.conf new file mode 100644 index 0000000..2bb81bb --- /dev/null +++ b/files/systemd/postgres.conf @@ -0,0 +1,2 @@ +[Service] +ExecStart=/usr/bin/postgres -D ${PGDATA} -c config_file=/etc/postgres/postgresql.conf diff --git a/netoik-db.spec b/netoik-db.spec new file mode 100644 index 0000000..2cd5b25 --- /dev/null +++ b/netoik-db.spec @@ -0,0 +1,37 @@ +%define debug_package %{nil} + +Name: %(make name) +Version: %(make version) +Release: %(make release) +Summary: Netoik Reverse Proxy +License: MIT +URL: https://git.netoik.io/samuel/netoik-rp + +Source0: %{name}-%{version}.tar.gz +Buildarch: %(make build_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 +# Restart services +systemctl daemon-reload +systemctl reenable --now postgresql.service + +%files +%attr(755, root, root) %{_sysconfdir}/postgres +%attr(644, root, root) %{_sysconfdir}/postgres/postgresql.conf +%attr(644, root, root) %{_sysconfdir}/postgres/pg_hba.conf +%attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf + +%changelog +%autochangelog +