aports/APKBUILD.template
Alex Denes 8df9fdc4ab
Reorganization, automation and more
- More templating and inheritance
- New commands
+ rx_replace
+ rx_install
+ rx_cpkgdir
- More transparency with secrets being sourced as variables and replaced
- Modularization of configs
+ telegraf
+ nginx (partial)
+ fastd
+ wireguard
+ unbound
- Split of unbound configurations and bind zones
- Bumping of key versions (rolling keys)
+ ZSK/KSK
+ OpenDKIM
- Relaxed permission defaults
and other smaller tweaks...
2021-06-01 23:17:41 +00:00

49 lines
1.4 KiB
Plaintext

pkgname=redxen # Prefix
pkgver="$(date +'%Y.%m.%d')" # Use current date as fallback
url="https://git.redxen.eu/RedXen/aports" # Upstream for all configs
arch="noarch" # Most things aren't arch specific
license="none" # Can you even license configs?
options="!check" # Usually software doesn't provide tests
builddir="$srcdir" # This should be a default, sadly isn't
_rx_pkgname="${startdir##*/}" # Usually the package name is the same as the directory
_rx_installdir="/etc/redxen/$_rx_pkgname" # The install dir follows this pattern
rx_replace() {
sed -i -- "s/$1/$(printf "%s" "$2" | sed 's/[&/\]/\\&/g')/g" "$3"
}
rx_cpkgdir() {
echo "${subpkgdir:-${pkgdir}}"
}
rx_install() {
_SRC="$1"
if [ ! -f "$_SRC" ]; then
if [ -f "$pkgdir/$_SRC" ]; then
_SRC="$pkgdir/$_SRC"
elif [ -f "$builddir/$_SRC" ]; then
_SRC="$builddir/$_SRC"
elif [ -f "$srcdir/$_SRC" ]; then
_SRC="$srcdir/$_SRC"
else
die "Install source $_SRC wasn't found"
return 1
fi
fi
install -D -m "${_rx_fperm:-444}" -- "$_SRC" "$(rx_cpkgdir)/${_rx_installdir}/${2:-${1##*/}}"
}
# Defaults
rx_source_installall() {
for i in $source; do
rx_install "$i"
done
}
# Install every source file in a directory
package() {
rx_source_installall
}