lkundrak / rpms / chrony

Forked from rpms/chrony 4 years ago
Clone
4c73b5d
%global _hardened_build 1
2e198c6
%global clknetsim_ver e63178
9ac30da
%bcond_without debug
4c73b5d
9709697
Name:           chrony
2954ff9
Version:        1.31.1
c4743df
Release:        1%{?dist}
9709697
Summary:        An NTP client/server
9709697
9709697
Group:          System Environment/Daemons
9709697
License:        GPLv2
da5bf79
URL:            http://chrony.tuxfamily.org
da5bf79
Source0:        http://download.tuxfamily.org/chrony/chrony-%{version}%{?prerelease}.tar.gz
4ad5f0b
Source1:        chrony.dhclient
4ad5f0b
Source2:        chrony.helper
1540bac
# simulator for test suite from https://github.com/mlichvar/clknetsim.git
32ada59
Source10:       clknetsim-%{clknetsim_ver}.tar.gz
3dcab8e
%{?gitpatch:Patch0: chrony-%{version}%{?prerelease}-%{gitpatch}.patch.gz}
9709697
4ad5f0b
# add NTP servers from DHCP when starting service
4ad5f0b
Patch1:         chrony-service-helper.patch
4ad5f0b
c7379b8
BuildRequires:  libcap-devel libedit-devel nss-devel pps-tools-devel
c7379b8
BuildRequires:  bison texinfo systemd-units
9709697
9709697
Requires(pre):  shadow-utils
8cf1c43
Requires(post): systemd info
8cf1c43
Requires(preun): systemd info
8cf1c43
Requires(postun): systemd
9709697
9709697
%description
9709697
A client/server for the Network Time Protocol, this program keeps your
9709697
computer's clock accurate. It was specially designed to support
8cbacb5
systems with intermittent internet connections, but it also works well
228b2f2
in permanently connected environments. It can use also hardware reference
228b2f2
clocks, system real-time clock or manual input as time references.
9709697
076f43b
%if 0%{!?vendorzone:1}
076f43b
%{?fedora: %global vendorzone fedora.}
076f43b
%{?rhel: %global vendorzone rhel.}
076f43b
%endif
076f43b
9709697
%prep
1540bac
%setup -q -n %{name}-%{version}%{?prerelease} -a 10
a657955
%{?gitpatch:%patch0 -p1}
4ad5f0b
%patch1 -p1 -b .service-helper
09dcbba
09dcbba
%{?gitpatch: echo %{version}-%{gitpatch} > version.txt}
9709697
4ad5f0b
# review changes in packaged configuration files and scripts
4ad5f0b
md5sum -c <<-EOF | (! grep -v 'OK$')
4ad5f0b
        5cca89b571b0780481fc6f3c518e63bf  examples/chrony-wait.service
4ad5f0b
        d77c994ec12c247a5206e724cd70483d  examples/chrony.conf.example2
4ad5f0b
        2e9fe409a17de5d53a65f9869c4119f5  examples/chrony.logrotate
4ad5f0b
        d7d323d0ea7ccc258710371ea79563d1  examples/chrony.nm-dispatcher
4ad5f0b
        1a5122f7f40446596777a6c69431c415  examples/chronyd.service
4ad5f0b
EOF
4ad5f0b
4ad5f0b
# use our vendor zone
4ad5f0b
sed -e 's|\([0-3]\.\)\(pool.ntp.org\)|\1%{vendorzone}\2|' \
4ad5f0b
        < examples/chrony.conf.example2 > chrony.conf
4ad5f0b
4ad5f0b
echo '# Keys used by chronyd for command and NTP authentication' > chrony.keys
4ad5f0b
4ad5f0b
touch -r examples/chrony.conf.example2 chrony.conf chrony.keys
076f43b
cc84193
# regenerate the file from getdate.y
cc84193
rm -f getdate.c
cc84193
1540bac
mv clknetsim test/simulation
1540bac
9709697
%build
561c982
%configure \
29a27a5
%{?with_debug: --enable-debug} \
561c982
        --docdir=%{_docdir} \
29a27a5
        --with-user=chrony \
561c982
        --with-sendmail=%{_sbindir}/sendmail
