Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/miniupnpd/files/, net-misc/miniupnpd/
Date: Sun, 30 Jun 2019 07:39:41
Message-Id: 1561880354.558047cd7e9293f68003d0af7f411fc77d1ceed0.mgorny@gentoo
1 commit: 558047cd7e9293f68003d0af7f411fc77d1ceed0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 30 07:07:03 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 30 07:39:14 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=558047cd
7
8 net-misc/miniupnpd: Fix bashisms in init.d file
9
10 Closes: https://bugs.gentoo.org/646548
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 net-misc/miniupnpd/files/miniupnpd-init.d-r2 | 33 +++++++++++
14 .../miniupnpd/miniupnpd-2.1.20190625-r1.ebuild | 65 ++++++++++++++++++++++
15 2 files changed, 98 insertions(+)
16
17 diff --git a/net-misc/miniupnpd/files/miniupnpd-init.d-r2 b/net-misc/miniupnpd/files/miniupnpd-init.d-r2
18 new file mode 100644
19 index 00000000000..744f59e6a44
20 --- /dev/null
21 +++ b/net-misc/miniupnpd/files/miniupnpd-init.d-r2
22 @@ -0,0 +1,33 @@
23 +#!/sbin/openrc-run
24 +# Copyright 1999-2019 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +command="/usr/sbin/miniupnpd"
28 +: "${config_file:=/etc/miniupnpd/miniupnpd.conf}"
29 +command_args="-f ${config_file:-/etc/miniupnpd/miniupnpd.conf} ${extra_args}"
30 +: "${pidfile:=/var/run/miniupnpd.pid}"
31 +
32 +depend() {
33 + need net iptables
34 + use minissdpd
35 +}
36 +
37 +start_pre() {
38 + local retval=0
39 +
40 + if [ -z "${no_iptables_scripts}" ]; then
41 + /etc/miniupnpd/iptables_init.sh || retval=${?}
42 + fi
43 +
44 + return ${retval}
45 +}
46 +
47 +stop_post() {
48 + local retval=0
49 +
50 + if [ -z "${no_iptables_scripts}" ]; then
51 + /etc/miniupnpd/iptables_removeall.sh
52 + fi
53 +
54 + return ${retval}
55 +}
56
57 diff --git a/net-misc/miniupnpd/miniupnpd-2.1.20190625-r1.ebuild b/net-misc/miniupnpd/miniupnpd-2.1.20190625-r1.ebuild
58 new file mode 100644
59 index 00000000000..0e787f99f32
60 --- /dev/null
61 +++ b/net-misc/miniupnpd/miniupnpd-2.1.20190625-r1.ebuild
62 @@ -0,0 +1,65 @@
63 +# Copyright 1999-2019 Gentoo Authors
64 +# Distributed under the terms of the GNU General Public License v2
65 +
66 +EAPI=7
67 +
68 +inherit toolchain-funcs
69 +
70 +DESCRIPTION="MiniUPnP IGD Daemon"
71 +HOMEPAGE="http://miniupnp.free.fr/"
72 +SRC_URI="http://miniupnp.free.fr/files/${P}.tar.gz"
73 +
74 +LICENSE="BSD"
75 +SLOT="0"
76 +KEYWORDS="~amd64 ~arm ~x86"
77 +IUSE="+leasefile igd2 ipv6 pcp-peer portinuse strict"
78 +
79 +RDEPEND=">=net-firewall/iptables-1.4.6:0=[ipv6?]
80 + net-libs/libnfnetlink:=
81 + net-libs/libmnl:=
82 + dev-libs/gmp:0=
83 + sys-apps/util-linux:=
84 + dev-libs/openssl:0="
85 +DEPEND="${RDEPEND}
86 + sys-apps/lsb-release"
87 +
88 +src_prepare() {
89 + default
90 + mv Makefile.linux Makefile || die
91 +
92 + # Prevent gzipping manpage.
93 + sed -i -e '/gzip/d' Makefile || die
94 +}
95 +
96 +src_configure() {
97 + local -a opts
98 + opts=(
99 + --vendorcfg
100 + $(usex igd2 '--igd2' '')
101 + $(usex ipv6 '--ipv6' '')
102 + $(usex leasefile '--leasefile' '')
103 + $(usex portinuse '--portinuse' '')
104 + $(usex pcp-peer '--pcp-peer' '')
105 + $(usex strict '--strict' '')
106 + )
107 +
108 + emake CONFIG_OPTIONS="${opts[*]}" config.h
109 +}
110 +
111 +src_compile() {
112 + # By default, it builds a bunch of unittests that are missing wrapper
113 + # scripts in the tarball
114 + emake CC="$(tc-getCC)" STRIP=true miniupnpd
115 +}
116 +
117 +src_install() {
118 + emake PREFIX="${ED}" STRIP=true install
119 +
120 + newinitd "${FILESDIR}"/${PN}-init.d-r2 ${PN}
121 + newconfd "${FILESDIR}"/${PN}-conf.d-r1 ${PN}
122 +}
123 +
124 +pkg_postinst() {
125 + elog "Please correct the external interface in the top of the two"
126 + elog "scripts in /etc/miniupnpd and edit the config file in there too"
127 +}