Accepting request 384762 from home:markkp:branches:network:time

Lots of changes to prepare chrony for inclusion in SLES12 SP2.

OBS-URL: https://build.opensuse.org/request/show/384762
OBS-URL: https://build.opensuse.org/package/show/network:time/chrony?expand=0&rev=11
This commit is contained in:
Martin Pluskal 2016-04-06 08:53:39 +00:00 committed by Git OBS Bridge
parent 5d7a54988f
commit ac8323b394
6 changed files with 128 additions and 35 deletions

View File

@ -0,0 +1,10 @@
--- a/sys_linux.c
+++ b/sys_linux.c
@@ -50,6 +50,7 @@
#ifdef FEAT_SCFILTER
#include <sys/prctl.h>
#include <seccomp.h>
+#include <termios.h>
#ifdef FEAT_PHC
#include <linux/ptp_clock.h>
#endif

View File

@ -1,3 +1,29 @@
-------------------------------------------------------------------
Tue Apr 5 22:27:48 UTC 2016 - mpost@suse.com
- Removed %if for distributions that aren't building chrony.
- Renamed chrony-2.2_logrotate.patch to chrony-logrotate.patch since
the patch is not particularly version-dependent.
- Added clknetsim for "make check" processing.
- Added Buildrequires for gcc-c++ and timezone for building clknetsim
and running "make check".
- Changed Buildrequires and Requires to specify the minimum level of
libseccomp needed to build on s390x and ppc64le.
- Removed "-Recommends: timedatex" since I couldn't find any instance
of it anywhere in the build service.
- Modified the description to use some of the information from the
chrony web site.
- Added chrony-include-termios.patch so that it will build on ppc64le.
- Added make-105-ntpauth-more-reliable.patch so that "make check"
will not report a non-failure as a failure.
- Added --without-nss to ./configure to avoid "interruption code
0x2003B in chronyd" errors.
- Changed the symbolic links for rcchronyd and rcchronyd-wait to
point to the actual location of the service command, not the symlink
in /sbin.
- Added reference to chrony-dnssrv@.service in %pre, %preun, %post,
and %postun.
-------------------------------------------------------------------
Mon Mar 28 09:35:07 UTC 2016 - mpluskal@suse.com

View File

