commit:     558047cd7e9293f68003d0af7f411fc77d1ceed0
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 30 07:07:03 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 30 07:39:14 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=558047cd

net-misc/miniupnpd: Fix bashisms in init.d file

Closes: https://bugs.gentoo.org/646548
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 net-misc/miniupnpd/files/miniupnpd-init.d-r2       | 33 +++++++++++
 .../miniupnpd/miniupnpd-2.1.20190625-r1.ebuild     | 65 ++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/net-misc/miniupnpd/files/miniupnpd-init.d-r2 
b/net-misc/miniupnpd/files/miniupnpd-init.d-r2
new file mode 100644
index 00000000000..744f59e6a44
--- /dev/null
+++ b/net-misc/miniupnpd/files/miniupnpd-init.d-r2
@@ -0,0 +1,33 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/miniupnpd"
+: "${config_file:=/etc/miniupnpd/miniupnpd.conf}"
+command_args="-f ${config_file:-/etc/miniupnpd/miniupnpd.conf} ${extra_args}"
+: "${pidfile:=/var/run/miniupnpd.pid}"
+
+depend() {
+       need net iptables
+       use minissdpd
+}
+
+start_pre() {
+       local retval=0
+
+       if [ -z "${no_iptables_scripts}" ]; then
+               /etc/miniupnpd/iptables_init.sh || retval=${?}
+       fi
+       
+       return ${retval}
+}
+
+stop_post() {
+       local retval=0
+
+       if [ -z "${no_iptables_scripts}" ]; then
+               /etc/miniupnpd/iptables_removeall.sh
+       fi
+
+       return ${retval}
+}

diff --git a/net-misc/miniupnpd/miniupnpd-2.1.20190625-r1.ebuild 
b/net-misc/miniupnpd/miniupnpd-2.1.20190625-r1.ebuild
new file mode 100644
index 00000000000..0e787f99f32
--- /dev/null
+++ b/net-misc/miniupnpd/miniupnpd-2.1.20190625-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="MiniUPnP IGD Daemon"
+HOMEPAGE="http://miniupnp.free.fr/";
+SRC_URI="http://miniupnp.free.fr/files/${P}.tar.gz";
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+leasefile igd2 ipv6 pcp-peer portinuse strict"
+
+RDEPEND=">=net-firewall/iptables-1.4.6:0=[ipv6?]
+       net-libs/libnfnetlink:=
+       net-libs/libmnl:=
+       dev-libs/gmp:0=
+       sys-apps/util-linux:=
+       dev-libs/openssl:0="
+DEPEND="${RDEPEND}
+       sys-apps/lsb-release"
+
+src_prepare() {
+       default
+       mv Makefile.linux Makefile || die
+
+       # Prevent gzipping manpage.
+       sed -i -e '/gzip/d' Makefile || die
+}
+
+src_configure() {
+       local -a opts
+       opts=(
+               --vendorcfg
+               $(usex igd2 '--igd2' '')
+               $(usex ipv6 '--ipv6' '')
+               $(usex leasefile '--leasefile' '')
+               $(usex portinuse '--portinuse' '')
+               $(usex pcp-peer '--pcp-peer' '')
+               $(usex strict '--strict' '')
+       )
+
+       emake CONFIG_OPTIONS="${opts[*]}" config.h
+}
+
+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_install() {
+       emake PREFIX="${ED}" STRIP=true install
+
+       newinitd "${FILESDIR}"/${PN}-init.d-r2 ${PN}
+       newconfd "${FILESDIR}"/${PN}-conf.d-r1 ${PN}
+}
+
+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"
+}

Reply via email to