cc84193
make %{?_smp_mflags} all docs
9709697
9709697
%install
da5bf79
make install install-docs DESTDIR=$RPM_BUILD_ROOT
da5bf79
da5bf79
rm -rf $RPM_BUILD_ROOT%{_docdir}
da5bf79
259c5c4
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{sysconfig,logrotate.d}
9709697
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{lib,log}/chrony
09dcbba
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
09dcbba
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d
259c5c4
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
e6d5ea6
mkdir -p $RPM_BUILD_ROOT{%{_unitdir},%{_prefix}/lib/systemd/ntp-units.d}
9709697
076f43b
install -m 644 -p chrony.conf $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
4ad5f0b
install -m 640 -p chrony.keys $RPM_BUILD_ROOT%{_sysconfdir}/chrony.keys
4ad5f0b
4ad5f0b
install -m 755 -p examples/chrony.nm-dispatcher \
09dcbba
        $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
4ad5f0b
install -m 755 -p %{SOURCE1} \
09dcbba
        $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
4ad5f0b
install -m 644 -p examples/chrony.logrotate \
4ad5f0b
        $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/chrony
4ad5f0b
4ad5f0b
install -m 644 -p examples/chronyd.service \
4ad5f0b
        $RPM_BUILD_ROOT%{_unitdir}/chronyd.service
4ad5f0b
install -m 644 -p examples/chrony-wait.service \
4ad5f0b
        $RPM_BUILD_ROOT%{_unitdir}/chrony-wait.service
4ad5f0b
4ad5f0b
install -m 755 -p %{SOURCE2} $RPM_BUILD_ROOT%{_libexecdir}/chrony-helper
9709697
9709697
touch $RPM_BUILD_ROOT%{_localstatedir}/lib/chrony/{drift,rtc}
9709697
e6d5ea6
echo 'chronyd.service' > \
e6d5ea6
        $RPM_BUILD_ROOT%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
f56b1f8
74a0566
gzip -9 -f -k chrony.txt
74a0566
1540bac
%check
1540bac
make %{?_smp_mflags} -C test/simulation/clknetsim
1540bac
make check
1540bac
9709697
%pre
9709697
getent group chrony > /dev/null || /usr/sbin/groupadd -r chrony
9709697
getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \
9709697
       -d %{_localstatedir}/lib/chrony -s /sbin/nologin chrony
9709697
:
9709697
9709697
%post
71e2b44
%systemd_post chronyd.service chrony-wait.service
259c5c4
/sbin/install-info %{_infodir}/chrony.info.gz %{_infodir}/dir &> /dev/null
259c5c4
:
Bill Nottingham 754034d
9709697
%preun
71e2b44
%systemd_preun chronyd.service chrony-wait.service
71e2b44
if [ "$1" -eq 0 ]; then
2ba305b
        /sbin/install-info --delete %{_infodir}/chrony.info.gz \
2ba305b
                %{_infodir}/dir &> /dev/null
