Diff accel-ppp-1.12.0_p20230609 with a accel-ppp-9999

/usr/portage/net-dialup/accel-ppp/accel-ppp-9999.ebuild 2026-03-28 11:46:09.389460395 +0300
1
# Copyright 1999-2024 Gentoo Authors
1
# Copyright 1999-2026 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
......
7 7
MODULES_OPTIONAL_IUSE="ipoe"
8 8
inherit cmake flag-o-matic linux-mod-r1 lua-single
9 9

  
10
DESCRIPTION="High performance PPTP, PPPoE and L2TP server"
11
HOMEPAGE="https://sourceforge.net/projects/accel-ppp/"
12
SRC_URI="https://dev.gentoo.org/~pinkbyte/distfiles/snapshots/${P}.tar.bz2"
10
DESCRIPTION="High performance PPTP/L2TP/SSTP/PPPoE/IPoE server"
11
HOMEPAGE="https://accel-ppp.org/"
12

  
13
if [[ ${PV} == *9999 ]]; then
14
	inherit git-r3
15
	EGIT_REPO_URI="https://github.com/accel-ppp/accel-ppp.git"
16
else
17
	SRC_URI="https://github.com/accel-ppp/accel-ppp/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
18
	KEYWORDS="~amd64 ~x86"
19
fi
13 20

  
14 21
LICENSE="GPL-2"
15 22
SLOT="0"
16
KEYWORDS="~amd64 ~x86"
17
IUSE="debug doc libtomcrypt lua postgres radius shaper snmp valgrind"
23
IUSE="debug doc lua postgres radius shaper snmp valgrind"
18 24

  
19
RDEPEND="!libtomcrypt? ( dev-libs/openssl:0= )
20
	libtomcrypt? ( dev-libs/libtomcrypt:0= )
25
RDEPEND="
26
	dev-libs/libpcre2
27
	dev-libs/openssl:0=
21 28
	lua? ( ${LUA_DEPS} )
22 29
	postgres? ( dev-db/postgresql:* )
23 30
	snmp? ( net-analyzer/net-snmp )
24
	dev-libs/libpcre"
31
"
25 32
DEPEND="${RDEPEND}
26 33
	valgrind? ( dev-debug/valgrind )"
27 34
PDEPEND="net-dialup/ppp-scripts"
......
33 40
REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )
34 41
	valgrind? ( debug )"
35 42

  
36
PATCHES=(
37
	"${FILESDIR}/${PN}-1.11.1-socklen.patch"
38
)
39

  
40
S="${WORKDIR}"
41

  
42 43
pkg_setup() {
43 44
	linux-mod-r1_pkg_setup
44 45
	set_arch_to_kernel
45 46
	use lua && lua-single_pkg_setup
46 47
}
47 48

  
48
src_prepare() {
49
	sed -i  -e "/mkdir/d" \
50
		-e "s: RENAME accel-ppp.conf.dist::" accel-pppd/CMakeLists.txt || die 'sed on accel-pppd/CMakeLists.txt failed'
51

  
52
	# Do not install kernel modules like that - breaks sandbox!
53
	sed -i -e '/modules_install/d' \
54
		drivers/ipoe/CMakeLists.txt \
55
		drivers/vlan_mon/CMakeLists.txt || die
56

  
57
	# Fix version
58
	sed -i -e "s/1.11/${PV}/" drivers/ipoe/ipoe.c || die
59
	sed -i -e "s/1.11/${PV}/" drivers/vlan_mon/vlan_mon.c || die
60

  
61
	# Bug #549918
62
	append-ldflags -Wl,-z,lazy
63

  
64
	cmake_src_prepare
65
}
66

  
67 49
src_configure() {
50
	append-ldflags -Wl,-z,lazy # Bug #549918
68 51
	local libdir="$(get_libdir)"
69 52
	local mycmakeargs=(
70 53
		-DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
71 54
		-DCMAKE_INSTALL_LOCALSTATEDIR="${EPREFIX}/var"
72 55
		-DLIB_SUFFIX="${libdir#lib}"
73
		-DBUILD_IPOE_DRIVER="$(usex ipoe)"
56
		# modules handled by linux-mod
57
		-DBUILD_IPOE_DRIVER=no
74 58
		-DBUILD_PPTP_DRIVER=no
75
		-DBUILD_VLAN_MON_DRIVER="$(usex ipoe)"
76
		-DCRYPTO="$(usex libtomcrypt TOMCRYPT OPENSSL)"
59
		-DBUILD_VLAN_MON_DRIVER=no
60
		-DCRYPTO_LIBRARY=OPENSSL
77 61
		-DLOG_PGSQL="$(usex postgres)"
78 62
		-DLUA="$(usex lua TRUE FALSE)"
79 63
		-DMEMDEBUG="$(usex debug)"
......
85 69
	cmake_src_configure
86 70
}
87 71

  
88
src_compile() {
89
	local modlist=( ipoe=accel-ppp:drivers/ipoe vlan_mon=accel-ppp:drivers/vlan_mon )
72
build_modules() {
73
	local mod modlist
74
	for mod in ipoe vlan_mon; do
75
		# see bug #971394
76
		ln -s "${BUILD_DIR}"/version.h drivers/${mod} || die
77
		local modlist+=( ${mod}=accel-ppp:drivers/${mod} )
78
	done
90 79
	MODULES_MAKEARGS+=(
91 80
		KDIR="${KV_OUT_DIR}"
92 81
	)
93 82
	linux-mod-r1_src_compile
83
}
84

  
85
src_compile() {
86
	use ipoe && build_modules
94 87
	cmake_src_compile
88

  
95 89
}
96 90

  
97 91
src_install() {
......
105 99
		doins accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt
106 100
	fi
107 101

  
102
	mv "${ED}"/etc/accel-ppp.conf{.dist,} || die
103

  
108 104
	newinitd "${FILESDIR}"/${PN}.initd ${PN}d
109 105
	newconfd "${FILESDIR}"/${PN}.confd ${PN}d
110 106

  
Thank you!