Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/ntp/
Date: Wed, 28 Aug 2019 17:05:27
Message-Id: 1567011917.0f23ac2925920840a2aa28278f3661e2915afdd6.candrews@gentoo
1 commit: 0f23ac2925920840a2aa28278f3661e2915afdd6
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 27 18:58:08 2019 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 28 17:05:17 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f23ac29
7
8 net-misc/ntp: EAPI=7, Use GLEP 81 for user/group instead of user eclass
9
10 Package-Manager: Portage-2.3.73, Repoman-2.3.17
11 Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>
12
13 net-misc/ntp/ntp-4.2.8_p13-r2.ebuild | 145 +++++++++++++++++++++++++++++++++++
14 1 file changed, 145 insertions(+)
15
16 diff --git a/net-misc/ntp/ntp-4.2.8_p13-r2.ebuild b/net-misc/ntp/ntp-4.2.8_p13-r2.ebuild
17 new file mode 100644
18 index 00000000000..40f035bdcd4
19 --- /dev/null
20 +++ b/net-misc/ntp/ntp-4.2.8_p13-r2.ebuild
21 @@ -0,0 +1,145 @@
22 +# Copyright 1999-2019 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +inherit autotools toolchain-funcs flag-o-matic systemd
28 +
29 +MY_P=${P/_p/p}
30 +DESCRIPTION="Network Time Protocol suite/programs"
31 +HOMEPAGE="http://www.ntp.org/"
32 +SRC_URI="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${PV:0:3}/${MY_P}.tar.gz
33 + https://dev.gentoo.org/~polynomial-c/${MY_P}-manpages.tar.xz"
34 +
35 +LICENSE="HPND BSD ISC"
36 +SLOT="0"
37 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint"
38 +IUSE="caps debug ipv6 libressl openntpd parse-clocks readline samba selinux snmp ssl +threads vim-syntax zeroconf"
39 +
40 +COMMON_DEPEND="readline? ( >=sys-libs/readline-4.1:0= )
41 + >=dev-libs/libevent-2.0.9:=[threads?]
42 + kernel_linux? ( caps? ( sys-libs/libcap ) )
43 + zeroconf? ( net-dns/avahi[mdnsresponder-compat] )
44 + snmp? ( net-analyzer/net-snmp )
45 + ssl? (
46 + !libressl? ( dev-libs/openssl:0= )
47 + libressl? ( dev-libs/libressl:0= )
48 + )
49 + parse-clocks? ( net-misc/pps-tools )"
50 +BDEPEND="virtual/pkgconfig
51 + acct-group/ntp
52 + acct-user/ntp"
53 +DEPEND="${COMMON_DEPEND}"
54 +RDEPEND="${COMMON_DEPEND}
55 + acct-group/ntp
56 + acct-user/ntp
57 + selinux? ( sec-policy/selinux-ntp )
58 + vim-syntax? ( app-vim/ntp-syntax )
59 + !net-misc/ntpsec
60 + !openntpd? ( !net-misc/openntpd )
61 +"
62 +PDEPEND="openntpd? ( net-misc/openntpd )"
63 +
64 +S="${WORKDIR}/${MY_P}"
65 +
66 +PATCHES=(
67 + "${FILESDIR}"/${PN}-4.2.8-ipc-caps.patch #533966
68 + "${FILESDIR}"/${PN}-4.2.8-sntp-test-pthreads.patch #563922
69 + "${FILESDIR}"/${PN}-4.2.8_p10-fix-build-wo-ssl-or-libressl.patch
70 + "${FILESDIR}"/${PN}-4.2.8_p12-libressl-2.8.patch
71 +)
72 +
73 +src_prepare() {
74 + default
75 + append-cppflags -D_GNU_SOURCE #264109
76 + # Make sure every build uses the same install layout. #539092
77 + find sntp/loc/ -type f '!' -name legacy -delete || die
78 + eautoreconf #622754
79 + # Disable pointless checks.
80 + touch .checkChangeLog .gcc-warning FRC.html html/.datecheck
81 +}
82 +
83 +src_configure() {
84 + # avoid libmd5/libelf
85 + export ac_cv_search_MD5Init=no ac_cv_header_md5_h=no
86 + export ac_cv_lib_elf_nlist=no
87 + # blah, no real configure options #176333
88 + export ac_cv_header_dns_sd_h=$(usex zeroconf)
89 + export ac_cv_lib_dns_sd_DNSServiceRegister=${ac_cv_header_dns_sd_h}
90 + # Increase the default memlimit from 32MiB to 128MiB. #533232
91 + local myeconfargs=(
92 + --with-lineeditlibs=readline,edit,editline
93 + --with-yielding-select
94 + --disable-local-libevent
95 + --docdir='$(datarootdir)'/doc/${PF}
96 + --htmldir='$(docdir)/html'
97 + --with-memlock=256
98 + $(use_enable caps linuxcaps)
99 + $(use_enable parse-clocks)
100 + $(use_enable ipv6)
101 + $(use_enable debug debugging)
102 + $(use_with readline lineeditlibs readline)
103 + $(use_enable samba ntp-signd)
104 + $(use_with snmp ntpsnmpd)
105 + $(use_with ssl crypto)
106 + $(use_enable threads thread-support)
107 + )
108 + econf "${myeconfargs[@]}"
109 +}
110 +
111 +src_install() {
112 + default
113 + # move ntpd/ntpdate to sbin #66671
114 + dodir /usr/sbin
115 + mv "${ED}"/usr/bin/{ntpd,ntpdate} "${ED}"/usr/sbin/ || die "move to sbin"
116 +
117 + dodoc INSTALL WHERE-TO-START
118 + doman "${WORKDIR}"/man/*.[58]
119 +
120 + insinto /etc
121 + doins "${FILESDIR}"/ntp.conf
122 + use ipv6 || sed -i '/^restrict .*::1/d' "${ED}"/etc/ntp.conf #524726
123 + newinitd "${FILESDIR}"/ntpd.rc-r1 ntpd
124 + newconfd "${FILESDIR}"/ntpd.confd ntpd
125 + newinitd "${FILESDIR}"/ntp-client.rc ntp-client
126 + newconfd "${FILESDIR}"/ntp-client.confd ntp-client
127 + newinitd "${FILESDIR}"/sntp.rc sntp
128 + newconfd "${FILESDIR}"/sntp.confd sntp
129 + if ! use caps ; then
130 + sed -i "s|-u ntp:ntp||" "${ED}"/etc/conf.d/ntpd || die
131 + fi
132 + sed -i "s:/usr/bin:/usr/sbin:" "${ED}"/etc/init.d/ntpd || die
133 +
134 + keepdir /var/lib/ntp
135 + use prefix || fowners ntp:ntp /var/lib/ntp
136 +
137 + if use openntpd ; then
138 + cd "${ED}" || die
139 + rm usr/sbin/ntpd || die
140 + rm -r var/lib || die
141 + rm etc/{conf,init}.d/ntpd || die
142 + rm usr/share/man/*/ntpd.8 || die
143 + else
144 + systemd_newunit "${FILESDIR}"/ntpd.service-r2 ntpd.service
145 + if use caps ; then
146 + sed -i '/ExecStart/ s|$| -u ntp:ntp|' \
147 + "${D%/}$(systemd_get_systemunitdir)"/ntpd.service \
148 + || die
149 + fi
150 + systemd_enable_ntpunit 60-ntpd ntpd.service
151 + fi
152 +
153 + systemd_newunit "${FILESDIR}"/ntpdate.service-r2 ntpdate.service
154 + systemd_install_serviced "${FILESDIR}"/ntpdate.service.conf
155 + systemd_newunit "${FILESDIR}"/sntp.service-r3 sntp.service
156 + systemd_install_serviced "${FILESDIR}"/sntp.service.conf
157 +}
158 +
159 +pkg_postinst() {
160 + if grep -qs '^[^#].*notrust' "${EROOT}"/etc/ntp.conf ; then
161 + eerror "The notrust option was found in your /etc/ntp.conf!"
162 + ewarn "If your ntpd starts sending out weird responses,"
163 + ewarn "then make sure you have keys properly setup and see"
164 + ewarn "https://bugs.gentoo.org/41827"
165 + fi
166 +}