9709697
fi
9709697
:
9709697
9709697
%postun
71e2b44
%systemd_postun_with_restart chronyd.service
9709697
9709697
%files
c861b56
%{!?_licensedir:%global license %%doc}
c861b56
%license COPYING
2cc923c
%doc FAQ NEWS README chrony.txt.gz
9709697
%config(noreplace) %{_sysconfdir}/chrony.conf
09dcbba
%config(noreplace) %verify(not md5 size mtime) %attr(640,root,chrony) %{_sysconfdir}/chrony.keys
9709697
%config(noreplace) %{_sysconfdir}/logrotate.d/chrony
09dcbba
%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
09dcbba
%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
9709697
%{_bindir}/chronyc
9709697
%{_sbindir}/chronyd
259c5c4
%{_libexecdir}/chrony-helper
9709697
%{_infodir}/chrony.info*
e32aa34
%{_prefix}/lib/systemd/ntp-units.d/*.list
e6d5ea6
%{_unitdir}/chrony*.service
9709697
%{_mandir}/man[158]/%{name}*.[158]*
9709697
%dir %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony
9709697
%ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/drift
9709697
%ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/rtc
9709697
%dir %attr(-,chrony,chrony) %{_localstatedir}/log/chrony
9709697
9709697
%changelog
04ce69f
* Wed Apr 08 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.31.1-1
04ce69f
- update to 1.31.1 (CVE-2015-1853 CVE-2015-1821 CVE-2015-1822)
04ce69f
c4743df
* Thu Sep 11 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.31-1
c4743df
- update to 1.31
c4743df
- add servers from DHCP with iburst option by default
c4743df
- use upstream configuration files and scripts
c4743df
- don't package configuration examples
c4743df
- compress chrony.txt
c4743df
45e9196
* Thu Aug 21 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.31-0.1.pre1
45e9196
- update to 1.31-pre1
45e9196
- use license macro if available
45e9196
13499a3
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.30-3
13499a3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
13499a3
b672451
* Fri Aug 15 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.30-2
b672451
- reconnect client sockets (#1124059)
b672451
d14cc6f
* Tue Jul 01 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.30-1
d14cc6f
- update to 1.30
d14cc6f
- enable debug messages
d14cc6f
453c4cc
* Mon Jun 09 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.30-0.1.pre1
453c4cc
- update to 1.30-pre1
453c4cc
- execute test suite
453c4cc
- avoid calling systemctl in helper script
453c4cc
- call chronyc directly from logrotate and NM dispatcher scripts
453c4cc
- add conflict with systemd-timesyncd service
453c4cc
fbb5214
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.29.1-2
fbb5214
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
fbb5214
5c64a41
* Fri Jan 31 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.29.1-1
5c64a41
- update to 1.29.1 (CVE-2014-0021)
5c64a41
- replace hardening build flags with _hardened_build
5c64a41
c2970ea
* Tue Nov 19 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.29-3
c2970ea
- let systemd remove pid file (#974305)
c2970ea
ed2456b
* Thu Oct 03 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.29-2
ed2456b
- add ordering dependency to not start chronyd before ntpd stopped
ed2456b
a61f21c
* Thu Aug 08 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.29-1
a61f21c
- update to 1.29 (CVE-2012-4502, CVE-2012-4503)
a61f21c
7241415
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.28-2
7241415
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
7241415
a7d1970
* Wed Jul 17 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.28-1
a7d1970
- update to 1.28
a7d1970
- change default makestep limit to 10 seconds
a7d1970
3e20c77
* Mon Jun 24 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.28-0.2.pre1
3e20c77
- buildrequire systemd-units
3e20c77
14fe39a
* Fri Jun 21 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.28-0.1.pre1
14fe39a
- update to 1.28-pre1
14fe39a
- listen for commands only on localhost by default
14fe39a
f66ffbc
* Thu May 09 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.27-3
f66ffbc
- disable chrony-wait service by default (#961047)
f66ffbc
- drop old systemd scriptlets
f66ffbc
- don't own ntp-units.d directory
f66ffbc
- move files from /lib
f66ffbc
- remove unncessary dependency on syslog target
f66ffbc
73be72a
* Tue Mar 12 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.27-2
73be72a
- suppress error messages from tr when generating key (#907914)
73be72a
- fix delta calculation with extreme frequency offsets
73be72a
71508b3
* Fri Feb 01 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.27-1
71508b3
- update to 1.27
71508b3
- start chrony-wait service with chronyd
71508b3
- start chronyd service after sntp
71508b3
- remove obsolete macros
71508b3
547115c
* Tue Sep 11 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.5.pre1.git1ca844
547115c
- update to git snapshot 1ca844
547115c
- update systemd integration (#846303)
547115c
- use systemd macros if available (#850151)
547115c
- use correct vendor pool.ntp.org zone on RHEL (#845981)
547115c
- don't log output of chrony-wait service
547115c
974feed
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.27-0.4.pre1
974feed
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
974feed
bf5f2cb
* Fri Apr 27 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.3.pre1
bf5f2cb
- update service file for systemd-timedated-ntp target (#816493)
bf5f2cb
31347b7
* Fri Apr 06 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.2.pre1
31347b7
  use systemctl is-active instead of status in chrony-helper (#794771)
31347b7
29a2bd7
* Tue Feb 28 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.1.pre1
29a2bd7
- update to 1.27-pre1
29a2bd7
- generate SHA1 command key instead of MD5
29a2bd7
3ef5b32
* Wed Feb 15 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.26-6.20110831gitb088b7
3ef5b32
- remove old servers on DHCP update (#787042)
3ef5b32
acf2cf4
* Fri Feb 10 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.26-5.20110831gitb088b7
acf2cf4
- improve chrony-helper to keep track of servers added from DHCP (#787042)
acf2cf4
- fix dhclient script to always return with zero exit code (#767859)
acf2cf4
100a7ef
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.26-4.20110831gitb088b7
100a7ef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
100a7ef
14503ca
* Tue Sep 06 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-3.20110831gitb088b7
14503ca
- update to git snapshot 20110831gitb088b7
14503ca
- on first start generate password with 16 chars
14503ca
- change systemd service type to forking
14503ca
- add forced-command to chrony-helper (#735821)
14503ca
67161c3
* Mon Aug 15 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-2
67161c3
- fix iburst with very high jitters and long delays
67161c3
- use timepps header from pps-tools-devel
67161c3
502116e
* Wed Jul 13 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-1
502116e
- update to 1.26
502116e
- read options from sysconfig file if it exists
502116e
a58e052
* Fri Jun 24 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-0.1.pre1
a58e052
- update to 1.26-pre1
a58e052
- fix service name in %%triggerun
a58e052
- drop SysV init script
a58e052
- add chrony-wait service
a58e052
Bill Nottingham 7d1d5f1
* Fri May 06 2011 Bill Nottingham <notting@redhat.com> 1.25-2
Bill Nottingham 7d1d5f1
- fix systemd scriptlets for the upgrade case
Bill Nottingham 7d1d5f1
f58e2b7
* Wed May 04 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-1
f58e2b7
- update to 1.25
f58e2b7
e041f39
* Wed Apr 20 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-0.3.pre2
e041f39
- update to 1.25-pre2
e041f39
- link with -Wl,-z,relro,-z,now options
e041f39
57710f6
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25-0.2.pre1
57710f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
57710f6
7801887
* Tue Feb 01 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-0.1.pre1
7801887
- update to 1.25-pre1
7801887
- use iburst, four pool servers, rtcsync, stratumweight in default config
7801887
- add systemd support
7801887
- drop sysconfig file 
7801887
- suppress install-info errors
7801887
09dcbba
* Thu Apr 29 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-4.20100428git73d775
09dcbba
- update to 20100428git73d775
09dcbba
- replace initstepslew directive with makestep in default config
09dcbba
- add NetworkManager dispatcher script
09dcbba
- add dhclient script
09dcbba
- retry server/peer name resolution at least once to workaround
09dcbba
  NetworkManager race condition on boot
09dcbba
- don't verify chrony.keys
09dcbba
c6b186a
* Fri Mar 12 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-3.20100302git5fb555
3189232
- update to snapshot 20100302git5fb555
3189232
- compile with PPS API support
3189232
b190c45
* Thu Feb 04 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-1
b190c45
- update to 1.24 (#555367, CVE-2010-0292 CVE-2010-0293 CVE-2010-0294)
b190c45
- modify default config
b190c45
  - step clock on start if it is off by more than 100 seconds
b190c45
  - disable client log
b190c45
- build with -fPIE on sparc
b190c45
da5bf79
* Tue Dec 15 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.24-0.1.pre1
da5bf79
- update to 1.24-pre1
da5bf79
599355b
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-7.20081106gitbe42b4
599355b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
599355b
5e51703
* Fri Jul 17 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.23-6.20081106gitbe42b4
5e51703
- switch to editline
5e51703
- support arbitrary chronyc commands in init script
5e51703
90258c8
* Mon Jun 08 2009 Dan Horak <dan[at]danny.cz> 1.23-5.20081106gitbe42b4
90258c8
- add patch with support for s390/s390x
90258c8
f2a824a
* Mon Mar 09 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.23-4.20081106gitbe42b4
f2a824a
- fix building with broken libcap header (#483548)
f2a824a
6d80626
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-3.20081106gitbe42b4
6d80626
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
6d80626
9709697
* Wed Nov 19 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.23-2.20081106gitbe42b4
9709697
- fix info uninstall
9709697
- generate random command key in init script
9709697
- support cyclelogs, online, offline commands in init script
9709697
- add logrotate script
9709697
9709697
* Tue Nov 11 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.23-1.20081106gitbe42b4
9709697
- initial release