1 |
commit: 9b7ca33d42324b4d7433ed50405b29aa21ae3c69 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 24 23:34:41 2018 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 24 23:34:41 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b7ca33d |
7 |
|
8 |
net-misc/ntpsec: add -9999 |
9 |
|
10 |
Package-Manager: Portage-2.3.19, Repoman-2.3.6 |
11 |
|
12 |
net-misc/ntpsec/ntpsec-9999.ebuild | 138 +++++++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 138 insertions(+) |
14 |
|
15 |
diff --git a/net-misc/ntpsec/ntpsec-9999.ebuild b/net-misc/ntpsec/ntpsec-9999.ebuild |
16 |
new file mode 100644 |
17 |
index 00000000000..46136f2fa0e |
18 |
--- /dev/null |
19 |
+++ b/net-misc/ntpsec/ntpsec-9999.ebuild |
20 |
@@ -0,0 +1,138 @@ |
21 |
+# Copyright 1999-2018 Gentoo Foundation |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=6 |
25 |
+ |
26 |
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) |
27 |
+PYTHON_REQ_USE='threads(+)' |
28 |
+ |
29 |
+inherit flag-o-matic python-r1 waf-utils systemd user |
30 |
+ |
31 |
+if [[ ${PV} == *9999* ]]; then |
32 |
+ inherit git-r3 |
33 |
+ EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git" |
34 |
+ BDEPEND="" |
35 |
+ KEYWORDS="" |
36 |
+else |
37 |
+ SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${PN}-${PV}.tar.gz" |
38 |
+ RESTRICT="mirror" |
39 |
+ BDEPEND="" |
40 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
41 |
+fi |
42 |
+ |
43 |
+DESCRIPTION="The NTP reference implementation, refactored" |
44 |
+HOMEPAGE="https://www.ntpsec.org/" |
45 |
+ |
46 |
+NTPSEC_REFCLOCK=( |
47 |
+ oncore trimble truetime gpsd jjy generic spectracom |
48 |
+ shm pps hpgps zyfer arbiter nmea neoclock modem |
49 |
+ local) |
50 |
+ |
51 |
+IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_} |
52 |
+ |
53 |
+LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0" |
54 |
+SLOT="0" |
55 |
+IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libressl nist ntpviz samba seccomp smear tests" #ionice |
56 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
57 |
+ |
58 |
+# net-misc/pps-tools oncore,pps |
59 |
+CDEPEND="${PYTHON_DEPS} |
60 |
+ ${BDEPEND} |
61 |
+ sys-libs/libcap |
62 |
+ dev-python/psutil[${PYTHON_USEDEP}] |
63 |
+ libressl? ( dev-libs/libressl:0= ) |
64 |
+ !libressl? ( dev-libs/openssl:0= ) |
65 |
+ seccomp? ( sys-libs/libseccomp ) |
66 |
+" |
67 |
+RDEPEND="${CDEPEND} |
68 |
+ ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) |
69 |
+" |
70 |
+DEPEND="${CDEPEND} |
71 |
+ app-text/asciidoc |
72 |
+ app-text/docbook-xsl-stylesheets |
73 |
+ sys-devel/bison |
74 |
+ rclock_oncore? ( net-misc/pps-tools ) |
75 |
+ rclock_pps? ( net-misc/pps-tools ) |
76 |
+ !net-misc/ntp |
77 |
+ !net-misc/openntpd |
78 |
+" |
79 |
+ |
80 |
+pkg_setup() { |
81 |
+ enewgroup ntp 123 |
82 |
+ enewuser ntp 123 -1 /dev/null ntp |
83 |
+} |
84 |
+ |
85 |
+src_prepare() { |
86 |
+ default |
87 |
+ python_copy_sources |
88 |
+} |
89 |
+ |
90 |
+src_configure() { |
91 |
+ is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin |
92 |
+ |
93 |
+ local string_127="" |
94 |
+ local rclocks=""; |
95 |
+ local CLOCKSTRING="" |
96 |
+ |
97 |
+ for refclock in ${NTPSEC_REFCLOCK[@]} ; do |
98 |
+ if use rclock_${refclock} ; then |
99 |
+ string_127+="$refclock," |
100 |
+ fi |
101 |
+ done |
102 |
+ CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`" |
103 |
+ |
104 |
+ # Remove autostripping of binaries |
105 |
+ sed -i -e '/Strip binaries/d' wscript |
106 |
+ |
107 |
+ local myconf=( |
108 |
+ --nopyc |
109 |
+ --nopyo |
110 |
+ --refclock="${CLOCKSTRING}" |
111 |
+ $(use doc && echo "--enable-doc") |
112 |
+ $(use early && echo "--enable-early-droproot") |
113 |
+ $(use gdb && echo "--enable-debug-gdb") |
114 |
+ $(use nist && echo "--enable-lockclock") |
115 |
+ $(use samba && echo "--enable-mssntp") |
116 |
+ $(use seccomp && echo "--enable-seccomp") |
117 |
+ $(use smear && echo "--enable-leap-smear") |
118 |
+ $(use tests && echo "--alltests") |
119 |
+ $(use_enable debug debug) ) |
120 |
+ |
121 |
+ python_configure() { |
122 |
+ waf-utils_src_configure "${myconf[@]}" |
123 |
+ } |
124 |
+ python_foreach_impl run_in_build_dir python_configure |
125 |
+} |
126 |
+ |
127 |
+src_compile() { |
128 |
+ python_compile() { |
129 |
+ waf-utils_src_compile |
130 |
+ } |
131 |
+ python_foreach_impl run_in_build_dir python_compile |
132 |
+} |
133 |
+ |
134 |
+src_install() { |
135 |
+ python_install() { |
136 |
+ waf-utils_src_install |
137 |
+ } |
138 |
+ python_foreach_impl run_in_build_dir python_install |
139 |
+ |
140 |
+ # Install heat generating scripts |
141 |
+ use heat && dosbin "${S}/contrib/ntpheat"{,usb} |
142 |
+ |
143 |
+ # Install the openrc files |
144 |
+ newinitd "${FILESDIR}/ntpd.rc-r1" "ntp" |
145 |
+ newconfd "${FILESDIR}/ntpd.confd" "ntp" |
146 |
+ |
147 |
+ # Install the systemd unit file |
148 |
+ systemd_newunit "${FILESDIR}/ntpd.service" ntpd.service |
149 |
+ |
150 |
+ # Install a log rotate script |
151 |
+ mkdir -pv "${ED}/etc/"logrotate.d |
152 |
+ cp -v "${S}/etc/logrotate-config.ntpd" "${ED}/etc/logrotate.d/ntpd" |
153 |
+ |
154 |
+ # Install the configuration files |
155 |
+ cp -Rv "${S}/etc/ntp.d/" "${ED}/etc/" |
156 |
+ mv -v "${ED}/etc/ntp.d/default.conf" "${ED}/etc/ntp.conf" |
157 |
+ sed "s|includefile |includefile ntp.d/|" -i "${ED}/etc/ntp.conf" |
158 |
+} |