############################################################################### # # # IPFire.org - A linux based firewall # # Copyright (C) 2007-2026 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # ############################################################################### ############################################################################### # Definitions ############################################################################### include Config VER = 6.5.0 THISAPP = knot-resolver-$(VER) DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) ############################################################################### # Top-level Rules ############################################################################### objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) $(DL_FILE)_BLAKE2 = 5865694f45298353c3b5cdadfd9d87a5d9bb8cbd0ca14b204f1c4d39b2512cff46afb8670ab0a498e526b1d7fc0cd25befc67971e8810c63328ac0ab3fcd4ad1 install : $(TARGET) check : $(patsubst %,$(DIR_CHK)/%,$(objects)) download :$(patsubst %,$(DIR_DL)/%,$(objects)) b2 : $(subst %,%_BLAKE2,$(objects)) ############################################################################### # Downloading, checking, b2sum ############################################################################### $(patsubst %,$(DIR_CHK)/%,$(objects)) : @$(CHECK) $(patsubst %,$(DIR_DL)/%,$(objects)) : @$(LOAD) $(subst %,%_BLAKE2,$(objects)) : @$(B2SUM) ############################################################################### # Installation Details ############################################################################### $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/knot-resolver-6.5-keep-dst-ip.patch cd $(DIR_APP) && meson setup \ --buildtype=release \ --prefix=/usr \ -Duser=knot-resolver \ -Dgroup=knot-resolver \ -Dkeyfile_default="/var/lib/knot-resolver/root.keys" \ -Dinstall_root_keys=enabled \ -Dquic=disabled \ builddir/ # Compile kresd cd $(DIR_APP) && ninja -C builddir/ $(MAKETUNING) # Build Python components cd $(DIR_APP) && python3 setup.py build # Install everything cd $(DIR_APP) && ninja -C builddir/ install cd $(DIR_APP) && python3 setup.py install --root=/ # Install our configuration file install -v -m 644 $(DIR_SRC)/config/knot-resolver/config.yaml \ /etc/knot-resolver/config.yaml # Install our configuration helper script install -v -m 644 $(DIR_SRC)/config/knot-resolver/config.lua \ /usr/lib/knot-resolver/config.lua # Install the leases module install -v -m 644 $(DIR_SRC)/config/knot-resolver/leases.lua \ /usr/lib/knot-resolver/kres_modules/leases.lua # Install the leases schema install -v -m 6444 $(DIR_SRC)/config/knot-resolver/leases.schema \ /usr/lib/knot-resolver/leases.schema # Create the leases database sqlite3 "/var/lib/knot-resolver/leases.db" \ < /usr/lib/knot-resolver/leases.schema chown knot-resolver:knot-resolver /var/lib/knot-resolver/leases.db # Install the DHCP leases helper script install -v -m 755 $(DIR_SRC)/config/knot-resolver/dhcp-lease \ /usr/sbin/dhcp-lease # Change the ownership of /var/lib/knot-resolver chown knot-resolver:knot-resolver /var/lib/knot-resolver # Create a directory for zone files -mkdir -pv /var/lib/knot-resolver/zones chown knot-resolver:knot-resolver /var/lib/knot-resolver/zones # Create cache directory -mkdir -pv /var/cache/knot-resolver chown knot-resolver:knot-resolver /var/cache/knot-resolver # Allow kresd to bind to ports even though it is not running as root setcap "cap_net_bind_service=+ep" /usr/sbin/kresd @rm -rf $(DIR_APP) @$(POSTBUILD)