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: 04ab702fc81150db06809562a9aaed92
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: nss-devel
19 BuildRequires: readline-devel
20 BuildRequires: rpmbuild(macros) >= 1.453
21 BuildRequires: texinfo
22 Requires(postun): /usr/sbin/groupdel
23 Requires(postun): /usr/sbin/userdel
24 Requires(pre): /bin/id
25 Requires(pre): /usr/bin/getgid
26 Requires(pre): /usr/sbin/groupadd
27 Requires(pre): /usr/sbin/useradd
31 Conflicts: logrotate < 3.8.0
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 %define _sysconfdir /etc/ntp
37 # assume gcc 3.4 has it
38 %if "%{cc_version}" >= "3.4"
39 %define specflags -pie -fpie
43 A client/server for the Network Time Protocol, this program keeps your
44 computer's clock accurate. It was specially designed to support
45 systems with dial-up Internet connections, and also supports computers
46 in permanently connected environments.
51 %{__sed} -i -e 's,/usr/local,%{_prefix},g' *.texi.in
54 # NOTE: It is not autoconf generated configre
56 CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
57 CPPFLAGS="%{rpmcppflags}" \
60 --sysconfdir=%{_sysconfdir} \
64 %{__make} getdate all docs
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d,init} \
69 $RPM_BUILD_ROOT{%{_sysconfdir},/var/{lib/ntp,log/chrony}}
71 %{__make} install install-docs \
72 DESTDIR=$RPM_BUILD_ROOT
74 rm -rf $RPM_BUILD_ROOT%{_docdir}
76 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
77 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
78 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
79 cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
80 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
81 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/chronyd.conf
83 touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
86 rm -rf $RPM_BUILD_ROOT
90 %useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
93 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
94 /sbin/chkconfig --add chronyd
95 %service chronyd restart
98 if [ "$1" = "0" ]; then
100 /sbin/chkconfig --del chronyd
104 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
105 if [ "$1" = "0" ]; then
111 %defattr(644,root,root,755)
112 %doc NEWS README chrony.txt FAQ examples/*
114 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
115 %attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
116 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
117 %config(noreplace) %verify(not md5 mtime size) /etc/init/chronyd.conf
118 %config(noreplace) /etc/logrotate.d/chrony
119 %attr(754,root,root) /etc/rc.d/init.d/chronyd
120 %attr(755,root,root) %{_bindir}/chronyc
121 %attr(755,root,root) %{_sbindir}/chronyd
122 %{_mandir}/man1/chrony.1*
123 %{_mandir}/man1/chronyc.1*
124 %{_mandir}/man5/chrony.conf.5*
125 %{_mandir}/man8/chronyd.8*
126 %{_infodir}/chrony.info*
128 %dir %attr(770,root,ntp) /var/lib/ntp
129 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
130 %attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
132 %dir %attr(770,ntp,ntp) /var/log/chrony