1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-05-11 08:16:13 +02:00
build/pkg/unbound/build
David Oberhollenzer d7ae731c13 Split up unbound and util-linux into smaller packages
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-03 17:47:02 +01:00

51 lines
1.5 KiB
Plaintext

VERSION="1.8.3"
SRCDIR="unbound-${VERSION}"
TARBALL="${SRCDIR}.tar.gz"
URL="https://www.unbound.net/downloads"
SHA256SUM="2b692b8311edfad41e7d0380aac34576060d4176add81dc5db419c79b2a4cecc"
DEPENDS="openssl-dev expat-dev libbsd-dev crt-dev"
SUBPKG="unbound libunbound libunbound-dev"
prepare() {
return
}
build() {
run_configure "$1" --with-pidfile=/run/unbound.pid \
--with-libexpat="$TCDIR/$TARGET" \
--with-ssl="$TCDIR/$TARGET"
make -j $NUMJOBS
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
local tag alg type digest
make DESTDIR="$DEPLOY" install
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$DEPLOY"
cat_file_override "unbound.conf" > "$DEPLOY/etc/unbound/unbound.conf"
echo "generating trust anchor root.key"
curl --silent -L https://data.iana.org/root-anchors/root-anchors.xml |\
sed ':a;N;$!ba;s/\n//g' |\
grep -o -P -e "<KeyDigest.*?</KeyDigest>" |\
while read line; do
tag=$(echo $line | grep -o -e "<KeyTag>[0-9]*</" | grep -o -w "[0-9]*")
alg=$(echo $line | grep -o -e "<Algorithm>[0-9]*</" | grep -o -w "[0-9]*")
type=$(echo $line | grep -o -e "<DigestType>[0-9]*</" | grep -o -w "[0-9]*")
digest=$(echo $line | grep -o -e "<Digest>[A-F0-9]*</" | grep -o -w "[A-F0-9]*")
echo ". IN DS $tag $alg $type $digest" >> "$DEPLOY/etc/unbound/root.key"
done
}
check_update() {
curl --silent -L "$URL" | grep -o ">unbound-[0-9.]*tar.gz<" | \
sed 's/>unbound-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}