8 Commits

Author SHA1 Message Date
6e7ffeda5e doc: update repo owner
All checks were successful
Continuous Integration / lint_n_build (push) Successful in 33s
2026-04-19 14:30:51 +02:00
7b292d218b ci: change owner
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 26s
2026-04-19 13:14:16 +02:00
25b9b02df2 fix: setup command
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 26s
2026-04-04 07:34:12 +02:00
2c39bf1158 fix: check file in PGDATA
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 31s
2026-04-04 07:25:38 +02:00
36d936f5de fix: add init cluster
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 39s
2026-04-04 07:20:48 +02:00
277a540d94 doc: add search in dnf command 2026-04-04 07:05:28 +02:00
b9accfedd2 doc: remove env file from readme 2026-03-08 23:09:15 +01:00
8a8da6a7be fix: add run postgresql folder to rpmspec files
All checks were successful
Continuous Delivery / build_n_upload (push) Successful in 39s
2026-03-08 22:58:10 +01:00
3 changed files with 12 additions and 10 deletions

View File

@@ -2,13 +2,14 @@ NAME = netoik-db
VERSION = $(shell git describe --abbrev=0) VERSION = $(shell git describe --abbrev=0)
RELEASE = $(shell git rev-parse --short HEAD) RELEASE = $(shell git rev-parse --short HEAD)
ARCH = noarch ARCH = noarch
OWNER = samuel OWNER = netoik
SUMMARY = "Netoïk Database Management System" SUMMARY = "Netoïk Database Management System"
LICENSE = "MIT" LICENSE = "MIT"
URL = "https://git.netoik.io/$(OWNER)/$(NAME)" URL = "https://git.netoik.io/$(OWNER)/$(NAME)"
SOURCE0 = "$(NAME)-$(VERSION)-$(RELEASE).tar.gz" SOURCE0 = "$(NAME)-$(VERSION)-$(RELEASE).tar.gz"
RPM_RPMDIR = $(shell rpm --eval '%{_rpmdir}') RPM_RPMDIR = $(shell rpm --eval '%{_rpmdir}')
RPM_RUNDIR = $(shell rpm --eval '%{_rundir}')
RPM_SBINDIR = $(shell rpm --eval '%{_sbindir}') RPM_SBINDIR = $(shell rpm --eval '%{_sbindir}')
RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}') RPM_SOURCEDIR = $(shell rpm --eval '%{_sourcedir}')
RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}') RPM_SYSCONFDIR = $(shell rpm --eval '%{_sysconfdir}')
@@ -73,7 +74,7 @@ install: ## Install files into rpm dest (requires env var DESTDIR)
printf "[CRITICAL] Missing env var DESTDIR\n[CRITICAL] This command is designed to be called by rpmbuild only!\n" 1>&2; \ printf "[CRITICAL] Missing env var DESTDIR\n[CRITICAL] This command is designed to be called by rpmbuild only!\n" 1>&2; \
exit 1; \ exit 1; \
fi fi
install --mode=755 --directory $(DESTDIR)$(RPM_SYSCONFDIR)/postgres $(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d install --mode=755 --directory $(DESTDIR)$(RPM_RUNDIR)/postgresql $(DESTDIR)$(RPM_SYSCONFDIR)/postgres $(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d
install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/postgres/pg_hba.conf install --mode=644 --target-directory=$(DESTDIR)$(RPM_SYSCONFDIR)/postgres files/postgres/postgresql.conf files/postgres/pg_hba.conf
install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d files/systemd/postgres.conf install --mode=644 --target-directory=$(DESTDIR)$(RPM_UNITDIR)/postgresql.service.d files/systemd/postgres.conf

View File

@@ -1,4 +1,4 @@
# Netoïk Database ![badge](https://git.netoik.io/samuel/netoik-db/actions/workflows/ci.yaml/badge.svg) # Netoïk Database ![badge](https://git.netoik.io/netoik/netoik-db/actions/workflows/ci.yaml/badge.svg)
Build an RPM package which will install the DBMS called Postgresql with custom configuration. Build an RPM package which will install the DBMS called Postgresql with custom configuration.
@@ -57,21 +57,18 @@ Some commands to deploy the RPM package on server
- Add Gitea repo to your repo list: - Add Gitea repo to your repo list:
```shell ```shell
dnf config-manager --add-repo https://git.netoik.io/api/packages/samuel/rpm.repo dnf config-manager --add-repo https://git.netoik.io/api/packages/netoik/rpm.repo
dnf repolist | grep gitea-samuel dnf repolist | grep gitea-netoik
``` ```
- Show available versions: - Show available versions:
```shell ```shell
dnf --showduplicates netoik-db dnf search --showduplicates netoik-db
``` ```
- Install or upgrade package: - Install or upgrade package:
```shell ```shell
set -a
source ~/.netoik-db.env
dnf --nogpgcheck --refresh --assumeyes --best install netoik-db dnf --nogpgcheck --refresh --assumeyes --best install netoik-db
set +a
``` ```

View File

@@ -23,9 +23,11 @@ Install the database management system called postgresql with a predefined confi
%post %post
# Create sock directory if not existing # Create sock directory if not existing
mkdir --parents --mode 755 "%{_rundir}/postgresql"
chown postgres:postgres "%{_rundir}/postgresql" chown postgres:postgres "%{_rundir}/postgresql"
# Init cluster if necessary
runuser --user=postgres -- [ -f $PGDATA/PG_VERSION ] || postgresql-setup --initdb
# Restart services # Restart services
systemctl daemon-reload systemctl daemon-reload
systemctl reenable postgresql.service systemctl reenable postgresql.service
@@ -39,5 +41,7 @@ systemctl restart postgresql.service
%dir %attr(755, root, root) %{_unitdir}/postgresql.service.d %dir %attr(755, root, root) %{_unitdir}/postgresql.service.d
%attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf %attr(644, root, root) %{_unitdir}/postgresql.service.d/postgres.conf
%dir %attr(755, -, -) %{_rundir}/postgresql
%changelog %changelog
%autochangelog %autochangelog