diff --git a/srcpkgs/miniupnpd-nftables/files/README.voidlinux b/srcpkgs/miniupnpd-nftables/files/README.voidlinux new file mode 100644 index 00000000000..eb4380b5753 --- /dev/null +++ b/srcpkgs/miniupnpd-nftables/files/README.voidlinux @@ -0,0 +1,3 @@ +Before running miniupnpd edit the scripts and configuration files in /etc/miniupnpd/. +Load the nftable rules by executing /etc/miniupnpd/nft_init.sh manually or by adding +the script to /etc/sv/minidlnad/run. diff --git a/srcpkgs/miniupnpd-nftables/files/miniupnpd/run b/srcpkgs/miniupnpd-nftables/files/miniupnpd/run new file mode 100644 index 00000000000..9634ae5d576 --- /dev/null +++ b/srcpkgs/miniupnpd-nftables/files/miniupnpd/run @@ -0,0 +1,4 @@ +#!/bin/sh +[ -r conf ] && . ./conf +exec 2>&1 +exec miniupnpd ${OPTS:=-f /etc/miniupnpd/miniupnpd.conf} diff --git a/srcpkgs/miniupnpd-nftables/patches/fix-configure-script.patch b/srcpkgs/miniupnpd-nftables/patches/fix-configure-script.patch new file mode 100644 index 00000000000..3836c3b1844 --- /dev/null +++ b/srcpkgs/miniupnpd-nftables/patches/fix-configure-script.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -49,7 +49,7 @@ + --iptablespath=*) + IPTABLESPATH=$(echo $argv | cut -d= -f2) ;; + --getifaddrs) GETIFADDRS=1 ;; +- --v6sockets-v6only) V6SOCKETS_ARE_V6ONLY="0" ++ --v6sockets-v6only) V6SOCKETS_ARE_V6ONLY="0" ;; + --host-os=*) + OS_NAME=$(echo $argv | cut -d= -f2) ;; + --host-os-version=*) diff --git a/srcpkgs/miniupnpd-nftables/template b/srcpkgs/miniupnpd-nftables/template new file mode 100644 index 00000000000..54ec33405e1 --- /dev/null +++ b/srcpkgs/miniupnpd-nftables/template @@ -0,0 +1,53 @@ +# Template file for 'miniupnpd-nftables' +pkgname=miniupnpd-nftables +version=2.3.7 +revision=1 +build_style=configure +configure_args=" + --disable-fork + --ipv6 + --igd2 + --leasefile + --firewall=nftables" +make_install_args=" + INSTALLPREFIX=/usr + SBININSTALLDIR=/usr/bin" +conf_files=" + /etc/miniupnpd/*.conf + /etc/miniupnpd/*.sh" +hostmakedepends="pkg-config" +makedepends="libnfnetlink-devel libnftnl-devel openssl-devel" +checkdepends="iproute2 nftables which" +short_desc="Lightweight UPnP IGD daemon with nftables support" +maintainer="Echo Nar " +license="BSD-3-Clause" +homepage="http://miniupnp.free.fr" +changelog="http://miniupnp.free.fr/files/changelog.php?file=miniupnpd-${version}.tar.gz" +distfiles="http://miniupnp.free.fr/files/miniupnpd-${version}.tar.gz" +checksum=fbdd5501039730f04a8420ea2f8f54b7df63f9f04cde2dc67fa7371e80477bbe +conflicts="miniupnpd" + +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + makedepends+=" musl-legacy-compat" +fi + +post_extract() { + vsed -i "${wrksrc}/configure" \ + -e 's|LSB_RELEASE=.*|LSB_RELEASE=$(false)|' \ + -e 's|V6SOCKETS_ARE_V6ONLY=.*|V6SOCKETS_ARE_V6ONLY="0"|' +} + + +post_configure() { + vsed -i "${wrksrc}/config.h" \ + -e 's|^#define OS_URL.*$|#define OS_URL "https://voidlinux.org/"|g' \ + -e 's|^#define OS_NAME.*$|#define OS_NAME "Void"|g' \ + -e 's|^#define OS_VERSION.*$|#define OS_VERSION "Void"|g' +} + +post_install() { + rm -rf "${DESTDIR}/etc/init.d" + vsv miniupnpd + vlicense LICENSE + vdoc "${FILESDIR}/README.voidlinux" +} diff --git a/srcpkgs/miniupnpd-nftables/update b/srcpkgs/miniupnpd-nftables/update new file mode 100644 index 00000000000..7096d869ff8 --- /dev/null +++ b/srcpkgs/miniupnpd-nftables/update @@ -0,0 +1 @@ +ignore="*.???????? 20[0123456789][0123456789]????"