summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-08-22 09:15:56 +0200
committerMichał Górny <mgorny@gentoo.org>2021-08-22 10:01:39 +0200
commitc1770fa205521b5abfbe16fb46a5ba3383218250 (patch)
treef8029c07685d74e65e650e3502dd3931dd0cf661 /net-misc/miniupnpd
parentnet-misc/miniupnpd: Remove old (diff)
downloadgentoo-c1770fa205521b5abfbe16fb46a5ba3383218250.tar.gz
gentoo-c1770fa205521b5abfbe16fb46a5ba3383218250.tar.bz2
gentoo-c1770fa205521b5abfbe16fb46a5ba3383218250.zip
net-misc/miniupnpd: Bump to 2.2.3
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'net-misc/miniupnpd')
-rw-r--r--net-misc/miniupnpd/Manifest2
-rw-r--r--net-misc/miniupnpd/files/miniupnpd-2.2.3-testgetifaddr.patch14
-rw-r--r--net-misc/miniupnpd/miniupnpd-2.2.3.ebuild100
3 files changed, 116 insertions, 0 deletions
diff --git a/net-misc/miniupnpd/Manifest b/net-misc/miniupnpd/Manifest
index cc070f822770..b26631d98c54 100644
--- a/net-misc/miniupnpd/Manifest
+++ b/net-misc/miniupnpd/Manifest
@@ -1,2 +1,4 @@
DIST miniupnpd-2.2.2.tar.gz 250649 BLAKE2B d561916ced9b5c58371382fe0bec68cd0771d1dc3b2c7fa7e3701cb2579db69697fbdcd724bea2350abd46381eda1fd257dede6df99f99fa54e423db4ee52717 SHA512 3cc11ad901e93a9879fe07e35a20f8977df466bb402e0270e46d1dbd0b5dc3b5dc22303467d5022103952d7dd789ac590c17d0fa81fc7ec42676b66223d37ee4
DIST miniupnpd-2.2.2.tar.gz.sig 543 BLAKE2B 461a9149c66b0e314a767405024fc7bfb641a20ae36b908dc467c9211660d5cb0753fb3c99fa9d6df35d693a2f6790efb6a325f0005804572eaa78a02b23a482 SHA512 8ffc9901cd992cbd9d0fa4c5e510fe43f748ab4a7c4732cc8f2f685f19b71a3f087a63a39e1dbf081175ac65de34b5c05dc3ef636a805e550a0406119a5904ef
+DIST miniupnpd-2.2.3.tar.gz 254752 BLAKE2B ebdb8d4ce7dc649ef0243d2d698b9f51cb2006055eb3abb70d9ccc839cb57c7113595ef1b9b5886f55bc458d8260edf95ae6e1964a5d5423f9b0b46e07e02775 SHA512 56b1e93e9576fa412202e1940fcd8b7af57584714c15017bbcec1aa4fa7bba7a6fa5d1136048100d7cce3222f31b38837de1eae344b533164314c858cdf08ef9
+DIST miniupnpd-2.2.3.tar.gz.sig 543 BLAKE2B 3ba2e69cfd7e0a27a746f45e5eb10e573e00c4fc20a7d62b94a2e0b7e4e9ad8779d53df72e31547b78dc6e34676204a4848652e81d1e479a68973e150f51f468 SHA512 9f766f3e94de1fbd458c7bda30cc87892198af7544aa9dc0fa4c6b6a1c9434e4bab6f8583eeccf3ae613da240ad599d750425c507e8138d483710459f31a0b21
diff --git a/net-misc/miniupnpd/files/miniupnpd-2.2.3-testgetifaddr.patch b/net-misc/miniupnpd/files/miniupnpd-2.2.3-testgetifaddr.patch
new file mode 100644
index 000000000000..73e4a87903e8
--- /dev/null
+++ b/net-misc/miniupnpd/files/miniupnpd-2.2.3-testgetifaddr.patch
@@ -0,0 +1,14 @@
+diff --git a/miniupnpd/testgetifaddr.sh b/miniupnpd/testgetifaddr.sh
+index 7ad56d9..2a26a24 100755
+--- a/testgetifaddr.sh
++++ b/testgetifaddr.sh
+@@ -12,7 +12,8 @@ case $OS in
+ *)
+ IP="`which ip`" || exit 1
+ EXTIF="`LC_ALL=C $IP -4 route | grep 'default' | sed -e 's/.*dev[[:space:]]*//' -e 's/[[:space:]].*//'`" || exit 1
+- EXTIP="`LC_ALL=C $IP -4 addr show $EXTIF | awk '/inet/ { print $2 }' | cut -d "/" -f 1`"
++ EXTIF="`LC_ALL=C $IP -4 addr show $EXTIF | awk '/[0-9]+:/ { print $2; exit 0 }' | cut -d ":" -f 1`"
++ EXTIP="`LC_ALL=C $IP -4 addr show $EXTIF | awk '/inet/ { print $2; exit 0 }' | cut -d "/" -f 1`"
+ ;;
+ esac
+
diff --git a/net-misc/miniupnpd/miniupnpd-2.2.3.ebuild b/net-misc/miniupnpd/miniupnpd-2.2.3.ebuild
new file mode 100644
index 000000000000..1042f0c2cb80
--- /dev/null
+++ b/net-misc/miniupnpd/miniupnpd-2.2.3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit toolchain-funcs verify-sig
+
+MY_P=${P/_rc/-RC}
+DESCRIPTION="MiniUPnP IGD Daemon"
+HOMEPAGE="http://miniupnp.free.fr/"
+SRC_URI="http://miniupnp.free.fr/files/${MY_P}.tar.gz
+ verify-sig? ( http://miniupnp.free.fr/files/${MY_P}.tar.gz.sig )"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+leasefile igd2 ipv6 nftables pcp-peer portinuse strict"
+
+RDEPEND="
+ dev-libs/gmp:0=
+ sys-apps/util-linux:=
+ dev-libs/openssl:0=
+ !nftables? (
+ >=net-firewall/iptables-1.4.6:0=[ipv6?]
+ net-libs/libnfnetlink:=
+ net-libs/libmnl:=
+ )
+ nftables? (
+ net-firewall/nftables
+ net-libs/libnftnl:=
+ net-libs/libmnl:=
+ )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ sys-apps/lsb-release
+ verify-sig? ( app-crypt/openpgp-keys-miniupnp )"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/miniupnp.asc
+
+src_prepare() {
+ local PATCHES=(
+ "${FILESDIR}"/${P}-testgetifaddr.patch
+ )
+
+ default
+
+ # fails without a default route
+ sed -i -e 's:EXTIF=.*:EXTIF=lo:' testgetifaddr.sh || die
+}
+
+src_configure() {
+ local opts=(
+ --vendorcfg
+ $(usex igd2 '--igd2' '')
+ $(usex ipv6 '--ipv6' '')
+ $(usex leasefile '--leasefile' '')
+ $(usex portinuse '--portinuse' '')
+ $(usex pcp-peer '--pcp-peer' '')
+ $(usex strict '--strict' '')
+ --firewall=$(usex nftables nftables iptables)
+ )
+
+ # custom script
+ ./configure "${opts[@]}" || die
+ # prevent gzipping manpage
+ sed -i -e '/gzip/d' Makefile || die
+}
+
+src_compile() {
+ # By default, it builds a bunch of unittests that are missing wrapper
+ # scripts in the tarball
+ emake CC="$(tc-getCC)" STRIP=true miniupnpd
+}
+
+src_test() {
+ emake CC="$(tc-getCC)" check
+}
+
+src_install() {
+ emake PREFIX="${ED}" STRIP=true install
+
+ local confd_seds=()
+ if use nftables; then
+ confd_seds+=( -e 's/^iptables_scripts=/#&/' )
+ else
+ confd_seds+=( -e 's/^nftables_scripts=/#&/' )
+ fi
+ if ! use ipv6 || use nftables; then
+ confd_seds+=( -e 's/^ip6tables_scripts=/#&/' )
+ fi
+
+ newinitd "${FILESDIR}"/${PN}-init.d-r2 ${PN}
+ newconfd - ${PN} < <(sed "${confd_seds[@]}" \
+ "${FILESDIR}"/${PN}-conf.d-r2 || die)
+}
+
+pkg_postinst() {
+ elog "Please correct the external interface in the top of the two"
+ elog "scripts in /etc/miniupnpd and edit the config file in there too"
+}