Diff ntpsec-1.2.2a with a ntpsec-9999

/usr/portage/net-misc/ntpsec/ntpsec-9999.ebuild 2024-07-02 13:51:48.445851570 +0300
4 4
EAPI=8
5 5

  
6 6
DISTUTILS_EXT=1
7
PYTHON_COMPAT=( python3_{10..11} )
7
DISTUTILS_USE_PEP517="flit"
8
PYTHON_COMPAT=( python3_{10..13} )
8 9
PYTHON_REQ_USE='threads(+)'
9
DISTUTILS_USE_SETUPTOOLS=no
10 10

  
11
inherit distutils-r1 flag-o-matic waf-utils systemd
11
inherit distutils-r1 flag-o-matic multiprocessing waf-utils systemd
12 12

  
13
if [[ ${PV} == *9999* ]]; then
13
if [[ ${PV} == 9999 ]]; then
14 14
	inherit git-r3
15 15
	EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git"
16 16
else
......
20 20
		https://ftp.ntpsec.org/pub/releases/${P}.tar.gz
21 21
		verify-sig? ( https://ftp.ntpsec.org/pub/releases/${P}.tar.gz.asc )
22 22
	"
23
	KEYWORDS="amd64 arm arm64 ~riscv ~x86"
23
	KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
24 24

  
25 25
	BDEPEND="verify-sig? ( sec-keys/openpgp-keys-ntpsec )"
26 26
fi
......
36 36
	shm pps hpgps zyfer arbiter nmea modem local
37 37
)
38 38

  
39
IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_}
40

  
41
IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear" #ionice
42
REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )"
39
IUSE="${NTPSEC_REFCLOCK[@]} debug doc early heat libbsd nist ntpviz samba seccomp smear test" #ionice
40
REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( local )"
41
RESTRICT="!test? ( test )"
43 42

  
44 43
# net-misc/pps-tools oncore,pps
45 44
DEPEND="
......
49 48
	sys-libs/libcap
50 49
	libbsd? ( dev-libs/libbsd:0= )
51 50
	seccomp? ( sys-libs/libseccomp )
52
	rclock_oncore? ( net-misc/pps-tools )
53
	rclock_pps? ( net-misc/pps-tools )
51
	oncore? ( net-misc/pps-tools )
52
	pps? ( net-misc/pps-tools )
54 53
"
55 54
RDEPEND="
56 55
	${DEPEND}
......
73 72
PATCHES=(
74 73
	"${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch"
75 74
	"${FILESDIR}/${PN}-1.2.2-logrotate.patch"
75
	"${FILESDIR}/${PN}-1.2.3-pep517-no-egg.patch"
76 76
)
77 77

  
78 78
WAF_BINARY="${S}/waf"
79 79

  
80
src_unpack() {
81
	if [[ ${PV} == 9999 ]] ; then
82
		git-r3_src_unpack
83
	elif use verify-sig ; then
84
		# Needed for downloaded waf which is unsigned
85
		verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
86
	fi
87

  
88
	default
89
}
90

  
80 91
src_prepare() {
81 92
	default
82 93

  
......
87 98
	fi
88 99
	# remove extra default pool servers
89 100
	sed -i '/use-pool/s/^/#/' "${S}"/etc/ntp.d/default.conf || die
90

  
91
	python_copy_sources
92 101
}
93 102

  
94 103
src_configure() {
......
99 108
	local CLOCKSTRING=""
100 109

  
101 110
	for refclock in ${NTPSEC_REFCLOCK[@]} ; do
102
		if use rclock_${refclock} ; then
111
		if use ${refclock} ; then
103 112
			string_127+="$refclock,"
104 113
		fi
105 114
	done
......
109 118
		--notests
110 119
		--nopyc
111 120
		--nopyo
112
		--enable-pylib ext
113 121
		--refclock="${CLOCKSTRING}"
114 122
		#--build-epoch="$(date +%s)"
115 123
		$(use doc	|| echo "--disable-doc")
116 124
		$(use early	&& echo "--enable-early-droproot")
117
		$(use gdb	&& echo "--enable-debug-gdb")
118 125
		$(use samba	&& echo "--enable-mssntp")
119 126
		$(use seccomp	&& echo "--enable-seccomp")
120 127
		$(use smear	&& echo "--enable-leap-smear")
121 128
		$(use debug	&& echo "--enable-debug")
122 129
	)
123

  
124
	distutils-r1_src_configure
125
}
126

  
127
python_configure() {
130
	python_setup
131
	cp -v "${FILESDIR}/flit.toml" "pylib/pyproject.toml" || die
128 132
	waf-utils_src_configure "${myconf[@]}"
129 133
}
130 134

  
131
python_compile() {
135
src_compile() {
132 136
	waf-utils_src_compile --notests
137

  
138
	ln -svf pylib build/main/ntp || die
139
	cd build/main || die
140
	distutils-r1_src_compile
141
}
142

  
143
src_test() {
144
	cd build/main || die
145
	distutils-r1_src_test
133 146
}
134 147

  
135 148
python_test() {
136
	waf-utils_src_compile check
149
	"${EPYTHON}" "${WAF_BINARY}" check -v -j $(makeopts_jobs) || die
137 150
}
138 151

  
139 152
src_install() {
140
	distutils-r1_src_install
141

  
142 153
	# Install heat generating scripts
143 154
	use heat && dosbin "${S}"/contrib/ntpheat{,usb}
144 155

  
......
165 176

  
166 177
	# move doc files to /usr/share/doc/"${P}"
167 178
	use doc && mv -v "${ED}"/usr/share/doc/"${PN}" "${ED}"/usr/share/doc/"${P}"/html
168
}
169 179

  
170
python_install() {
180
	ln -svf pylib build/main/ntp || die
181
	distutils-r1_src_install
171 182
	waf-utils_src_install --notests
172 183
	python_fix_shebang "${ED}"
173 184
	python_optimize
Thank you!