Blame SPECS/chrony.spec

bd02a2
%global _hardened_build 1
d84c6e
%global clknetsim_ver c0e2b4
d84c6e
%bcond_without debug
bd02a2
c2c5e4
Name:           chrony
d84c6e
Version:        2.1.1
bd02a2
Release:        1%{?dist}
c2c5e4
Summary:        An NTP client/server
c2c5e4
c2c5e4
Group:          System Environment/Daemons
c2c5e4
License:        GPLv2
c2c5e4
URL:            http://chrony.tuxfamily.org
c2c5e4
Source0:        http://download.tuxfamily.org/chrony/chrony-%{version}%{?prerelease}.tar.gz
c2c5e4
Source1:        chrony.conf
c2c5e4
Source2:        chrony.keys
c2c5e4
Source3:        chronyd.service
c2c5e4
Source4:        chrony.helper
c2c5e4
Source5:        chrony.logrotate
c2c5e4
Source8:        chrony.dhclient
c2c5e4
Source9:        chrony-wait.service
d84c6e
# simulator for test suite
d84c6e
Source10:       https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz
d84c6e
Source11:       chrony-dnssrv@.service
d84c6e
Source12:       chrony-dnssrv@.timer
c2c5e4
%{?gitpatch:Patch0: chrony-%{version}%{?prerelease}-%{gitpatch}.patch.gz}
c2c5e4
c2c5e4
BuildRequires:  libcap-devel libedit-devel nss-devel pps-tools-devel
c2c5e4
BuildRequires:  bison texinfo systemd-units
c2c5e4
c2c5e4
Requires(pre):  shadow-utils
c2c5e4
Requires(post): systemd info
c2c5e4
Requires(preun): systemd info
c2c5e4
Requires(postun): systemd
c2c5e4
c2c5e4
%description
c2c5e4
A client/server for the Network Time Protocol, this program keeps your
c2c5e4
computer's clock accurate. It was specially designed to support
c2c5e4
systems with intermittent internet connections, but it also works well
c2c5e4
in permanently connected environments. It can use also hardware reference
c2c5e4
clocks, system real-time clock or manual input as time references.
c2c5e4
c2c5e4
%if 0%{!?vendorzone:1}
c2c5e4
%{?fedora: %global vendorzone fedora.}
d84c6e
%{?rhel: %global vendorzone rhel.}
c2c5e4
%endif
c2c5e4
c2c5e4
%prep
d84c6e
%setup -q -n %{name}-%{version}%{?prerelease} -a 10
c2c5e4
%{?gitpatch:%patch0 -p1}
c2c5e4
c2c5e4
%{?gitpatch: echo %{version}-%{gitpatch} > version.txt}
c2c5e4
c2c5e4
sed -e 's|VENDORZONE\.|%{vendorzone}|' < %{SOURCE1} > chrony.conf
c2c5e4
touch -r %{SOURCE1} chrony.conf
c2c5e4
d84c6e
# regenerate the file from getdate.y
d84c6e
rm -f getdate.c
d84c6e
d84c6e
mv clknetsim-%{clknetsim_ver}* test/simulation/clknetsim
d84c6e
c2c5e4
%build
c2c5e4
%configure \
d84c6e
%{?with_debug: --enable-debug} \
c2c5e4
        --docdir=%{_docdir} \
d84c6e
        --with-user=chrony \
c2c5e4
        --with-sendmail=%{_sbindir}/sendmail
d84c6e
make %{?_smp_mflags} all docs
c2c5e4
c2c5e4
%install
c2c5e4
make install install-docs DESTDIR=$RPM_BUILD_ROOT
c2c5e4
c2c5e4
rm -rf $RPM_BUILD_ROOT%{_docdir}
c2c5e4
c2c5e4
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{sysconfig,logrotate.d}
c2c5e4
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/{lib,log}/chrony
c2c5e4
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
c2c5e4
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d
c2c5e4
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
c2c5e4
mkdir -p $RPM_BUILD_ROOT{%{_unitdir},%{_prefix}/lib/systemd/ntp-units.d}
c2c5e4
c2c5e4
install -m 644 -p chrony.conf $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
c2c5e4
install -m 640 -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.keys
c2c5e4
install -m 644 -p %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/chronyd.service
c2c5e4
install -m 755 -p %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/chrony-helper
c2c5e4
install -m 644 -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/chrony
d84c6e
install -m 755 -p examples/chrony.nm-dispatcher \
c2c5e4
        $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
