mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-24 16:01:09 +02:00
net-misc/ntp: apply CoreOS changes to 4.2.8_p8
This commit is contained in:
parent
5d45972617
commit
d0627d7d49
@ -15,7 +15,7 @@ SRC_URI="http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-${PV:0:3}/${MY_P}.tar
|
||||
LICENSE="HPND BSD ISC"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~m68k-mint"
|
||||
IUSE="caps debug ipv6 libressl openntpd parse-clocks readline samba selinux snmp ssl +threads vim-syntax zeroconf"
|
||||
IUSE="caps debug ipv6 libressl openntpd parse-clocks perl readline samba selinux snmp ssl threads vim-syntax zeroconf"
|
||||
|
||||
CDEPEND="readline? ( >=sys-libs/readline-4.1:0= )
|
||||
>=dev-libs/libevent-2.0.9[threads?]
|
||||
@ -50,6 +50,7 @@ pkg_setup() {
|
||||
|
||||
src_prepare() {
|
||||
epatch "${PATCHES[@]}"
|
||||
use perl || epatch "${FILESDIR}"/${PN}-4.2.8-disable-perl-scripts.patch
|
||||
append-cppflags -D_GNU_SOURCE #264109
|
||||
# Make sure every build uses the same install layout. #539092
|
||||
find sntp/loc/ -type f '!' -name legacy -delete || die
|
||||
@ -92,19 +93,10 @@ src_install() {
|
||||
dodoc INSTALL WHERE-TO-START
|
||||
doman "${WORKDIR}"/man/*.[58]
|
||||
|
||||
insinto /etc
|
||||
insinto /usr/share/ntp
|
||||
doins "${FILESDIR}"/ntp.conf
|
||||
use ipv6 || sed -i '/^restrict .*::1/d' "${ED}"/etc/ntp.conf #524726
|
||||
newinitd "${FILESDIR}"/ntpd.rc-r1 ntpd
|
||||
newconfd "${FILESDIR}"/ntpd.confd ntpd
|
||||
newinitd "${FILESDIR}"/ntp-client.rc ntp-client
|
||||
newconfd "${FILESDIR}"/ntp-client.confd ntp-client
|
||||
newinitd "${FILESDIR}"/sntp.rc sntp
|
||||
newconfd "${FILESDIR}"/sntp.confd sntp
|
||||
if ! use caps ; then
|
||||
sed -i "s|-u ntp:ntp||" "${ED}"/etc/conf.d/ntpd || die
|
||||
fi
|
||||
sed -i "s:/usr/bin:/usr/sbin:" "${ED}"/etc/init.d/ntpd || die
|
||||
systemd_newtmpfilesd "${FILESDIR}"/ntp.tmpfiles ntp.conf
|
||||
use ipv6 || sed -i '/^restrict .*::1/d' "${ED}"/usr/share/ntp/ntp.conf #524726
|
||||
|
||||
keepdir /var/lib/ntp
|
||||
use prefix || fowners ntp:ntp /var/lib/ntp
|
||||
@ -113,25 +105,13 @@ src_install() {
|
||||
cd "${ED}"
|
||||
rm usr/sbin/ntpd || die
|
||||
rm -r var/lib
|
||||
rm etc/{conf,init}.d/ntpd
|
||||
rm usr/share/man/*/ntpd.8 || die
|
||||
else
|
||||
systemd_newunit "${FILESDIR}"/ntpd.service-r2 ntpd.service
|
||||
systemd_dounit "${FILESDIR}"/ntpd.service
|
||||
use caps && sed -i '/ExecStart/ s|$| -u ntp:ntp|' "${ED}"/usr/lib/systemd/system/ntpd.service
|
||||
systemd_enable_ntpunit 60-ntpd ntpd.service
|
||||
fi
|
||||
|
||||
systemd_newunit "${FILESDIR}"/ntpdate.service-r1 ntpdate.service
|
||||
systemd_install_serviced "${FILESDIR}"/ntpdate.service.conf
|
||||
systemd_newunit "${FILESDIR}"/sntp.service-r2 sntp.service
|
||||
systemd_install_serviced "${FILESDIR}"/sntp.service.conf
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
if grep -qs '^[^#].*notrust' "${EROOT}"/etc/ntp.conf ; then
|
||||
eerror "The notrust option was found in your /etc/ntp.conf!"
|
||||
ewarn "If your ntpd starts sending out weird responses,"
|
||||
ewarn "then make sure you have keys properly setup and see"
|
||||
ewarn "https://bugs.gentoo.org/41827"
|
||||
fi
|
||||
systemd_dounit "${FILESDIR}"/ntpdate.service
|
||||
systemd_dounit "${FILESDIR}"/sntp.service
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user