1 Summary: An NTP client/server
7 URL: http://chrony.tuxfamily.org/
8 Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
9 # Source0-md5: ad6dd619ff1986e4ff780363c64e2246
12 Source3: %{name}d.sysconfig
13 Source4: %{name}d.init
14 Source5: %{name}.logrotate
15 Source6: %{name}d.upstart
17 BuildRequires: libcap-devel
18 BuildRequires: readline-devel
19 BuildRequires: rpmbuild(macros) >= 1.202
20 BuildRequires: texinfo
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 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 %define _sysconfdir /etc/ntp
36 A client/server for the Network Time Protocol, this program keeps your
37 computer's clock accurate. It was specially designed to support
38 systems with dial-up Internet connections, and also supports computers
39 in permanently connected environments.
44 %{__sed} -i -e 's,/usr/local,%{_prefix},g' *.texi
47 # NOTE: It is not autoconf generated configre
49 CFLAGS="%{rpmcflags} -pie -fpie -Wmissing-prototypes -Wall" \
50 CPPFLAGS="%{rpmcppflags}" \
53 --sysconfdir=%{_sysconfdir} \
57 %{__make} getdate all docs
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d,init} \
62 $RPM_BUILD_ROOT{%{_sysconfdir},/var/{lib/ntp,log/chrony}}
64 %{__make} install install-docs \
65 DESTDIR=$RPM_BUILD_ROOT
67 rm -rf $RPM_BUILD_ROOT%{_docdir}
69 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
70 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
71 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
72 cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
73 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
74 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/chronyd.conf
76 touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
79 rm -rf $RPM_BUILD_ROOT
83 %useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
86 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
87 /sbin/chkconfig --add chronyd
88 %service chronyd restart
91 if [ "$1" = "0" ]; then
93 /sbin/chkconfig --del chronyd
97 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
98 if [ "$1" = "0" ]; then
104 %defattr(644,root,root,755)
105 %doc NEWS README chrony.txt faq.txt examples/*
107 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
108 %attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
109 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
110 %config(noreplace) %verify(not md5 mtime size) /etc/init/chronyd.conf
111 %config(noreplace) /etc/logrotate.d/chrony
112 %attr(754,root,root) /etc/rc.d/init.d/chronyd
113 %attr(755,root,root) %{_bindir}/chronyc
114 %attr(755,root,root) %{_sbindir}/chronyd
115 %{_mandir}/man1/chrony.1*
116 %{_mandir}/man1/chronyc.1*
117 %{_mandir}/man5/chrony.conf.5*
118 %{_mandir}/man8/chronyd.8*
119 %{_infodir}/chrony.info*
121 %dir %attr(770,root,ntp) /var/lib/ntp
122 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
123 %attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
125 %dir %attr(770,ntp,ntp) /var/log/chrony