3 Summary: An NTP client/server
9 Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
10 # Source0-md5: 5f66338bc940a9b51eede8f391e7bed3
13 Source3: %{name}d.sysconfig
14 Source4: %{name}d.init
15 Source5: %{name}.logrotate
16 URL: http://chrony.tuxfamily.org/
17 BuildRequires: asciidoc
19 BuildRequires: libcap-devel
20 BuildRequires: nettle-devel >= %{nettle_ver}
21 BuildRequires: nss-devel
22 BuildRequires: readline-devel
23 BuildRequires: rpmbuild(macros) >= 1.453
24 Requires(postun): /usr/sbin/groupdel
25 Requires(postun): /usr/sbin/userdel
26 Requires(pre): /bin/id
27 Requires(pre): /usr/bin/getgid
28 Requires(pre): /usr/sbin/groupadd
29 Requires(pre): /usr/sbin/useradd
33 Requires: nettle >= %{nettle_ver}
35 Conflicts: logrotate < 3.8.0
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 %define _sysconfdir /etc/ntp
40 # assume gcc 3.4 has it
41 %if "%{cc_version}" >= "3.4"
42 %define specflags -pie -fpie
46 A client/server for the Network Time Protocol, this program keeps your
47 computer's clock accurate. It was specially designed to support
48 systems with dial-up Internet connections, and also supports computers
49 in permanently connected environments.
55 # NOTE: It is not autoconf generated configre
57 CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
58 CPPFLAGS="%{rpmcppflags}" \
61 --sysconfdir=%{_sysconfdir} \
65 %{__make} getdate all docs \
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \
71 $RPM_BUILD_ROOT{%{_sysconfdir},/var/{lib/ntp,log/chrony}}
73 %{__make} install install-docs \
74 DESTDIR=$RPM_BUILD_ROOT
76 rm -rf $RPM_BUILD_ROOT%{_docdir}
78 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
79 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
80 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
81 cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
82 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
84 touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
87 rm -rf $RPM_BUILD_ROOT
91 %useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
94 /sbin/chkconfig --add chronyd
95 %service chronyd restart
98 if [ "$1" = "0" ]; then
100 /sbin/chkconfig --del chronyd
104 if [ "$1" = "0" ]; then
110 %defattr(644,root,root,755)
111 %doc NEWS README FAQ examples/* doc/{faq,installation}.html
113 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
114 %attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
115 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
116 %config(noreplace) /etc/logrotate.d/chrony
117 %attr(754,root,root) /etc/rc.d/init.d/chronyd
118 %attr(755,root,root) %{_bindir}/chronyc
119 %attr(755,root,root) %{_sbindir}/chronyd
120 %{_mandir}/man1/chronyc.1*
121 %{_mandir}/man5/chrony.conf.5*
122 %{_mandir}/man8/chronyd.8*
124 %dir %attr(770,root,ntp) /var/lib/ntp
125 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
126 %attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
128 %dir %attr(770,ntp,ntp) /var/log/chrony