2019-06-09 23:35:34 +02:00
|
|
|
|
|
|
|
|
|
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
|
2019-10-19 18:17:50 +02:00
|
|
|
|
install[src/config.cr]=false
|
2019-06-09 23:35:34 +02:00
|
|
|
|
auto[src/config.cr]=true # Don’t display it in `make help`.
|
|
|
|
|
|
2019-10-19 18:17:50 +02:00
|
|
|
|
for file in services/*.spec; do
|
|
|
|
|
targets+=($file)
|
|
|
|
|
type[$file]=script
|
|
|
|
|
install[$file]='$(SHAREDIR)/services'
|
|
|
|
|
auto[$file]=true
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# FIXME: This should be upstreamed.
|
2019-06-09 23:35:34 +02:00
|
|
|
|
function script.install {
|
2019-10-19 18:17:50 +02:00
|
|
|
|
if [[ "false" = "${install[$target]}" ]]; then
|
|
|
|
|
ofile.install "$@"
|
|
|
|
|
else
|
|
|
|
|
binary.install "$@"
|
|
|
|
|
fi
|
2019-06-09 23:35:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install[status]='$(LIBEXECDIR)/service'
|
|
|
|
|
|