c2c5e4
install -m 755 -p %{SOURCE8} \
c2c5e4
        $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
c2c5e4
install -m 644 -p %{SOURCE9} $RPM_BUILD_ROOT%{_unitdir}/chrony-wait.service
d84c6e
install -m 644 -p %{SOURCE11} $RPM_BUILD_ROOT%{_unitdir}/chrony-dnssrv@.service
d84c6e
install -m 644 -p %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/chrony-dnssrv@.timer
c2c5e4
c2c5e4
touch $RPM_BUILD_ROOT%{_localstatedir}/lib/chrony/{drift,rtc}
c2c5e4
c2c5e4
echo 'chronyd.service' > \
c2c5e4
        $RPM_BUILD_ROOT%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
c2c5e4
d84c6e
gzip -9 -f -n chrony.txt
d84c6e
d84c6e
%check
d84c6e
# set random seed to get deterministic results
d84c6e
export CLKNETSIM_RANDOM_SEED=24501
d84c6e
make %{?_smp_mflags} -C test/simulation/clknetsim
d84c6e
make check
d84c6e
c2c5e4
%pre
c2c5e4
getent group chrony > /dev/null || /usr/sbin/groupadd -r chrony
c2c5e4
getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \
c2c5e4
       -d %{_localstatedir}/lib/chrony -s /sbin/nologin chrony
c2c5e4
:
c2c5e4
c2c5e4
%post
c2c5e4
%systemd_post chronyd.service chrony-wait.service
c2c5e4
/sbin/install-info %{_infodir}/chrony.info.gz %{_infodir}/dir &> /dev/null
c2c5e4
:
c2c5e4
c2c5e4
%preun
c2c5e4
%systemd_preun chronyd.service chrony-wait.service
c2c5e4
if [ "$1" -eq 0 ]; then
c2c5e4
        /sbin/install-info --delete %{_infodir}/chrony.info.gz \
c2c5e4
                %{_infodir}/dir &> /dev/null
