2 # - enable and package ntpdsim?
3 # - net-snmp-ntpd needs initscript
7 %bcond_without avahi # disable DNS-SD support via Avahi
8 %bcond_with seccomp # enable experimental support for libseccomp sandboxing
10 %include /usr/lib/rpm/macros.perl
11 Summary: Network Time Protocol utilities
12 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
13 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
17 License: distributable
18 Group: Networking/Daemons
19 Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
20 # Source0-md5: b98b0cbb72f6df04608e1dd5f313808b
23 Source3: %{name}d.init
24 Source4: %{name}d.sysconfig
25 Source5: %{name}date.init
26 Source6: %{name}date.sysconfig
27 Source7: %{name}-manpages.tar.gz
28 # Source7-md5: 208fcc9019e19ab26d28e4597290bffb
29 Source10: %{name}date-wrapper
30 Source11: %{name}d.service
31 Source12: %{name}date.service
32 Source13: http://www.ietf.org/timezones/data/leap-seconds.list
33 # Source13-md5: e99a84cf28b14c77fba76c05565604ac
34 Patch0: %{name}-build.patch
35 Patch1: %{name}-no_libelf.patch
36 Patch2: %{name}-ipv6.patch
37 Patch3: %{name}-nano.patch
38 Patch4: %{name}-no_avahi.patch
40 Patch101: %{name}-4.2.6p1-sleep.patch
41 Patch102: %{name}-4.2.6p1-droproot.patch
42 Patch103: %{name}-4.2.6p1-bcast.patch
43 Patch104: %{name}-4.2.6p1-cmsgalign.patch
44 Patch105: %{name}-4.2.6p1-linkfastmath.patch
45 Patch107: %{name}-4.2.6p1-retcode.patch
46 Patch108: %{name}-4.2.6p1-rtnetlink.patch
47 Patch110: %{name}-logdefault.patch
48 Patch111: %{name}-4.2.6p1-mlock.patch
49 URL: http://www.ntp.org/
50 BuildRequires: autoconf
51 BuildRequires: autogen-devel
52 BuildRequires: automake
53 %{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
54 BuildRequires: libcap-devel
55 BuildRequires: libevent-devel
56 BuildRequires: libnl-devel
57 %{?with_seccomp:BuildRequires: libseccomp-devel}
58 BuildRequires: libtool
59 BuildRequires: net-snmp-devel
60 BuildRequires: openssl-devel >= 0.9.7d
61 BuildRequires: pciutils-devel
62 BuildRequires: readline-devel >= 4.2
63 BuildRequires: rpm-perlprov >= 4.1-13
64 BuildRequires: rpmbuild(macros) >= 1.626
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 %define _sysconfdir /etc/ntp
68 %define _bindir %{_sbindir}
69 %define mibdir %{_datadir}/mibs
72 The Network Time Protocol (NTP) is used to synchronize a computer's
73 time with another reference time source. The ntp package contains
74 utilities and daemons which will synchronize your computer's time to
75 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
77 %description -l pl.UTF-8
78 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
79 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
80 służące do dokładnego synchronizowania czasu komputera według czasu
81 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
83 %description -l pt_BR.UTF-8
84 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
85 utilizado para sincronizar o relógio do computador com uma outra
86 referência de horário. Este pacote contém utilitários e servidores que
87 sincronizarão o relógio do seu computador com o horário universal
88 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
90 Instale o pacote ntp se você necessitar de ferramentas para manter o
91 relógio do seu computador constantemente atualizado.
94 Summary: The NTP daemon
95 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
96 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
98 Requires(post,preun): /sbin/chkconfig
99 Requires(postun): /usr/sbin/groupdel
100 Requires(postun): /usr/sbin/userdel
101 Requires(pre): /bin/id
102 Requires(pre): /usr/bin/getgid
103 Requires(pre): /usr/sbin/groupadd
104 Requires(pre): /usr/sbin/useradd
105 Requires(post,preun,postun): systemd-units >= 38
106 Requires: rc-scripts >= 0.4.3.0
107 Requires: systemd-units >= 38
109 Provides: ntp = %{version}-%{release}
112 Obsoletes: ntp < 4.2.4p8-6
118 The Network Time Protocol (NTP) is used to synchronize a computer's
119 time with another reference time source. The ntp package contains
120 utilities and daemons which will synchronize your computer's time to
121 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
123 This package includes ntpd (a daemon which continuously adjusts system
126 %description -n ntpd -l pl.UTF-8
127 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
128 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
129 służące do dokładnego synchronizowania czasu komputera według czasu
130 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
132 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
135 %description -n ntpd -l pt_BR.UTF-8
136 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
137 utilizado para sincronizar o relógio do computador com uma outra
138 referência de horário. Este pacote contém utilitários e servidores que
139 sincronizarão o relógio do seu computador com o horário universal
140 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
143 Summary: Utility to set the date and time via NTP
144 Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
145 Group: Applications/Networking
146 Requires(post,preun): /sbin/chkconfig
147 Requires(postun): /usr/sbin/groupdel
148 Requires(postun): /usr/sbin/userdel
149 Requires(pre): /bin/id
150 Requires(pre): /usr/bin/getgid
151 Requires(pre): /usr/sbin/groupadd
152 Requires(pre): /usr/sbin/useradd
153 Requires(post,preun,postun): systemd-units >= 38
154 Requires: rc-scripts >= 0.4.3.0
155 Requires: systemd-units >= 38
158 Conflicts: ntp < 4.2.0-3
160 Provides: ntp-client = %{version}-%{release}
161 Obsoletes: ntp-client < 4.2.4p8-6
166 %description -n ntpdate
167 ntpdate is a program for retrieving the date and time from NTP
170 %description -n ntpdate -l pl.UTF-8
171 Klient do synchronizacji czasu po NTP (Network Time Protocol).
174 Summary: MIBs for NTP time entities
175 Summary(pl.UTF-8): Pliki MIB dla elementów czasu NTP
176 Group: Applications/System
179 %description -n mibs-ntp
180 The Management Information Base for NTP time entities.
182 %description -n mibs-ntp -l pl.UTF-8
183 Pliki MIB (Management Information Base) dla elementów czasu NTP
185 %package -n net-snmp-ntpd
186 Summary: NTP SNMP subagent for Net-SNMP
187 Summary(pl.UTF-8): Podagent SNMP NTP dla usługi Net-SNMP
189 Requires(post,preun): /sbin/chkconfig
194 %description -n net-snmp-ntpd
195 NTP SNMP AgentX subagent for Net-SNMP.
197 %description -n net-snmp-ntpd -l pl.UTF-8
198 Podagent SNMP AgentX NTP dla usługi Net-SNMP.
202 Summary(pl.UTF-8): Narzędzia NTP
203 Group: Applications/Networking
204 Obsoletes: ntp-ntptrace
207 This package contains NTP tools:
208 - ntptrace: Trace a chain of NTP servers back to the primary source
209 - ntp-wait: Wait for NTP server to synchronize
210 - calc_tickadj: Calculate optimal value for tick given ntp drift file
212 %description tools -l pl.UTF-8
213 Ten pakiet zawiera narzędzia NTP:
214 - ntptrace: śledzenie łańcucha serwerów NTP aż do oryginalnego źródła
215 - ntp-wait: oczekiwanie na synchronizację serwera NTP
216 - calc_tickadj: obliczenie optymalnej wartości dla pliku dryfu ntp
219 Summary: HTML documentation for ntp
220 Summary(pl.UTF-8): Dokumentacja HTML dla ntp
221 Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
224 %description doc-html
225 HTML documentation for ntp.
227 %description doc-html -l pl.UTF-8
228 Dokumentacja do ntp w HTML.
230 %description doc-html -l pt_BR.UTF-8
231 Este pacote contém documentação adicional sobre o NTP versão 4.
239 %{!?with_avahi:%patch4 -p1}
250 #%patch111 -p1 -- obsolete?
252 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
253 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
255 %{__rm} sntp/m4/{lt*,libtool}.m4 sntp/libevent/m4/{lt*,libtool}.m4
259 %{__aclocal} -I sntp/m4 -I sntp/libopts/m4 -I sntp/libevent/m4
264 %{__aclocal} -I libopts/m4 -I libevent/m4
269 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
271 --with-binsubdir=sbin \
273 --enable-getifaddrs \
274 %{?with_seccomp:--enable-libseccomp} \
277 --with-lineeditlibs=readline \
278 --with-crypto=openssl \
279 --disable-local-libopts \
280 --disable-local-libevent
285 rm -rf $RPM_BUILD_ROOT
286 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1,%{systemdunitdir}} \
287 $RPM_BUILD_ROOT%{_libexecdir}/systemd/ntp-units.d \
288 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly}
291 DESTDIR=$RPM_BUILD_ROOT
293 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
294 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
295 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.leapseconds
297 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
298 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
299 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
300 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
302 install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
303 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
304 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/ntpdate.service
305 echo 'ntpd.service' > \
306 $RPM_BUILD_ROOT%{_libexecdir}/systemd/ntp-units.d/50-ntpd.list
308 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
310 install -d $RPM_BUILD_ROOT/var/lib/ntp
311 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
313 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
315 # Source function library.
316 . /etc/rc.d/init.d/functions
318 # Source ntpdate configuration
319 . /etc/sysconfig/ntpdate
321 is_yes "$NTPDATE_CRON" || exit 0
322 exec %{_sbindir}/ntpdate-wrapper
325 install -d $RPM_BUILD_ROOT%{mibdir}
326 cp -p ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
328 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{ntp,sntp}
331 rm -rf $RPM_BUILD_ROOT
335 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
338 /sbin/chkconfig --add ntpd
339 %service ntpd restart "NTP Daemon"
340 %systemd_post ntpd.service
343 if [ "$1" = "0" ]; then
345 /sbin/chkconfig --del ntpd
346 rm -f /var/lib/ntp/drift
348 %systemd_preun ntpd.service
351 if [ "$1" = "0" ]; then
359 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
362 /sbin/chkconfig --add ntpdate
363 %service ntpdate restart "NTP Date"
364 %systemd_post ntpdate.service
367 if [ "$1" = "0" ]; then
368 %service ntpdate stop
369 /sbin/chkconfig --del ntpdate
371 %systemd_preun ntpdate.service
374 if [ "$1" = "0" ]; then
380 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
381 # Prevent preun from ntp from working
382 chmod a-x /etc/rc.d/init.d/ntpd
384 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
385 # Restore what triggerun removed
386 chmod 754 /etc/rc.d/init.d/ntpd
387 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
388 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
389 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
390 %service -q ntpd restart
391 %systemd_trigger ntpd.service
392 %systemd_post ntpdate
394 %triggerpostun -n ntpd -- ntpd < 4.2.6p5-2
395 %systemd_trigger ntpd.service
397 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
398 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
399 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
400 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
402 %systemd_trigger ntpdate.service
404 %triggerpostun -n ntpdate -- ntpdate < 4.2.6p5-2
405 %systemd_trigger ntpdate.service
408 %defattr(644,root,root,755)
409 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
410 %attr(750,root,root) %dir %{_sysconfdir}
411 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
412 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.conf
413 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.leapseconds
414 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
415 %attr(754,root,root) /etc/rc.d/init.d/ntpd
416 %{systemdunitdir}/ntpd.service
417 # dir not handled by systemd in pld
418 #%{_libexecdir}/systemd/ntp-units.d/50-ntpd.list
419 %attr(755,root,root) %{_sbindir}/ntpd
420 %attr(755,root,root) %{_sbindir}/ntpdc
421 %attr(755,root,root) %{_sbindir}/ntp-keygen
422 %attr(755,root,root) %{_sbindir}/ntpq
423 %attr(755,root,root) %{_sbindir}/ntptime
424 %attr(755,root,root) %{_sbindir}/sntp
425 %attr(755,root,root) %{_sbindir}/tickadj
426 %attr(755,root,root) %{_sbindir}/update-leap
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*
433 %{_mandir}/man1/update-leap.1*
434 %{_mandir}/man5/ntp.conf.5*
435 %{_mandir}/man5/ntp.keys.5*
437 %dir %attr(770,root,ntp) /var/lib/ntp
438 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
441 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_sbindir}/ntpdate
444 %attr(755,root,root) %{_sbindir}/ntpdate-wrapper
445 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
446 %attr(754,root,root) /etc/cron.hourly/ntpdate
447 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
448 %{systemdunitdir}/ntpdate.service
449 %{_mandir}/man1/ntpdate.1*
452 %defattr(644,root,root,755)
453 %{mibdir}/ntpv4-mib.mib
455 %files -n net-snmp-ntpd
456 %defattr(644,root,root,755)
458 %attr(755,root,root) %{_sbindir}/ntpsnmpd
459 %{_mandir}/man1/ntpsnmpd.1*
462 %defattr(644,root,root,755)
463 %attr(755,root,root) %{_sbindir}/calc_tickadj
464 %attr(755,root,root) %{_sbindir}/ntp-wait
465 %attr(755,root,root) %{_sbindir}/ntptrace
468 %{_mandir}/man1/calc_tickadj.1*
469 %{_mandir}/man1/ntp-wait.1*
470 %{_mandir}/man1/ntptrace.1*
473 %defattr(644,root,root,755)