1 |
commit: e448a0c3088ea0088b62f9b16debaccbba4d3334 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 11 06:38:52 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 11 06:38:52 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e448a0c3 |
7 |
|
8 |
net-misc/ntpsec: add 1.2.1 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/795321 |
11 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
12 |
|
13 |
net-misc/ntpsec/Manifest | 1 + |
14 |
net-misc/ntpsec/ntpsec-1.2.1.ebuild | 169 ++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 170 insertions(+) |
16 |
|
17 |
diff --git a/net-misc/ntpsec/Manifest b/net-misc/ntpsec/Manifest |
18 |
index 4f7af2898d2..01c84429c97 100644 |
19 |
--- a/net-misc/ntpsec/Manifest |
20 |
+++ b/net-misc/ntpsec/Manifest |
21 |
@@ -1 +1,2 @@ |
22 |
DIST ntpsec-1.2.0.tar.gz 2625968 BLAKE2B 23ceae5a1f241fcf5a17801fec2f15f9b9d9d64a108bebe29bdc75196303091eaf0efee7df67ce10acefb7c8dba90ce1144a0c0c5432797d7659714d162f26bb SHA512 9e18b3ca2f786a1ea323ba2384b51cff3d862115cea1ae576fc98172c476ac5e7d0d0fc873e47be0b19b050204ea9ed49669d94e66eb94525068dd1b08a8ae71 |
23 |
+DIST ntpsec-1.2.1.tar.gz 2681237 BLAKE2B bfb2674131718dcf9f393e93d1148cfb6631591dbcce1ade91746586f261123b80b238393ac2a763fab119cd627f8eae4b006b023ad2b319e752db9eb4b04cc0 SHA512 0b8b0bda52d3025f6e9a06c00b1e0c25c595ada72b87ed0e5d3d6f77a034f557745156bc6d9a263c9876c041efffa38d42fa93ba8bfda31f67efbd842a726277 |
24 |
|
25 |
diff --git a/net-misc/ntpsec/ntpsec-1.2.1.ebuild b/net-misc/ntpsec/ntpsec-1.2.1.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..593fe355639 |
28 |
--- /dev/null |
29 |
+++ b/net-misc/ntpsec/ntpsec-1.2.1.ebuild |
30 |
@@ -0,0 +1,169 @@ |
31 |
+# Copyright 1999-2021 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=7 |
35 |
+ |
36 |
+PYTHON_COMPAT=( python3_{7..9} ) |
37 |
+PYTHON_REQ_USE='threads(+)' |
38 |
+DISTUTILS_USE_SETUPTOOLS=no |
39 |
+ |
40 |
+inherit distutils-r1 flag-o-matic waf-utils systemd |
41 |
+ |
42 |
+if [[ ${PV} == *9999* ]]; then |
43 |
+ inherit git-r3 |
44 |
+ EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git" |
45 |
+else |
46 |
+ SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${PN}-${PV}.tar.gz" |
47 |
+ RESTRICT="mirror" |
48 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
49 |
+fi |
50 |
+ |
51 |
+DESCRIPTION="The NTP reference implementation, refactored" |
52 |
+HOMEPAGE="https://www.ntpsec.org/" |
53 |
+ |
54 |
+NTPSEC_REFCLOCK=( |
55 |
+ oncore trimble truetime gpsd jjy generic spectracom |
56 |
+ shm pps hpgps zyfer arbiter nmea neoclock modem |
57 |
+ local) |
58 |
+ |
59 |
+IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_} |
60 |
+ |
61 |
+LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0" |
62 |
+SLOT="0" |
63 |
+IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear tests" #ionice |
64 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" |
65 |
+ |
66 |
+# net-misc/pps-tools oncore,pps |
67 |
+CDEPEND="${PYTHON_DEPS} |
68 |
+ sys-libs/libcap |
69 |
+ dev-python/psutil[${PYTHON_USEDEP}] |
70 |
+ libbsd? ( dev-libs/libbsd:0= ) |
71 |
+ dev-libs/openssl:0= |
72 |
+ seccomp? ( sys-libs/libseccomp ) |
73 |
+" |
74 |
+RDEPEND="${CDEPEND} |
75 |
+ ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) |
76 |
+ !net-misc/ntp |
77 |
+ !net-misc/openntpd |
78 |
+ acct-group/ntp |
79 |
+ acct-user/ntp |
80 |
+" |
81 |
+DEPEND="${CDEPEND} |
82 |
+ >=app-text/asciidoc-8.6.8 |
83 |
+ dev-libs/libxslt |
84 |
+ app-text/docbook-xsl-stylesheets |
85 |
+ sys-devel/bison |
86 |
+ rclock_oncore? ( net-misc/pps-tools ) |
87 |
+ rclock_pps? ( net-misc/pps-tools ) |
88 |
+" |
89 |
+ |
90 |
+PATCHES=( |
91 |
+ "${FILESDIR}/${PN}-1.1.8-fix-missing-scmp_sys-on-aarch64.patch" |
92 |
+ "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch" |
93 |
+ "${FILESDIR}/${PN}-1.2.0-move-newfstatat.patch" |
94 |
+ "${FILESDIR}/${PN}-1.2.0-seccomp.patch" |
95 |
+) |
96 |
+ |
97 |
+WAF_BINARY="${S}/waf" |
98 |
+ |
99 |
+src_prepare() { |
100 |
+ default |
101 |
+ |
102 |
+ # Remove autostripping of binaries |
103 |
+ sed -i -e '/Strip binaries/d' wscript || die |
104 |
+ if ! use libbsd ; then |
105 |
+ eapply "${FILESDIR}/${PN}-no-bsd.patch" |
106 |
+ fi |
107 |
+ # remove extra default pool servers |
108 |
+ sed -i '/use-pool/s/^/#/' "${S}"/etc/ntp.d/default.conf || die |
109 |
+ |
110 |
+ python_copy_sources |
111 |
+} |
112 |
+ |
113 |
+src_configure() { |
114 |
+ is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin |
115 |
+ |
116 |
+ local string_127="" |
117 |
+ local rclocks=""; |
118 |
+ local CLOCKSTRING="" |
119 |
+ |
120 |
+ for refclock in ${NTPSEC_REFCLOCK[@]} ; do |
121 |
+ if use rclock_${refclock} ; then |
122 |
+ string_127+="$refclock," |
123 |
+ fi |
124 |
+ done |
125 |
+ CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`" |
126 |
+ |
127 |
+ local myconf=( |
128 |
+ --nopyc |
129 |
+ --nopyo |
130 |
+ --enable-pylib ext |
131 |
+ --refclock="${CLOCKSTRING}" |
132 |
+ #--build-epoch="$(date +%s)" |
133 |
+ $(use doc || echo "--disable-doc") |
134 |
+ $(use early && echo "--enable-early-droproot") |
135 |
+ $(use gdb && echo "--enable-debug-gdb") |
136 |
+ $(use samba && echo "--enable-mssntp") |
137 |
+ $(use seccomp && echo "--enable-seccomp") |
138 |
+ $(use smear && echo "--enable-leap-smear") |
139 |
+ $(use tests && echo "--alltests") |
140 |
+ $(use debug && echo "--enable-debug") |
141 |
+ ) |
142 |
+ |
143 |
+ python_configure() { |
144 |
+ waf-utils_src_configure "${myconf[@]}" |
145 |
+ } |
146 |
+ python_foreach_impl run_in_build_dir python_configure |
147 |
+} |
148 |
+ |
149 |
+src_compile() { |
150 |
+ unset MAKEOPTS |
151 |
+ python_compile() { |
152 |
+ waf-utils_src_compile |
153 |
+ } |
154 |
+ python_foreach_impl run_in_build_dir python_compile |
155 |
+} |
156 |
+ |
157 |
+src_install() { |
158 |
+ python_install() { |
159 |
+ waf-utils_src_install |
160 |
+ python_fix_shebang "${ED}" |
161 |
+ } |
162 |
+ python_foreach_impl run_in_build_dir python_install |
163 |
+ python_foreach_impl python_optimize |
164 |
+ |
165 |
+ # Install heat generating scripts |
166 |
+ use heat && dosbin "${S}"/contrib/ntpheat{,usb} |
167 |
+ |
168 |
+ # Install the openrc files |
169 |
+ newinitd "${FILESDIR}"/ntpd.rc-r2 ntp |
170 |
+ newconfd "${FILESDIR}"/ntpd.confd ntp |
171 |
+ |
172 |
+ # Install the systemd unit file |
173 |
+ systemd_newunit "${FILESDIR}"/ntpd-r1.service ntpd.service |
174 |
+ |
175 |
+ # Prepare a directory for the ntp.drift file |
176 |
+ mkdir -pv "${ED}"/var/lib/ntp |
177 |
+ chown ntp:ntp "${ED}"/var/lib/ntp |
178 |
+ chmod 770 "${ED}"/var/lib/ntp |
179 |
+ keepdir /var/lib/ntp |
180 |
+ |
181 |
+ # Install a log rotate script |
182 |
+ mkdir -pv "${ED}"/etc/logrotate.d |
183 |
+ cp -v "${S}"/etc/logrotate-config.ntpd "${ED}"/etc/logrotate.d/ntpd |
184 |
+ |
185 |
+ # Install the configuration file and sample configuration |
186 |
+ cp -v "${FILESDIR}"/ntp.conf "${ED}"/etc/ntp.conf |
187 |
+ cp -Rv "${S}"/etc/ntp.d/ "${ED}"/etc/ |
188 |
+ |
189 |
+ # move doc files to /usr/share/doc/"${P}" |
190 |
+ use doc && mv -v "${ED}"/usr/share/doc/"${PN}" "${ED}"/usr/share/doc/"${P}"/html |
191 |
+} |
192 |
+ |
193 |
+pkg_postinst() { |
194 |
+ einfo "If you want to serve time on your local network, then" |
195 |
+ einfo "you should disable all the ref_clocks unless you have" |
196 |
+ einfo "one and can get stable time from it. Feel free to try" |
197 |
+ einfo "it but PPS probably won't work unless you have a UART" |
198 |
+ einfo "GPS that actually provides PPS messages." |
199 |
+} |