summaryrefslogtreecommitdiff
blob: 52ecfc135537c08895b7d22b91415afd7e1b94f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI="5"

inherit eutils toolchain-funcs

MY_PV=1.9.20150721
MY_P="${PN}-${MY_PV}"

DESCRIPTION="MiniUPnP IGD Daemon"
HOMEPAGE="http://miniupnp.free.fr/"
SRC_URI="http://miniupnp.free.fr/files/${MY_P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""

RDEPEND=">=net-firewall/iptables-1.4.6
	net-libs/libnfnetlink"
DEPEND="${RDEPEND}
	sys-apps/util-linux
	sys-apps/lsb-release"

S="${WORKDIR}/${MY_P}"

src_prepare() {
	epatch "${FILESDIR}"/${PN}-1.10-build.patch
	mv Makefile.linux Makefile || die
}

src_configure() {
	tc-export CC
	export STRIP=true

	emake config.h
	sed -i -r \
		-e '/#define ENABLE_LEASEFILE/s:(/[*]|[*]/)::g' \
		config.h || die

	sed -i -r \
		-e '/#define ENABLE_MANUFACTURER_INFO_CONFIGURATION/s:(/[*]|[*]/)::g' \
		 config.h || die
}

src_compile() {
	# By default, it builds a bunch of unittests we don't run.
	emake CC="$(tc-getCC)" miniupnpd
}

src_install() {
	emake install PREFIX="${ED}"

	newinitd "${FILESDIR}"/${PN}-init.d ${PN}
	newconfd "${FILESDIR}"/${PN}-conf.d ${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"
}