commit 3a7136dfbcdf415f758766d8c68e7231a33727cb Author: EnumDev Date: Wed Oct 1 13:20:32 2025 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..61e8b57 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +URL="https://thekelleys.org.uk/dnsmasq/" + +# Get version number from FTP server +VERSION=$(curl -s -L "$URL" | grep -o 'dnsmasq-.*.tar.gz' | grep -o -E '[0-9]{1,}.[0-9]{1,}' | sort -V | tail -n1) + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..28f499c --- /dev/null +++ b/pkg.info @@ -0,0 +1,22 @@ +name: dnsmasq +description: Lightweight, easy to configure DNS forwarder and DHCP server +version: "2.91" +revision: 1 +url: https://thekelleys.org.uk/dnsmasq/doc.html +license: GPL2-or-later +architecture: any +type: source +depends: + - dbus + - glibc + - gmp + - libidn2 + - libnetfilter_conntrack + - nettle + - nftables + - sysusers +downloads: + - url: https://thekelleys.org.uk/dnsmasq/dnsmasq-${BPM_PKG_VERSION}.tar.gz + extract_to_bpm_source: true + extract_strip_components: 1 + checksum: 2d26a048df452b3cfa7ba05efbbcdb19b12fe7a0388761eb5d00938624bd76c8 diff --git a/source-files/sysusers b/source-files/sysusers new file mode 100644 index 0000000..841deae --- /dev/null +++ b/source-files/sysusers @@ -0,0 +1 @@ +u! dnsmasq - "dnsmasq daemon" / diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..aa29d0b --- /dev/null +++ b/source.sh @@ -0,0 +1,38 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + make CFLAGS="$CPPFLAGS $CFLAGS" LDFLAGS="$LDFLAGS" COPTS="-DHAVE_DNSSEC -DHAVE_DBUS -DHAVE_LIBIDN2 -DHAVE_CONNTRACK -DHAVE_NFTSET" PREFIX=/usr BINDIR=/usr/bin all-i18n + + cd contrib/lease-tools + make CFLAGS="$CPPFLAGS $CFLAGS" LDFLAGS="$LDFLAGS" COPTS="-DHAVE_DNSSEC -DHAVE_DBUS -DHAVE_LIBIDN2 -DHAVE_CONNTRACK -DHAVE_NFTSET" all +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make COPTS="-DHAVE_DNSSEC -DHAVE_DBUS -DHAVE_LIBIDN2 -DHAVE_CONNTRACK -DHAVE_NFTSET" DESTDIR="$BPM_OUTPUT" PREFIX=/usr BINDIR=/usr/bin install-i18n + + # Install lease-tools + install -Dm0755 'contrib/lease-tools/dhcp_'{release{,6},lease_time} -t "$BPM_OUTPUT"/usr/bin/ + install -Dm0644 'contrib/lease-tools/dhcp_'{release{,6},lease_time}.1 -t "$BPM_OUTPUT"/usr/share/man/man1 + + # Install dbus service + install -Dm644 dbus/dnsmasq.conf "$BPM_OUTPUT"/usr/share/dbus-1/system.d/dnsmasq.conf + + # Install configuration file + install -Dm644 dnsmasq.conf.example "$BPM_OUTPUT"/etc/dnsmasq.conf + + # Install sysusers file + install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/dnsmasq.conf + + # DNSSEC setup + sed -i 's,%%PREFIX%%,/usr,' "$BPM_OUTPUT"/etc/dnsmasq.conf + install -Dm0644 "trust-anchors.conf" "$BPM_OUTPUT"/usr/share/dnsmasq/trust-anchors.conf + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/dnsmasq/COPYING +}