summaryrefslogtreecommitdiff
blob: aa9b0303c450ace98e08d1a9b3170d7d68000fb5 (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
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit scons-utils toolchain-funcs

DESCRIPTION="Peer-to-peer VPN software that abstracts a LAN over the Internet"
HOMEPAGE="http://www.freelan.org/"
SRC_URI="https://github.com/freelan-developers/freelan/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="debug"

DEPEND="
	dev-libs/boost:=[threads]
	dev-libs/openssl:0=
	net-misc/curl:=
	virtual/libiconv
	net-libs/miniupnpc:=
"
RDEPEND="${DEPEND}"

src_prepare() {
	export FREELAN_NO_GIT=1
	export FREELAN_NO_GIT_VERSION=${PV}

	sed -e "s/CXXFLAGS='-O3'/CXXFLAGS=''/" \
		-e "s/CXXFLAGS=\['-Werror'\]/CXXFLAGS=[]/" \
		-e "s/CXXFLAGS=\['-pedantic'\]/CXXFLAGS=[]/" \
		-i SConstruct || die
	default
}

src_compile() {
	tc-export CXX CC AR
	export LINK="$(tc-getCXX)"

	local MYSCONS=(
		"--mode=$(usex debug debug release)"
		prefix="${EPREFIX:-/}"
		bin_prefix="/usr"
		apps
	)
	escons "${MYSCONS[@]}"
}

src_install() {
	DESTDIR="${D}" escons --mode=release install prefix="${EPREFIX:-/}" bin_prefix="/usr"
	dobin build/release/bin/freelan
	dodoc CONTRIBUTING.md README.md

	newinitd "${FILESDIR}/openrc/freelan.initd" freelan
}