1 # TODO: pps (BR: pps-tools-devel)
4 Summary: An NTP client/server
5 Summary(pl.UTF-8): Klient/serwer NTP
11 Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
12 # Source0-md5: f9876c57f9385c193c806ad8d5c6aec7
15 Source3: %{name}d.sysconfig
16 Source4: %{name}d.init
17 Source5: %{name}.logrotate
18 Patch0: fix-seccomp-build.patch
20 URL: http://chrony.tuxfamily.org/
21 BuildRequires: asciidoc
23 BuildRequires: libcap-devel
24 BuildRequires: libedit-devel
25 BuildRequires: libseccomp-devel
26 # for hashing; can be also nss 3.x or libtomcrypt
27 BuildRequires: nettle-devel >= %{nettle_ver}
28 BuildRequires: pkgconfig
29 BuildRequires: rpmbuild(macros) >= 1.453
30 Requires(postun): /usr/sbin/groupdel
31 Requires(postun): /usr/sbin/userdel
32 Requires(pre): /bin/id
33 Requires(pre): /usr/bin/getgid
34 Requires(pre): /usr/sbin/groupadd
35 Requires(pre): /usr/sbin/useradd
39 Requires: nettle >= %{nettle_ver}
41 Conflicts: logrotate < 3.8.0
42 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 %define _sysconfdir /etc/ntp
46 # assume gcc 3.4 has it
47 %if "%{cc_version}" >= "3.4"
48 %define specflags -pie -fpie
52 A client/server for the Network Time Protocol, this program keeps your
53 computer's clock accurate. It was specially designed to support
54 systems with dial-up Internet connections, and also supports computers
55 in permanently connected environments.
57 %description -l pl.UTF-8
58 Klient/serwer protokołu NTP (Network Time Protocol), pozwalający
59 utrzymać zegar komputera dokładnym. Został zaprojektowany w
60 szczególności do obsłużenia systemów z wdzwanianym połączeniem do
61 Internetu, obsługuje także komputery na stałym łączu.
69 # NOTE: It is not autoconf generated configre
71 CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
72 CPPFLAGS="%{rpmcppflags}" \
78 --sysconfdir=%{_sysconfdir} \
80 --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
81 --with-hwclockfile=%{_sysconfdir}/adjtime \
82 --with-sendmail=%{_sbindir}/sendmail
84 %{__make} getdate all docs \
88 rm -rf $RPM_BUILD_ROOT
89 install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \
90 $RPM_BUILD_ROOT{%{_sysconfdir}/chrony.d,/var/{lib/ntp,log/chrony}}
92 %{__make} install install-docs \
93 DESTDIR=$RPM_BUILD_ROOT
95 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
97 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
98 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
99 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
100 cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
101 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
103 touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
106 rm -rf $RPM_BUILD_ROOT
110 %useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
113 /sbin/chkconfig --add chronyd
114 %service chronyd restart
117 if [ "$1" = "0" ]; then
118 %service chronyd stop
119 /sbin/chkconfig --del chronyd
123 if [ "$1" = "0" ]; then
129 %defattr(644,root,root,755)
130 %doc NEWS README FAQ examples/* doc/{faq,installation}.html
132 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
133 %attr(750,root,root) %dir %{_sysconfdir}/chrony.d
134 %attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
135 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
136 %config(noreplace) /etc/logrotate.d/chrony
137 %attr(754,root,root) /etc/rc.d/init.d/chronyd
138 %attr(755,root,root) %{_bindir}/chronyc
139 %attr(755,root,root) %{_sbindir}/chronyd
140 %{_mandir}/man1/chronyc.1*
141 %{_mandir}/man5/chrony.conf.5*
142 %{_mandir}/man8/chronyd.8*
144 %dir %attr(770,root,ntp) /var/lib/ntp
145 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
146 %attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
148 %dir %attr(770,ntp,ntp) /var/log/chrony