2 # - enable and package ntpdsim?
3 # - net-snmp-ntpd needs initscript
6 %bcond_without avahi # disable DNS-SD support via Avahi
8 %include /usr/lib/rpm/macros.perl
9 Summary: Network Time Protocol utilities
10 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
11 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
15 License: distributable
16 Group: Networking/Daemons
17 Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
18 # Source0-md5: 00df80a84ec9528fcfb09498075525bc
22 Source4: %{name}.sysconfig
23 Source5: %{name}-client.init
24 Source6: %{name}-client.sysconfig
25 Source7: %{name}-manpages.tar.gz
26 # Source7-md5: 208fcc9019e19ab26d28e4597290bffb
28 Source9: ntpdate.upstart
29 Source10: ntpdate-wrapper
30 Source11: ntpd.service
31 Source12: ntpdate.service
32 Patch0: %{name}-time.patch
33 Patch1: %{name}-no_libelf.patch
34 Patch2: %{name}-ipv6.patch
35 Patch3: %{name}-nano.patch
36 Patch4: %{name}-no_avahi.patch
38 Patch101: %{name}-4.2.6p1-sleep.patch
39 Patch102: %{name}-4.2.6p1-droproot.patch
40 Patch103: %{name}-4.2.6p1-bcast.patch
41 Patch104: %{name}-4.2.6p1-cmsgalign.patch
42 Patch105: %{name}-4.2.6p1-linkfastmath.patch
43 Patch106: %{name}-4.2.6p1-tentative.patch
44 Patch107: %{name}-4.2.6p1-retcode.patch
45 Patch108: %{name}-4.2.6p1-rtnetlink.patch
46 Patch109: %{name}-4.2.4p7-getprecision.patch
47 Patch110: %{name}-4.2.6p1-logdefault.patch
48 Patch111: %{name}-4.2.6p1-mlock.patch
49 Patch112: %{name}-4.2.6p3-broadcastdelay.patch
50 Patch113: %{name}-4.2.6p3-delaycalib.patch
51 URL: http://www.ntp.org/
52 BuildRequires: autoconf
53 BuildRequires: automake
54 %{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
55 BuildRequires: libcap-devel
56 BuildRequires: libnl-devel
57 BuildRequires: libtool
58 BuildRequires: net-snmp-devel
59 BuildRequires: openssl-devel >= 0.9.7d
60 BuildRequires: pciutils-devel
61 BuildRequires: readline-devel >= 4.2
62 BuildRequires: rpm-perlprov >= 4.1-13
63 BuildRequires: rpmbuild(macros) >= 1.626
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 %define _sysconfdir /etc/ntp
67 %define _bindir %{_sbindir}
68 %define mibdir %{_datadir}/mibs
71 The Network Time Protocol (NTP) is used to synchronize a computer's
72 time with another reference time source. The ntp package contains
73 utilities and daemons which will synchronize your computer's time to
74 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
76 %description -l pl.UTF-8
77 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
78 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
79 służące do dokładnego synchronizowania czasu komputera według czasu
80 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
82 %description -l pt_BR.UTF-8
83 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
84 utilizado para sincronizar o relógio do computador com uma outra
85 referência de horário. Este pacote contém utilitários e servidores que
86 sincronizarão o relógio do seu computador com o horário universal
87 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
89 Instale o pacote ntp se você necessitar de ferramentas para manter o
90 relógio do seu computador constantemente atualizado.
93 Summary: The NTP daemon
94 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
95 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
97 Requires(post,preun): /sbin/chkconfig
98 Requires(postun): /usr/sbin/groupdel
99 Requires(postun): /usr/sbin/userdel
100 Requires(pre): /bin/id
101 Requires(pre): /usr/bin/getgid
102 Requires(pre): /usr/sbin/groupadd
103 Requires(pre): /usr/sbin/useradd
104 Requires: rc-scripts >= 0.4.3.0
105 Requires: systemd-units >= 37-0.10
107 Provides: ntp = %{version}-%{release}
110 Obsoletes: ntp < 4.2.4p8-6
116 The Network Time Protocol (NTP) is used to synchronize a computer's
117 time with another reference time source. The ntp package contains
118 utilities and daemons which will synchronize your computer's time to
119 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
121 This package includes ntpd (a daemon which continuously adjusts system
124 %description -n ntpd -l pl.UTF-8
125 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
126 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
127 służące do dokładnego synchronizowania czasu komputera według czasu
128 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
130 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
133 %description -n ntpd -l pt_BR.UTF-8
134 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
135 utilizado para sincronizar o relógio do computador com uma outra
136 referência de horário. Este pacote contém utilitários e servidores que
137 sincronizarão o relógio do seu computador com o horário universal
138 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
140 %package -n ntpd-upstart
141 Summary: Upstart job description for the NTP daemon
142 Summary(pl.UTF-8): Opis zadania Upstart dla demona NTP
144 Requires: ntpd = %{version}-%{release}
145 Requires: upstart >= 0.6
147 %description -n ntpd-upstart
148 Upstart job description for the NTP daemon.
150 %description -n ntpd-upstart -l pl.UTF-8
151 Opis zadania Upstart dla demona NTP.
154 Summary: Utility to set the date and time via NTP
155 Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
156 Group: Applications/Networking
157 Requires(post,preun): /sbin/chkconfig
158 Requires(postun): /usr/sbin/groupdel
159 Requires(postun): /usr/sbin/userdel
160 Requires(pre): /bin/id
161 Requires(pre): /usr/bin/getgid
162 Requires(pre): /usr/sbin/groupadd
163 Requires(pre): /usr/sbin/useradd
164 Requires: rc-scripts >= 0.4.3.0
165 Requires: systemd-units >= 37-0.10
168 Conflicts: ntp < 4.2.0-3
170 Provides: ntp-client = %{version}-%{release}
171 Obsoletes: ntp-client < 4.2.4p8-6
176 %description -n ntpdate
177 ntpdate is a program for retrieving the date and time from NTP
180 %description -n ntpdate -l pl.UTF-8
181 Klient do synchronizacji czasu po NTP (Network Time Protocol).
183 %package -n ntpdate-upstart
184 Summary: Upstart job description for NTP client
185 Summary(pl.UTF-8): Opis zadania Upstart dla klienta NTP
187 Requires: ntpdate = %{version}-%{release}
188 Requires: upstart >= 0.6
190 %description -n ntpdate-upstart
191 Upstart job description for the NTP client.
193 %description -n ntpdate-upstart -l pl.UTF-8
194 Opis zadania Upstart dla klienta NTP.
197 Summary: MIBs for NTP time entities
198 Group: Applications/System
201 %description -n mibs-ntp
202 The Management Information Base for NTP time entities.
204 %package -n net-snmp-ntpd
205 Summary: NTP SNMP subagent for Net-SNMP
207 Requires(post,preun): /sbin/chkconfig
212 %description -n net-snmp-ntpd
213 NTP SNMP AgentX subagent for Net-SNMP.
217 Group: Applications/Networking
218 Obsoletes: ntp-ntptrace
221 This package contains ntp tools:
222 - ntptrace: Trace a chain of NTP servers back to the primary source
223 - ntp-wait: Wait for NTP server to synchronize
226 Summary: HTML documentation for ntp
227 Summary(pl.UTF-8): Dokumentacja HTML dla ntp
228 Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
231 %description doc-html
232 HTML documentation for ntp.
234 %description doc-html -l pl.UTF-8
235 Dokumentacja do ntp w HTML.
237 %description doc-html -l pt_BR.UTF-8
238 Este pacote contém documentação adicional sobre o NTP versão 4.
246 %{!?with_avahi:%patch4 -p1}
263 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
264 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
268 %{__aclocal} -I m4 -I sntp/libopts/m4
273 %{__aclocal} -I ../m4 -I libopts/m4
278 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
280 --with-binsubdir=sbin \
282 --enable-getifaddrs \
284 --with-lineeditlibs=readline \
285 --with-crypto=openssl
290 rm -rf $RPM_BUILD_ROOT
291 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1,%{systemdunitdir}} \
292 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly,init}
295 DESTDIR=$RPM_BUILD_ROOT
297 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
298 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
299 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
300 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
301 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
302 cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
303 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
304 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/init/ntpdate.conf
306 install %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
307 install %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
308 install %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/ntpdate.service
310 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
312 install -d $RPM_BUILD_ROOT/var/lib/ntp
313 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
315 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
317 exec /usr/sbin/ntpdate-wrapper
320 install -d $RPM_BUILD_ROOT%{mibdir}
321 cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
324 rm -rf $RPM_BUILD_ROOT
328 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
331 /sbin/chkconfig --add ntpd
332 %service ntpd restart "NTP Daemon"
333 %systemd_post ntpd.service
336 if [ "$1" = "0" ]; then
338 /sbin/chkconfig --del ntpd
339 rm -f /var/lib/ntp/drift
341 %systemd_preun ntpd.service
344 if [ "$1" = "0" ]; then
350 %post -n ntpd-upstart
353 %postun -n ntpd-upstart
358 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
361 /sbin/chkconfig --add ntpdate
362 %service ntpdate restart "NTP Date"
363 %systemd_post ntpdate.service
366 if [ "$1" = "0" ]; then
367 %service ntpdate stop
368 /sbin/chkconfig --del ntpdate
370 %systemd_preun ntpdate.service
373 if [ "$1" = "0" ]; then
379 %post -n ntpdate-upstart
380 %upstart_post ntpdate
382 %postun -n ntpdate-upstart
383 %upstart_postun ntpdate
385 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
386 # Prevent preun from ntp from working
387 chmod a-x /etc/rc.d/init.d/ntpd
389 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
390 # Restore what triggerun removed
391 chmod 754 /etc/rc.d/init.d/ntpd
392 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
393 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
394 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
395 %service -q ntpd restart
396 %systemd_trigger ntpd.service
397 %systemd_post ntpdate
399 %triggerpostun -n ntpd -- ntpd < 4.2.6p5-2
400 %systemd_trigger ntpd.service
402 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
403 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
404 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
405 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
407 %systemd_trigger ntpdate.service
409 %triggerpostun -n ntpdate -- ntpdate < 4.2.6p5-2
410 %systemd_trigger ntpdate.service
413 %defattr(644,root,root,755)
414 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
415 %attr(750,root,root) %dir %{_sysconfdir}
416 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
417 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
418 %attr(754,root,root) /etc/rc.d/init.d/ntpd
419 %{systemdunitdir}/ntpd.service
420 %attr(755,root,root) %{_sbindir}/ntpd
421 %attr(755,root,root) %{_sbindir}/ntpdc
422 %attr(755,root,root) %{_sbindir}/ntp-keygen
423 %attr(755,root,root) %{_sbindir}/ntpq
424 %attr(755,root,root) %{_sbindir}/ntptime
425 %attr(755,root,root) %{_sbindir}/sntp
426 %attr(755,root,root) %{_sbindir}/tickadj
427 %{_mandir}/man1/ntpd.1*
428 %{_mandir}/man1/ntpdc.1*
429 %{_mandir}/man1/ntp-keygen.1*
430 %{_mandir}/man1/ntpq.1*
431 %{_mandir}/man1/ntptime.1*
432 %{_mandir}/man1/sntp.1*
434 %dir %attr(770,root,ntp) /var/lib/ntp
435 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
437 %files -n ntpd-upstart
438 %defattr(644,root,root,755)
439 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
442 %defattr(644,root,root,755)
444 %attr(755,root,root) %{_sbindir}/ntpdate
445 %attr(755,root,root) %{_sbindir}/ntpdate-wrapper
446 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
447 %attr(754,root,root) /etc/cron.hourly/ntpdate
448 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
449 %{systemdunitdir}/ntpdate.service
450 %{_mandir}/man1/ntpdate*
452 %files -n ntpdate-upstart
453 %defattr(644,root,root,755)
454 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpdate.conf
457 %defattr(644,root,root,755)
458 %{mibdir}/ntpv4-mib.mib
460 %files -n net-snmp-ntpd
461 %defattr(644,root,root,755)
463 %attr(755,root,root) %{_sbindir}/ntpsnmpd
464 %{_mandir}/man1/ntpsnmpd.1*
467 %defattr(644,root,root,755)
468 %attr(755,root,root) %{_sbindir}/ntptrace
469 %attr(755,root,root) %{_sbindir}/ntp-wait
470 %{_mandir}/man1/ntptrace*
473 %defattr(644,root,root,755)