c2c5e4
fi
c2c5e4
:
c2c5e4
c2c5e4
%postun
c2c5e4
%systemd_postun_with_restart chronyd.service
c2c5e4
c2c5e4
%files
d84c6e
%doc COPYING FAQ NEWS README chrony.txt.gz
c2c5e4
%config(noreplace) %{_sysconfdir}/chrony.conf
c2c5e4
%config(noreplace) %verify(not md5 size mtime) %attr(640,root,chrony) %{_sysconfdir}/chrony.keys
c2c5e4
%config(noreplace) %{_sysconfdir}/logrotate.d/chrony
c2c5e4
%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
c2c5e4
%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
c2c5e4
%{_bindir}/chronyc
c2c5e4
%{_sbindir}/chronyd
c2c5e4
%{_libexecdir}/chrony-helper
c2c5e4
%{_infodir}/chrony.info*
c2c5e4
%{_prefix}/lib/systemd/ntp-units.d/*.list
c2c5e4
%{_unitdir}/chrony*.service
d84c6e
%{_unitdir}/chrony*.timer
c2c5e4
%{_mandir}/man[158]/%{name}*.[158]*
c2c5e4
%dir %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony
c2c5e4
%ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/drift
c2c5e4
%ghost %attr(-,chrony,chrony) %{_localstatedir}/lib/chrony/rtc
c2c5e4
%dir %attr(-,chrony,chrony) %{_localstatedir}/log/chrony
c2c5e4
c2c5e4
%changelog
d84c6e
* Tue Jun 23 2015 Miroslav Lichvar <mlichvar@redhat.com> 2.1.1-1
d84c6e
- update to 2.1.1 (#1117882)
d84c6e
- add -n option to gzip command to not save timestamp
d84c6e
d84c6e
* Mon Jun 22 2015 Miroslav Lichvar <mlichvar@redhat.com> 2.1-1
d84c6e
- update to 2.1 (#1117882 #1169353 #1206504 #1209568 CVE-2015-1821
d84c6e
  CVE-2015-1822 CVE-2015-1853)
d84c6e
- extend chrony-helper to allow using servers from DNS SRV records (#1211600)
d84c6e
- add servers from DHCP with iburst option by default (#1219492)
d84c6e
- execute test suite
f0b881
bd02a2
* Tue Feb 04 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.29.1-1
bd02a2
- update to 1.29.1 (#1053022, CVE-2014-0021)
bd02a2
- fix selecting of sources with prefer option (#1061048)
bd02a2
- fix potential bug in writing of drift files (#1061106)
bd02a2
- replace hardening build flags with _hardened_build (#1061036)
bd02a2
bd02a2
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.29-4
bd02a2
- Mass rebuild 2014-01-24
bd02a2
bd02a2
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.29-3
bd02a2
- Mass rebuild 2013-12-27
bd02a2
c2c5e4
* Thu Oct 03 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.29-2
c2c5e4
- add ordering dependency to not start chronyd before ntpd stopped (#1011968)
c2c5e4
c2c5e4
* Fri Aug 09 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.29-1
c2c5e4
- update to 1.29 (#995373, CVE-2012-4502, CVE-2012-4503)
c2c5e4
c2c5e4
* Wed Jul 17 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.28-1
c2c5e4
- update to 1.28
c2c5e4
- change default makestep limit to 10 seconds
c2c5e4
c2c5e4
* Mon Jun 24 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.28-0.2.pre1
c2c5e4
- buildrequire systemd-units
c2c5e4
c2c5e4
* Fri Jun 21 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.28-0.1.pre1
c2c5e4
- update to 1.28-pre1
c2c5e4
- listen for commands only on localhost by default
c2c5e4
c2c5e4
* Thu May 09 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.27-3
c2c5e4
- disable chrony-wait service by default (#961047)
c2c5e4
- drop old systemd scriptlets
c2c5e4
- don't own ntp-units.d directory
c2c5e4
- move files from /lib
c2c5e4
- remove unncessary dependency on syslog target
c2c5e4
c2c5e4
* Tue Mar 12 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.27-2
c2c5e4
- suppress error messages from tr when generating key (#907914)
c2c5e4
- fix delta calculation with extreme frequency offsets
c2c5e4
c2c5e4
* Fri Feb 01 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.27-1
c2c5e4
- update to 1.27
c2c5e4
- start chrony-wait service with chronyd
c2c5e4
- start chronyd service after sntp
c2c5e4
- remove obsolete macros
c2c5e4
c2c5e4
* Tue Sep 11 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.5.pre1.git1ca844
c2c5e4
- update to git snapshot 1ca844
c2c5e4
- update systemd integration (#846303)
c2c5e4
- use systemd macros if available (#850151)
c2c5e4
- use correct vendor pool.ntp.org zone on RHEL (#845981)
c2c5e4
- don't log output of chrony-wait service
c2c5e4
c2c5e4
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.27-0.4.pre1
c2c5e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c2c5e4
c2c5e4
* Fri Apr 27 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.3.pre1
c2c5e4
- update service file for systemd-timedated-ntp target (#816493)
c2c5e4
c2c5e4
* Fri Apr 06 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.2.pre1
c2c5e4
  use systemctl is-active instead of status in chrony-helper (#794771)
c2c5e4
c2c5e4
* Tue Feb 28 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.27-0.1.pre1
c2c5e4
- update to 1.27-pre1
c2c5e4
- generate SHA1 command key instead of MD5
c2c5e4
c2c5e4
* Wed Feb 15 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.26-6.20110831gitb088b7
c2c5e4
- remove old servers on DHCP update (#787042)
c2c5e4
c2c5e4
* Fri Feb 10 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.26-5.20110831gitb088b7
c2c5e4
- improve chrony-helper to keep track of servers added from DHCP (#787042)
c2c5e4
- fix dhclient script to always return with zero exit code (#767859)
c2c5e4
c2c5e4
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.26-4.20110831gitb088b7
c2c5e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
c2c5e4
c2c5e4
* Tue Sep 06 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-3.20110831gitb088b7
c2c5e4
- update to git snapshot 20110831gitb088b7
c2c5e4
- on first start generate password with 16 chars
c2c5e4
- change systemd service type to forking
c2c5e4
- add forced-command to chrony-helper (#735821)
c2c5e4
c2c5e4
* Mon Aug 15 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-2
c2c5e4
- fix iburst with very high jitters and long delays
c2c5e4
- use timepps header from pps-tools-devel
c2c5e4
c2c5e4
* Wed Jul 13 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-1
c2c5e4
- update to 1.26
c2c5e4
- read options from sysconfig file if it exists
c2c5e4
c2c5e4
* Fri Jun 24 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.26-0.1.pre1
c2c5e4
- update to 1.26-pre1
c2c5e4
- fix service name in %%triggerun
c2c5e4
- drop SysV init script
c2c5e4
- add chrony-wait service
c2c5e4
c2c5e4
* Fri May 06 2011 Bill Nottingham <notting@redhat.com> 1.25-2
c2c5e4
- fix systemd scriptlets for the upgrade case
c2c5e4
c2c5e4
* Wed May 04 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-1
c2c5e4
- update to 1.25
c2c5e4
c2c5e4
* Wed Apr 20 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-0.3.pre2
c2c5e4
- update to 1.25-pre2
c2c5e4
- link with -Wl,-z,relro,-z,now options
c2c5e4
c2c5e4
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25-0.2.pre1
c2c5e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c2c5e4
c2c5e4
* Tue Feb 01 2011 Miroslav Lichvar <mlichvar@redhat.com> 1.25-0.1.pre1
c2c5e4
- update to 1.25-pre1
c2c5e4
- use iburst, four pool servers, rtcsync, stratumweight in default config
c2c5e4
- add systemd support
c2c5e4
- drop sysconfig file 
c2c5e4
- suppress install-info errors
c2c5e4
c2c5e4
* Thu Apr 29 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-4.20100428git73d775
c2c5e4
- update to 20100428git73d775
c2c5e4
- replace initstepslew directive with makestep in default config
c2c5e4
- add NetworkManager dispatcher script
c2c5e4
- add dhclient script
c2c5e4
- retry server/peer name resolution at least once to workaround
c2c5e4
  NetworkManager race condition on boot
c2c5e4
- don't verify chrony.keys
c2c5e4
c2c5e4
* Fri Mar 12 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-3.20100302git5fb555
c2c5e4
- update to snapshot 20100302git5fb555
c2c5e4
- compile with PPS API support
c2c5e4
c2c5e4
* Thu Feb 04 2010 Miroslav Lichvar <mlichvar@redhat.com> 1.24-1
c2c5e4
- update to 1.24 (#555367, CVE-2010-0292 CVE-2010-0293 CVE-2010-0294)
c2c5e4
- modify default config
c2c5e4
  - step clock on start if it is off by more than 100 seconds
c2c5e4
  - disable client log
c2c5e4
- build with -fPIE on sparc
c2c5e4
c2c5e4
* Tue Dec 15 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.24-0.1.pre1
c2c5e4
- update to 1.24-pre1
c2c5e4
c2c5e4
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-7.20081106gitbe42b4
c2c5e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
c2c5e4
c2c5e4
* Fri Jul 17 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.23-6.20081106gitbe42b4
c2c5e4
- switch to editline
c2c5e4
- support arbitrary chronyc commands in init script
c2c5e4
c2c5e4
* Mon Jun 08 2009 Dan Horak <dan[at]danny.cz> 1.23-5.20081106gitbe42b4
c2c5e4
- add patch with support for s390/s390x
c2c5e4
c2c5e4
* Mon Mar 09 2009 Miroslav Lichvar <mlichvar@redhat.com> 1.23-4.20081106gitbe42b4
c2c5e4
- fix building with broken libcap header (#483548)
c2c5e4
c2c5e4
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23-3.20081106gitbe42b4
c2c5e4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
c2c5e4
c2c5e4
* Wed Nov 19 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.23-2.20081106gitbe42b4
c2c5e4
- fix info uninstall
c2c5e4
- generate random command key in init script
c2c5e4
- support cyclelogs, online, offline commands in init script
c2c5e4
- add logrotate script
c2c5e4
c2c5e4
* Tue Nov 11 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.23-1.20081106gitbe42b4
c2c5e4
- initial release