* debian,ubuntu :

apt install make gcc zlib1g-dev libcap-dev libnetfilter-queue-dev libmnl-dev libsystemd-dev libluajit2-5.1-dev
make -C /opt/zapret2 systemd

* fedora, rhel, centos, alma

dnf add make gcc zlib-devel libcap-devel libnetfilter_queue-devel libmnl-devel systemd-devel luajit-devel
make -C /opt/zapret2 systemd

* linux static :

need any x86_64 classic linux distribution
tested on debian/ubuntu/fedora 2020+
if your distro is very exotic, old or not glibc based you can debootstrap a modern debian/ubuntu system and chroot to it
NOTE: it's not possible to build luajit in chroot under standard openwrt kernel. build process requires 32-bit x86 support, kernel is compiled without it.
NOTE: toolchains are pre-compiled for x86_64 glibc. they can't run on arm or anything that is not x86_64.

optionally review "common.inc" for Lua and LuaJIT versions

debian/ubuntu: apt install curl xz-utils bzip2 unzip make gcc gcc-multilib libc6-dev libcap-dev pkg-config
fedora: dnf install curl xz bzip2 unzip make gcc glibc-devel glibc-devel.i686 libcap-devel pkg-config

copy directory "builder-linux" somethere with enough free disk space (up to 2G for all toolchains)
run "get_toolchains.sh"
select architectures you need or "ALL"
run "build_deps.sh", select "ALL"
run "build_zapret2.sh", select "ALL"
get static musl bins from "binaries" folder
"zapret2" is downloaded from github master branch. if you need specific version - download manually to "zapret2" dir
i586 and riscv64 targets are built with classic PUC Lua

* FreeBSD :

pkg install pkgconf
pkg search luajit-2
# see what's the version available
pkg install luajit-2.1.0.20250728
make -C /opt/zapret2

* OpenBSD :

pkg_add luajit gmake
gmake -C /opt/zapret2 bsd
