summaryrefslogtreecommitdiff
blob: d0bd4b47176a9d277351fcb31a4fdbaaef006a64 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit linux-info pam

PATCH_TARBALL_NAME="${PN}-2.4.9-patches-03"
DESCRIPTION="Point-to-Point Protocol (PPP)"
HOMEPAGE="https://ppp.samba.org/"
SRC_URI="https://download.samba.org/pub/ppp/${P}.tar.gz
	https://github.com/ppp-project/ppp/blob/${P}/contrib/pppgetpass/pppgetpass.8"

LICENSE="BSD GPL-2"
SLOT="0/${PV}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="activefilter atm gtk pam systemd"

DEPEND="
	dev-libs/openssl:0=
	virtual/libcrypt:=
	activefilter? ( net-libs/libpcap )
	atm? ( net-dialup/linux-atm )
	gtk? ( x11-libs/gtk+:2 )
	pam? ( sys-libs/pam )
	systemd? ( sys-apps/systemd )
"
RDEPEND="${DEPEND}
	!<net-misc/netifrc-0.7.1-r2"
BDEPEND="virtual/pkgconfig"
PDEPEND="net-dialup/ppp-scripts"

pkg_setup() {
	# Avoid linux-info_pkg_setup
	:
}

src_configure() {
	local args=(
		--localstatedir="${EPREFIX}"/var
		--runstatedir="${EPREFIX}"/run
		$(use_enable systemd)
		$(use_with atm)
		$(use_with pam)
		$(use_with activefilter pcap)
		$(use_with gtk)
		--enable-cbcp
	)
	econf "${args[@]}"
}

src_compile() {
	default
}

src_install() {
	default

	find "${ED}" -name '*.la' -type f -delete || die

	if use pam; then
		pamd_mimic_system ppp auth account session
	fi

	insinto /etc/modprobe.d
	newins "${FILESDIR}/modules.ppp" ppp.conf

	dosbin scripts/p{on,off,log}
	doman scripts/pon.1
	dosym pon.1 /usr/share/man/man1/poff.1
	dosym pon.1 /usr/share/man/man1/plog.1

	# Adding misc. specialized scripts to doc dir
	dodoc -r scripts

	if use gtk ; then
		dosbin contrib/pppgetpass/pppgetpass.{gtk,vt}
		newsbin contrib/pppgetpass/pppgetpass.sh pppgetpass
	else
		newsbin contrib/pppgetpass/pppgetpass.vt pppgetpass
	fi
	# Missing from upstream tarball
	# https://github.com/ppp-project/ppp/pull/412
	#doman contrib/pppgetpass/pppgetpass.8
	doman "${DISTDIR}/pppgetpass.8"
}

pkg_postinst() {
	local CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY"
	local ERROR_PPP="CONFIG_PPP:\t missing PPP support (REQUIRED)"
	local ERROR_PPP_ASYNC="CONFIG_PPP_ASYNC:\t missing asynchronous serial line discipline (optional, but highly recommended)"
	local WARNING_PPP_SYNC_TTY="CONFIG_PPP_SYNC_TTY:\t missing synchronous serial line discipline (optional; used by 'sync' pppd option)"
	if use activefilter ; then
		CONFIG_CHECK+=" ~PPP_FILTER"
		local ERROR_PPP_FILTER="CONFIG_PPP_FILTER:\t missing PPP filtering support (REQUIRED)"
	fi
	CONFIG_CHECK+=" ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE"
	local ERROR_PPP_DEFLATE="CONFIG_PPP_DEFLATE:\t missing Deflate compression (optional, but highly recommended)"
	local ERROR_PPP_BSDCOMP="CONFIG_PPP_BSDCOMP:\t missing BSD-Compress compression (optional, but highly recommended)"
	local WARNING_PPP_MPPE="CONFIG_PPP_MPPE:\t missing MPPE encryption (optional, mostly used by PPTP links)"
	CONFIG_CHECK+=" ~PPPOE ~PACKET"
	local WARNING_PPPOE="CONFIG_PPPOE:\t missing PPPoE support (optional, needed by pppoe plugin)"
	local WARNING_PACKET="CONFIG_PACKET:\t missing AF_PACKET support (optional, used by pppoe plugin)"
	if use atm ; then
		CONFIG_CHECK+=" ~PPPOATM"
		local WARNING_PPPOATM="CONFIG_PPPOATM:\t missing PPPoA support (optional, needed by pppoatm plugin)"
	fi

	linux-info_pkg_setup

	echo
	elog "pon, poff and plog scripts have been supplied for experienced users."
	elog "Users needing particular scripts (ssh,rsh,etc.) should check out the"
	elog "/usr/share/doc/${PF}/scripts directory."
}