feat: scripts for building dig & drill

This commit is contained in:
DarkCat09 2024-12-20 17:52:34 +04:00
parent 0e66152987
commit 478659e4bc
Signed by: DarkCat09
GPG key ID: BD3CE9B65916CD82
3 changed files with 101 additions and 0 deletions

3
.gitignore vendored
View file

@ -1,2 +1,5 @@
/bind9
/ldns
/hickory-dns /hickory-dns
/unbound.log /unbound.log

47
build_dig.sh Executable file
View file

@ -0,0 +1,47 @@
#!/bin/bash
IFS=$'\n'
set -eu -o pipefail
echo
echo '==> Checking deps'
which git
which autoreconf
which make
which gcc || which clang
echo
echo '==> Cloning repo'
if ! [ -e bind9 ]; then
git clone --single-branch --depth 1 https://gitlab.isc.org/isc-projects/bind9.git bind9
else
echo ' ** bind9/ already exists'
fi
cd bind9
export CFLAGS="-O3" CPPFLAGS="-O3"
echo
echo '==> autoreconf -fi'
autoreconf -fi
echo
echo '==> ./configure (check deps, generate config)'
./configure \
--with-jemalloc \
--disable-doh \
--disable-geoip \
--with-libxml2=no \
--with-json-c=no \
--with-libsystemd=no \
--with-zlib=no
echo
echo '==> make'
make -j$(nproc)
unset CFLAGS CPPFLAGS
cd ..
echo
echo '==> Done'

51
build_drill.sh Executable file
View file

@ -0,0 +1,51 @@
#!/bin/bash
IFS=$'\n'
set -eu -o pipefail
echo
echo '==> Checking deps'
which git
which libtoolize
which autoreconf
which make
which gcc || which clang
echo
echo '==> Cloning repo'
if ! [ -e ldns ]; then
git clone --single-branch --depth 1 --recurse-submodules https://github.com/NLnetLabs/ldns.git ldns
else
echo ' ** ldns/ already exists'
fi
cd ldns
export CFLAGS="-O3"
echo
echo '==> libtoolize -ci'
libtoolize -ci
echo
echo '==> autoreconf -fi'
autoreconf -fi
echo
echo '==> ./configure (check deps, generate config)'
./configure \
--with-drill \
--without-pyldns \
--without-pyldnsx \
--enable-poll \
--disable-gost \
--disable-dane
echo
echo '==> make'
make -j$(nproc || echo 4)
unset CFLAGS
cd ..
echo
echo '==> Done'