service/project.zsh

59 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package=service
version=0.1.0
variables+=(
LIBEXECDIR '$(PREFIX)/libexec'
SYSCONFDIR '/etc'
VARSTATEDIR '/var'
DATADIR '/srv'
)
targets=(service status gen-config get-port)
for target in service status gen-config get-port; 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
install[src/config.cr]=false
auto[src/config.cr]=true # Dont display it in `make help`.
chmod[src/config.cr]=0644
for file in services/*.spec; do
targets+=($file)
type[$file]=script
install[$file]='$(SHAREDIR)/services'
auto[$file]=true
chmod[$file]=0644
done
for file in templates/*.j2; do
targets+=($file)
type[$file]=script
install[$file]='$(SHAREDIR)/templates'
auto[$file]=true
chmod[$file]=0644
done
for file in utils/*; do
targets+=($file)
type[$file]=script
done
# FIXME: This should be upstreamed.
function script.install {
if [[ "false" = "${install[$target]}" ]]; then
ofile.install "$@"
else
binary.install "$@"
fi
}
install[status]='$(LIBEXECDIR)/service'