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: 01e54c63d09a310f30c4e399f18499df
12 Source3: %{name}d.sysconfig
13 Source4: %{name}d.init
14 Source5: %{name}.logrotate
15 Source6: %{name}d.upstart
16 Patch0: chrony-sysheaders.patch
18 BuildRequires: libcap-devel
19 BuildRequires: nss-devel
20 BuildRequires: readline-devel
21 BuildRequires: rpmbuild(macros) >= 1.453
22 BuildRequires: texinfo
23 Requires(postun): /usr/sbin/groupdel
24 Requires(postun): /usr/sbin/userdel
25 Requires(pre): /bin/id
26 Requires(pre): /usr/bin/getgid
27 Requires(pre): /usr/sbin/groupadd
28 Requires(pre): /usr/sbin/useradd
32 Conflicts: logrotate < 3.8.0
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define _sysconfdir /etc/ntp
38 # assume gcc 3.4 has it
39 %if "%{cc_version}" >= "3.4"
40 %define specflags -pie -fpie
44 A client/server for the Network Time Protocol, this program keeps your
45 computer's clock accurate. It was specially designed to support
46 systems with dial-up Internet connections, and also supports computers
47 in permanently connected environments.
53 %{__sed} -i -e 's,/usr/local,%{_prefix},g' *.texi.in
56 # NOTE: It is not autoconf generated configre
58 CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
59 CPPFLAGS="%{rpmcppflags}" \
62 --sysconfdir=%{_sysconfdir} \
66 %{__make} getdate all docs
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d,init} \
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
83 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/chronyd.conf
85 touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
88 rm -rf $RPM_BUILD_ROOT
92 %useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
95 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
96 /sbin/chkconfig --add chronyd
97 %service chronyd restart
100 if [ "$1" = "0" ]; then
101 %service chronyd stop
102 /sbin/chkconfig --del chronyd
106 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
107 if [ "$1" = "0" ]; then
113 %defattr(644,root,root,755)
114 %doc NEWS README chrony.txt FAQ examples/*
116 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
117 %attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
118 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
119 %config(noreplace) %verify(not md5 mtime size) /etc/init/chronyd.conf
120 %config(noreplace) /etc/logrotate.d/chrony
121 %attr(754,root,root) /etc/rc.d/init.d/chronyd
122 %attr(755,root,root) %{_bindir}/chronyc
123 %attr(755,root,root) %{_sbindir}/chronyd
124 %{_mandir}/man1/chrony.1*
125 %{_mandir}/man1/chronyc.1*
126 %{_mandir}/man5/chrony.conf.5*
127 %{_mandir}/man8/chronyd.8*
128 %{_infodir}/chrony.info*
130 %dir %attr(770,root,ntp) /var/lib/ntp
131 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
132 %attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
134 %dir %attr(770,ntp,ntp) /var/log/chrony