32 lines
1.3 KiB
RPMSpec
32 lines
1.3 KiB
RPMSpec
name: postgresql
|
|
user: postgres
|
|
command: postgres -D /srv/${ENVIRONMENT}/postgresql -k /tmp/postgresql-${ENVIRONMENT}
|
|
#stop-command: kill -HUP ${PID}
|
|
environment-variables:
|
|
- PGROOT=/srv/${ENVIRONMENT}/postgresql
|
|
provides: postgresql
|
|
|
|
%check
|
|
name: database directory creation
|
|
directory: /srv/${ENVIRONMENT}/postgresql
|
|
command: mkdir -p /srv/${ENVIRONMENT}/postgresql && chown postgres:postgres /srv/${ENVIRONMENT}/postgresql
|
|
|
|
%check
|
|
name: database creation
|
|
file: /srv/${ENVIRONMENT}/postgresql/base
|
|
command: su - postgres -c "initdb --locale en_US.UTF-8 -D '/srv/${ENVIRONMENT}/postgresql'" && rm /srv/${ENVIRONMENT}/postgresql/postgresql.conf
|
|
|
|
%check
|
|
name: database configuration
|
|
# once this file is created, there is no need to perform the command
|
|
file: /srv/${ENVIRONMENT}/postgresql/postgresql.conf
|
|
# gen-config inherits its parameters from the environment
|
|
command: gen-config postgresql.conf /srv/${ENVIRONMENT}/postgresql/postgresql.conf && chown postgres:postgres /srv/${ENVIRONMENT}/postgresql/postgresql.conf
|
|
|
|
%check
|
|
name: sockets directory
|
|
directory: /tmp/postgresql-${ENVIRONMENT}
|
|
# FIXME: impose permissions
|
|
command: mkdir -p /tmp/postgresql-${ENVIRONMENT} && chown postgres:postgres /tmp/postgresql-${ENVIRONMENT}
|
|
# FIXME: add postgresql-check-db-dir around here
|