project.zsh added and generated configuration.

This commit is contained in:
Luka Vandervelden 2019-06-09 23:35:34 +02:00
parent 5eb0849abd
commit 38329bb15e
3 changed files with 38 additions and 8 deletions

30
project.zsh Normal file
View File

@ -0,0 +1,30 @@
package=service
version=0.1.0
variables+=(
LIBEXECDIR '$(PREFIX)/libexec'
SYSCONFDIR '/etc'
VARSTATEDIR '/var'
)
targets=(service status)
for target in service status; do
type[$target]=crystal
sources[$target]=src/${target}.cr
depends[$target]=src/config.cr
done
targets+=(src/config.cr)
type[src/config.cr]=script
sources[src/config.cr]=src/config.cr.in
auto[src/config.cr]=true # Dont display it in `make help`.
# FIXME: Redefining the backend so that script is not installed is a bit much.
function script.install {
ofile.install "$@"
}
install[status]='$(LIBEXECDIR)/service'

View File

@ -1,8 +0,0 @@
# Those are set to local to make testing easier. Will change at some point.
PID_DIRECTORY = "./pid"
RC_DIRECTORY = "./rc"
LOG_DIRECTORY = "./log"
SERVICES_DIRECTORY = "./services"
ENVIRONMENTS_DIRECTORY = "./environments"

8
src/config.cr.in Normal file
View File

@ -0,0 +1,8 @@
# These values are changed by `make` at build-time.
PID_DIRECTORY = "@VARSTATEDIR@/pid"
RC_DIRECTORY = "@SYSCONFDIR@/rc/services"
LOG_DIRECTORY = "@VARSTATEDIR@/log"
SERVICES_DIRECTORY = "@SHAREDIR@/services"
ENVIRONMENTS_DIRECTORY = "@SYSCONFDIR@/rc/environments"