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

EAPI=8

MY_PN="NetworkManager-l2tp"
MY_P="${MY_PN}-${PV}"

inherit gnome.org

DESCRIPTION="NetworkManager L2TP plugin"
HOMEPAGE="https://github.com/nm-l2tp/NetworkManager-l2tp"
SRC_URI="https://github.com/nm-l2tp/${MY_PN}/releases/download/${PV}/${MY_P}.tar.xz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="gtk"

RDEPEND="
	dev-libs/dbus-glib
	>=dev-libs/glib-2.32
	net-dialup/ppp:=[eap-tls]
	net-dialup/xl2tpd
	>=net-misc/networkmanager-1.20[ppp]
	|| (
		net-vpn/strongswan
		net-vpn/libreswan
	)
	gtk? (
		x11-libs/gtk+:3
		app-crypt/libsecret
		gnome-extra/nm-applet
	)"
DEPEND="${RDEPEND}"
BDEPEND="
	dev-util/intltool
	sys-devel/gettext
	virtual/pkgconfig"

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

src_configure() {
	local PPPD_VER=$(best_version net-dialup/ppp)
	PPPD_VER=${PPPD_VER#*/*-} # reduce it to ${PV}-${PR}
	PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision

	local myeconfargs=(
		--localstatedir=/var
		--with-pppd-plugin-dir=/usr/$(get_libdir)/pppd/${PPPD_VER}
		$(use_with gtk gnome)
	)

	econf "${myeconfargs[@]}"
}

src_install() {
	default
	find "${ED}" -name '*.la' -delete || die
}