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