Files
bind/recipe.sh
T

35 lines
1.5 KiB
Bash

# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
meson setup --prefix=/usr build
meson compile -C build
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
meson install -C build --destdir="$BPM_OUTPUT"
# Install config files
install -Dm644 "$BPM_WORKDIR"/named.conf "$BPM_OUTPUT"/etc/named.conf
# Setup named directory and zones
install -dm770 -o 0 -g 20 "$BPM_OUTPUT"/var/named
install -Dm640 -o 0 -g 20 "$BPM_WORKDIR"/localhost.zone "$BPM_OUTPUT"/var/named/localhost.zone
install -Dm640 -o 0 -g 20 "$BPM_WORKDIR"/localhost.ip6.zone "$BPM_OUTPUT"/var/named/localhost.ip6.zone
install -Dm640 -o 0 -g 20 "$BPM_WORKDIR"/127.0.0.zone "$BPM_OUTPUT"/var/named/127.0.0.zone
# Install sysusers file
install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/named.conf
# Install esvm service
install -Dm644 "$BPM_WORKDIR"/named.esv "$BPM_OUTPUT"/etc/esvm/services/named.esv
# Install package license
install -Dm644 "$BPM_SOURCE"/{LICENSE,COPYRIGHT} -t "$BPM_OUTPUT"/usr/share/licenses/bind/
}