2 # - enable and package ntpdsim?
3 # - net-snmp-ntpd needs initscript
7 %bcond_without avahi # disable DNS-SD support via Avahi
9 %include /usr/lib/rpm/macros.perl
10 Summary: Network Time Protocol utilities
11 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
12 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
16 License: distributable
17 Group: Networking/Daemons
18 Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
19 # Source0-md5: 6972a626be6150db8cfbd0b63d8719e7
22 Source3: %{name}d.init
23 Source4: %{name}d.sysconfig
24 Source5: %{name}date.init
25 Source6: %{name}date.sysconfig
26 Source7: %{name}-manpages.tar.gz
27 # Source7-md5: 208fcc9019e19ab26d28e4597290bffb
28 Source10: %{name}date-wrapper
29 Source11: %{name}d.service
30 Source12: %{name}date.service
31 Source13: http://www.ietf.org/timezones/data/leap-seconds.list
32 # Source13-md5: e99a84cf28b14c77fba76c05565604ac
33 Patch0: %{name}-build.patch
34 Patch1: %{name}-no_libelf.patch
35 Patch2: %{name}-ipv6.patch
36 Patch3: %{name}-nano.patch
37 Patch4: %{name}-no_avahi.patch
39 Patch101: %{name}-4.2.6p1-sleep.patch
40 Patch102: %{name}-4.2.6p1-droproot.patch
41 Patch103: %{name}-4.2.6p1-bcast.patch
42 Patch104: %{name}-4.2.6p1-cmsgalign.patch
43 Patch105: %{name}-4.2.6p1-linkfastmath.patch
44 Patch107: %{name}-4.2.6p1-retcode.patch
45 Patch108: %{name}-4.2.6p1-rtnetlink.patch
46 Patch110: %{name}-logdefault.patch
47 Patch111: %{name}-4.2.6p1-mlock.patch
48 URL: http://www.ntp.org/
49 BuildRequires: autoconf
50 BuildRequires: autogen-devel
51 BuildRequires: automake
52 %{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
53 BuildRequires: libcap-devel
54 BuildRequires: libevent-devel
55 BuildRequires: libnl-devel
56 BuildRequires: libseccomp-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(post,preun,postun): systemd-units >= 38
105 Requires: rc-scripts >= 0.4.3.0
106 Requires: systemd-units >= 38
108 Provides: ntp = %{version}-%{release}
111 Obsoletes: ntp < 4.2.4p8-6
117 The Network Time Protocol (NTP) is used to synchronize a computer's
118 time with another reference time source. The ntp package contains
119 utilities and daemons which will synchronize your computer's time to
120 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
122 This package includes ntpd (a daemon which continuously adjusts system
125 %description -n ntpd -l pl.UTF-8
126 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
127 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
128 służące do dokładnego synchronizowania czasu komputera według czasu
129 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
131 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
134 %description -n ntpd -l pt_BR.UTF-8
135 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
136 utilizado para sincronizar o relógio do computador com uma outra
137 referência de horário. Este pacote contém utilitários e servidores que
138 sincronizarão o relógio do seu computador com o horário universal
139 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
142 Summary: Utility to set the date and time via NTP
143 Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
144 Group: Applications/Networking
145 Requires(post,preun): /sbin/chkconfig
146 Requires(postun): /usr/sbin/groupdel
147 Requires(postun): /usr/sbin/userdel
148 Requires(pre): /bin/id
149 Requires(pre): /usr/bin/getgid
150 Requires(pre): /usr/sbin/groupadd
151 Requires(pre): /usr/sbin/useradd
152 Requires(post,preun,postun): systemd-units >= 38
153 Requires: rc-scripts >= 0.4.3.0
154 Requires: systemd-units >= 38
157 Conflicts: ntp < 4.2.0-3
159 Provides: ntp-client = %{version}-%{release}
160 Obsoletes: ntp-client < 4.2.4p8-6
165 %description -n ntpdate
166 ntpdate is a program for retrieving the date and time from NTP
169 %description -n ntpdate -l pl.UTF-8
170 Klient do synchronizacji czasu po NTP (Network Time Protocol).
173 Summary: MIBs for NTP time entities
174 Summary(pl.UTF-8): Pliki MIB dla elementów czasu NTP
175 Group: Applications/System
178 %description -n mibs-ntp
179 The Management Information Base for NTP time entities.
181 %description -n mibs-ntp -l pl.UTF-8
182 Pliki MIB (Management Information Base) dla elementów czasu NTP
184 %package -n net-snmp-ntpd
185 Summary: NTP SNMP subagent for Net-SNMP
186 Summary(pl.UTF-8): Podagent SNMP NTP dla usługi Net-SNMP
188 Requires(post,preun): /sbin/chkconfig
193 %description -n net-snmp-ntpd
194 NTP SNMP AgentX subagent for Net-SNMP.
196 %description -n net-snmp-ntpd -l pl.UTF-8
197 Podagent SNMP AgentX NTP dla usługi Net-SNMP.
201 Summary(pl.UTF-8): Narzędzia NTP
202 Group: Applications/Networking
203 Obsoletes: ntp-ntptrace
206 This package contains NTP tools:
207 - ntptrace: Trace a chain of NTP servers back to the primary source
208 - ntp-wait: Wait for NTP server to synchronize
209 - calc_tickadj: Calculate optimal value for tick given ntp drift file
211 %description tools -l pl.UTF-8
212 Ten pakiet zawiera narzędzia NTP:
213 - ntptrace: śledzenie łańcucha serwerów NTP aż do oryginalnego źródła
214 - ntp-wait: oczekiwanie na synchronizację serwera NTP
215 - calc_tickadj: obliczenie optymalnej wartości dla pliku dryfu ntp
218 Summary: HTML documentation for ntp
219 Summary(pl.UTF-8): Dokumentacja HTML dla ntp
220 Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
223 %description doc-html
224 HTML documentation for ntp.
226 %description doc-html -l pl.UTF-8
227 Dokumentacja do ntp w HTML.
229 %description doc-html -l pt_BR.UTF-8
230 Este pacote contém documentação adicional sobre o NTP versão 4.
238 %{!?with_avahi:%patch4 -p1}
249 #%patch111 -p1 -- obsolete?
251 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
252 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
254 %{__rm} sntp/m4/{lt*,libtool}.m4 sntp/libevent/m4/{lt*,libtool}.m4
258 %{__aclocal} -I sntp/m4 -I sntp/libopts/m4 -I sntp/libevent/m4
263 %{__aclocal} -I libopts/m4 -I libevent/m4
268 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
270 --with-binsubdir=sbin \
272 --enable-getifaddrs \
273 --enable-libseccomp \
276 --with-lineeditlibs=readline \
277 --with-crypto=openssl \
278 --disable-local-libopts \
279 --disable-local-libevent
284 rm -rf $RPM_BUILD_ROOT
285 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1,%{systemdunitdir}} \
286 $RPM_BUILD_ROOT%{_libexecdir}/systemd/ntp-units.d \
287 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly}
290 DESTDIR=$RPM_BUILD_ROOT
292 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
293 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
294 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.leapseconds
296 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
297 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
298 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
299 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
301 install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
302 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
303 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/ntpdate.service
304 echo 'ntpd.service' > \
305 $RPM_BUILD_ROOT%{_libexecdir}/systemd/ntp-units.d/50-ntpd.list
307 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
309 install -d $RPM_BUILD_ROOT/var/lib/ntp
310 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
312 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
314 # Source function library.
315 . /etc/rc.d/init.d/functions
317 # Source ntpdate configuration
318 . /etc/sysconfig/ntpdate
320 is_yes "$NTPDATE_CRON" || exit 0
321 exec %{_sbindir}/ntpdate-wrapper
324 install -d $RPM_BUILD_ROOT%{mibdir}
325 cp -p ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
327 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{ntp4,sntp}
330 rm -rf $RPM_BUILD_ROOT
334 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
337 /sbin/chkconfig --add ntpd
338 %service ntpd restart "NTP Daemon"
339 %systemd_post ntpd.service
342 if [ "$1" = "0" ]; then
344 /sbin/chkconfig --del ntpd
345 rm -f /var/lib/ntp/drift
347 %systemd_preun ntpd.service
350 if [ "$1" = "0" ]; then
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 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
380 # Prevent preun from ntp from working
381 chmod a-x /etc/rc.d/init.d/ntpd
383 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
384 # Restore what triggerun removed
385 chmod 754 /etc/rc.d/init.d/ntpd
386 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
387 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
388 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
389 %service -q ntpd restart
390 %systemd_trigger ntpd.service
391 %systemd_post ntpdate
393 %triggerpostun -n ntpd -- ntpd < 4.2.6p5-2
394 %systemd_trigger ntpd.service
396 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
397 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
398 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
399 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
401 %systemd_trigger ntpdate.service
403 %triggerpostun -n ntpdate -- ntpdate < 4.2.6p5-2
404 %systemd_trigger ntpdate.service
407 %defattr(644,root,root,755)
408 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
409 %attr(750,root,root) %dir %{_sysconfdir}
410 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
411 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.conf
412 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.leapseconds
413 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
414 %attr(754,root,root) /etc/rc.d/init.d/ntpd
415 %{systemdunitdir}/ntpd.service
416 # dir not handled by systemd in pld
417 #%{_libexecdir}/systemd/ntp-units.d/50-ntpd.list
418 %attr(755,root,root) %{_sbindir}/ntpd
419 %attr(755,root,root) %{_sbindir}/ntpdc
420 %attr(755,root,root) %{_sbindir}/ntp-keygen
421 %attr(755,root,root) %{_sbindir}/ntpq
422 %attr(755,root,root) %{_sbindir}/ntptime
423 %attr(755,root,root) %{_sbindir}/sntp
424 %attr(755,root,root) %{_sbindir}/tickadj
425 %{_mandir}/man1/ntpd.1*
426 %{_mandir}/man1/ntpdc.1*
427 %{_mandir}/man1/ntp-keygen.1*
428 %{_mandir}/man1/ntpq.1*
429 %{_mandir}/man1/ntptime.1*
430 %{_mandir}/man1/sntp.1*
431 %{_mandir}/man5/ntp.conf.5*
432 %{_mandir}/man5/ntp.keys.5*
434 %dir %attr(770,root,ntp) /var/lib/ntp
435 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
438 %defattr(644,root,root,755)
440 %attr(755,root,root) %{_sbindir}/ntpdate
441 %attr(755,root,root) %{_sbindir}/ntpdate-wrapper
442 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
443 %attr(754,root,root) /etc/cron.hourly/ntpdate
444 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
445 %{systemdunitdir}/ntpdate.service
446 %{_mandir}/man1/ntpdate.1*
449 %defattr(644,root,root,755)
450 %{mibdir}/ntpv4-mib.mib
452 %files -n net-snmp-ntpd
453 %defattr(644,root,root,755)
455 %attr(755,root,root) %{_sbindir}/ntpsnmpd
456 %{_mandir}/man1/ntpsnmpd.1*
459 %defattr(644,root,root,755)
460 %attr(755,root,root) %{_sbindir}/calc_tickadj
461 %attr(755,root,root) %{_sbindir}/ntp-wait
462 %attr(755,root,root) %{_sbindir}/ntptrace
465 %{_mandir}/man1/calc_tickadj.1*
466 %{_mandir}/man1/ntp-wait.1*
467 %{_mandir}/man1/ntptrace.1*
470 %defattr(644,root,root,755)