@ -11,24 +11,26 @@
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define vendorzone opensuse.
%if 0%{?suse_version} > 1230 || 0%{?rhel_version} > 600 || 0%{?centos_version} > 600 || 0%{?fedora_version} >= 20 || 0%{?el7}%{?fc20}%{?fc21}%{?fc22}
%if 0%{?suse_version} > 1230
%bcond_without systemd
%bcond_without syscallfilter
%else
%bcond_with systemd
%bcond_with syscallfilter
%endif
%global clknetsim_ver 96416d5
Name: chrony
Version: 2.3
Release: 0
Summary: System Clock Synchronization Client and Server
License: GPL-2.0+
Summary: System Clock Synchronization Client and Server
Group: Productivity/Networking/Other
Url: http://chrony.tuxfamily.org/
Source: http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
@ -38,11 +40,17 @@ Source3: chrony.dhclient
Source4: chrony.helper
Source5: chrony-dnssrv@.service
Source6: chrony-dnssrv@.timer
# Simulator for test suite
Source10: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0: chrony-config.patch
# add NTP servers from DHCP when starting service
# Add NTP servers from DHCP when starting service
Patch1: chrony-service-helper.patch
Patch2: chrony-2.2_logrotate.patch
Patch2: chrony-logrotate.patch
Patch3: chrony-include-termios.patch
Patch4: make-105-ntpauth-more-reliable.patch
#
BuildRequires: NetworkManager-devel
BuildRequires: bison
BuildRequires: libcap-devel
@ -50,17 +58,14 @@ BuildRequires: libedit-devel
BuildRequires: mozilla-nss-devel
BuildRequires: pkg-config
BuildRequires: texinfo
Requires: logrotate
Requires(pre): %fillup_prereq
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
Requires(pre): %{install_info_prereq}
Recommends: timedatex
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc-c++
# The timezone package is needed for the "make check" tests. It can be
# removed if the call to make check is ever deleted.
BuildRequires: timezone
%if %{with syscallfilter}
%ifarch %ix86 x86_64 %arm aarch64
BuildRequires: libseccomp-devel
%ifarch %{ix86} x86_64 %{arm} aarch64 s390 s390x ppc64le
BuildRequires: libseccomp-devel >= 2.2.0
%endif
%endif
%if %{with systemd}
@ -69,28 +74,45 @@ BuildRequires: pkgconfig(systemd)
%else
Requires(pre): %insserv_prereq
%endif
Requires: logrotate
Requires: libseccomp2 >= 2.2.0
Requires(pre): %fillup_prereq
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
Requires(pre): %{install_info_prereq}
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Chrony is a pair of programs which are used to maintain the accuracy of the
system clock on a computer. The two programs are called chronyd and chronyc.
Chrony is an implementation of the Network Time Protocol (NTP). It can
synchronize the system clock with NTP servers, reference clocks (e.g. a
GPS receiver), and manual input using wristwatch and keyboard. It can
also operate as an NTPv4 (RFC 5905) server and peer to provide a time
service to other computers in the network.
Chronyd is a daemon which runs in background on the system. It obtains
measurements via the network of the system clocks offset relative to time
servers on other systems and adjusts the system time accordingly. For isolated
systems, the user can periodically enter the correct time by hand (using
Chronyc). In either case, Chronyd determines the rate at which the computer
gains or loses time, and compensates for this. Chronyd implements the NTP
protocol and can act as either a client or a server.
Chrony consists of two programs: chronyd and chronyc.
Chronyc provides a user interface to Chronyd for monitoring its performance and
configuring various settings. It can do so while running on the same computer
as the Chronyd instance it is controlling or a different computer.
Chronyd is a daemon which runs in the background on the system. It
obtains measurements of the system clocks offset relative to time
servers on other systems via the network and adjusts the system time
accordingly. For isolated systems, the user can periodically enter the
correct time by hand (using chronyc). In either case, chronyd
determines the rate at which the computer gains or loses time, and
compensates for this. Chronyd can act as either a client or a server.
Chronyc provides a user interface to chronyd for monitoring its
performance and configuring various settings. It can do so while
running on the same computer as the chronyd instance it is controlling
or a different computer.
%prep
%setup -q
%setup -q -a 10
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
# use our vendor zone (2.*pool.ntp.org names include IPv6 addresses)
sed -e 's|^\(pool \)\(pool.ntp.org\)|\12.%{vendorzone}\2|' \
< examples/chrony.conf.example2 > chrony.conf
@ -100,6 +122,8 @@ touch -r examples/chrony.conf.example2 chrony.conf
# regenerate the file from getdate.y
rm -f getdate.c
mv clknetsim-%{clknetsim_ver}* test/simulation/clknetsim
%build
# not autoconf:
export CFLAGS="%{optflags} -Wall -fpic -DPIC $(pkg-config --cflags libseccomp)"
@ -110,6 +134,7 @@ export LDFLAGS="-pie -Wl,-z,relro,-z,now"
--enable-scfilter \
%endif
--with-user=chrony \
--without-nss \
--with-hwclockfile=%{_sysconfdir}/adjtime \
--with-sendmail=%{_sbindir}/sendmail
@ -118,7 +143,7 @@ gzip -9 -f -n chrony.txt
%install
make %{?_smp_mflags} DESTDIR=%{buildroot} install install-docs
rm -rf "%{buildroot}%{_docdir}/%{name}"
rm "%{buildroot}%{_docdir}/%{name}/%{name}.html"
mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d}
mkdir -p %{buildroot}%{_localstatedir}/{lib,log}/chrony
@ -145,8 +170,8 @@ install -m 644 -p examples/chrony-wait.service \
%{buildroot}%{_unitdir}/chrony-wait.service
install -m 644 -p %{SOURCE5} %{buildroot}%{_unitdir}/chrony-dnssrv@.service
install -m 644 -p %{SOURCE6} %{buildroot}%{_unitdir}/chrony-dnssrv@.timer
ln -s /sbin/service "%{buildroot}%{_sbindir}/rcchronyd"
ln -s /sbin/service "%{buildroot}%{_sbindir}/rcchrony-wait"
ln -s /usr/sbin/service "%{buildroot}%{_sbindir}/rcchronyd"
ln -s /usr/sbin/service "%{buildroot}%{_sbindir}/rcchrony-wait"
echo 'chronyd.service' > \
%{buildroot}%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
@ -160,17 +185,24 @@ install -m 755 -p %{SOURCE4} %{buildroot}%{_datadir}/chrony-helper
touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
%check
# Set random seed to get deterministic results
export CLKNETSIM_RANDOM_SEED=24501
make %{?_smp_mflags} -C test/simulation/clknetsim
make check
%pre
%{_sbindir}/groupadd -r chrony >/dev/null 2>&1 || :
%{_sbindir}/useradd -g chrony -s /bin/false -r -c "Chrony Daemon" -d "%{_localstatedir}/lib/chrony" chrony >/dev/null 2>&1 || :
# START BIG SYSTEMD
%if %{with systemd}
%service_add_pre chronyd.service chrony-wait.service
%service_add_pre chronyd.service chrony-wait.service chrony-dnssrv@.service
%endif
%preun
%if %{with systemd}
%service_del_preun chronyd.service chrony-wait.service
%service_del_preun chronyd.service chrony-wait.service chrony-dnssrv@.service
%else
%stop_on_removal chronyd
%endif
@ -179,13 +211,13 @@ touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
%fillup_only %{name}
%install_info --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}"
%if %{with systemd}
%service_add_post chronyd.service chrony-wait.service
%service_add_post chronyd.service chrony-wait.service chrony-dnssrv@.service
%endif
%postun
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}"
%if %{with systemd}
%service_del_postun chronyd.service chrony-wait.service
%service_del_postun chronyd.service chrony-wait.service chrony-dnssrv@.service
%else
%restart_on_update chronyd
%insserv_cleanup

3
clknetsim-96416d5.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa624416000c526948c2590510107f773b702779e99bb724d33946b366722db3
size 40246

View File

@ -0,0 +1,22 @@
From 9749a1c6fcbdbf158bef2e0b454e7044a742749a Mon Sep 17 00:00:00 2001
From: Miroslav Lichvar <mlichvar@redhat.com>
Date: Mon, 14 Mar 2016 17:42:49 +0100
Subject: test: make 105-ntpauth more reliable
diff --git a/test/simulation/105-ntpauth b/test/simulation/105-ntpauth
index 1b9dd48..2ebcec3 100755
--- a/test/simulation/105-ntpauth
+++ b/test/simulation/105-ntpauth
@@ -43,7 +43,7 @@ check_packet_interval || test_fail
client_conf="keyfile tmp/keys"
clients=2
peers=2
-max_sync_time=300
+max_sync_time=500
base_delay="$default_base_delay (* -1 (equal 0.1 from 3) (equal 0.1 to 1))"
client_lpeer_options="key 1"
client_rpeer_options="key 1"
--
cgit v0.10.2