2 # - enable and package ntpdsim?
3 # - net-snmp-ntpd needs initscript
5 # - update man pages (from Debian?)
8 %bcond_without avahi # disable DNS-SD support via Avahi
9 %bcond_without sntp # disable building sntp and sntp/tests
10 %bcond_with seccomp # enable experimental support for libseccomp sandboxing
12 %include /usr/lib/rpm/macros.perl
13 Summary: Network Time Protocol utilities
14 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
15 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
19 License: distributable
20 Group: Networking/Daemons
21 Source0: https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
22 # Source0-md5: ea040ab9b4ca656b5229b89d6b822f13
25 Source3: %{name}d.init
26 Source4: %{name}d.sysconfig
27 Source5: %{name}date.init
28 Source6: %{name}date.sysconfig
29 Source7: %{name}-manpages.tar.gz
30 # Source7-md5: 208fcc9019e19ab26d28e4597290bffb
31 Source10: %{name}date-wrapper
32 Source13: http://www.ietf.org/timezones/data/leap-seconds.list
33 # Source13-md5: 2fcae06100fa9193a3e770c1b59bbbe1
34 Patch0: %{name}-build.patch
35 Patch1: %{name}-no_libelf.patch
36 Patch2: %{name}-ipv6.patch
37 Patch3: %{name}-nano.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 >= 2.61
50 BuildRequires: autogen-devel >= 5.18.12
51 BuildRequires: automake >= 1:1.10
52 %{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
53 BuildRequires: libcap-devel
54 %{?with_sntp:BuildRequires: libevent-devel >= 2.0}
55 BuildRequires: libnl-devel
56 %{?with_seccomp: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: autogen-libs >= 5.18.12
106 Requires: rc-scripts >= 0.4.3.0
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: rc-scripts >= 0.4.3.0
155 Conflicts: ntp < 4.2.0-3
157 Provides: ntp-client = %{version}-%{release}
158 Obsoletes: ntp-client < 4.2.4p8-6
163 %description -n ntpdate
164 ntpdate is a program for retrieving the date and time from NTP
167 %description -n ntpdate -l pl.UTF-8
168 Klient do synchronizacji czasu po NTP (Network Time Protocol).
171 Summary: MIBs for NTP time entities
172 Summary(pl.UTF-8): Pliki MIB dla elementów czasu NTP
173 Group: Applications/System
175 %if "%{_rpmversion}" >= "5"
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
223 %if "%{_rpmversion}" >= "5"
227 %description doc-html
228 HTML documentation for ntp.
230 %description doc-html -l pl.UTF-8
231 Dokumentacja do ntp w HTML.
233 %description doc-html -l pt_BR.UTF-8
234 Este pacote contém documentação adicional sobre o NTP versão 4.
252 #%patch111 -p1 -- obsolete?
254 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
255 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
257 %{__rm} sntp/m4/{lt*,libtool}.m4 sntp/libevent/m4/{lt*,libtool}.m4
261 %{__aclocal} -I sntp/m4 -I sntp/libopts/m4 -I sntp/libevent/m4
266 %{__aclocal} -I m4 -I libopts/m4 -I libevent/m4
276 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
278 --disable-silent-rules \
279 --with-binsubdir=sbin \
281 --enable-getifaddrs \
282 %{?with_seccomp:--enable-libseccomp} \
283 %{__with_without sntp} \
286 --with-lineeditlibs=readline \
287 --with-crypto=openssl \
288 --disable-local-libopts \
289 --disable-local-libevent
294 rm -rf $RPM_BUILD_ROOT
295 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1} \
296 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly}
299 DESTDIR=$RPM_BUILD_ROOT
301 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
302 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
303 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.leapseconds
305 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
306 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
307 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
308 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
310 install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
312 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
314 install -d $RPM_BUILD_ROOT/var/lib/ntp
315 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
317 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
319 # Source function library.
320 . /etc/rc.d/init.d/functions
322 # Source ntpdate configuration
323 . /etc/sysconfig/ntpdate
325 is_yes "$NTPDATE_CRON" || exit 0
326 exec %{_sbindir}/ntpdate-wrapper
329 install -d $RPM_BUILD_ROOT%{mibdir}
330 cp -p ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
332 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{ntp,sntp}
335 rm -rf $RPM_BUILD_ROOT
339 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
342 /sbin/chkconfig --add ntpd
343 %service ntpd restart "NTP Daemon"
346 if [ "$1" = "0" ]; then
348 /sbin/chkconfig --del ntpd
349 rm -f /var/lib/ntp/drift
353 if [ "$1" = "0" ]; then
360 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
363 /sbin/chkconfig --add ntpdate
364 %service ntpdate restart "NTP Date"
367 if [ "$1" = "0" ]; then
368 %service ntpdate stop
369 /sbin/chkconfig --del ntpdate
373 if [ "$1" = "0" ]; then
378 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
379 # Prevent preun from ntp from working
380 chmod a-x /etc/rc.d/init.d/ntpd
382 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
383 # Restore what triggerun removed
384 chmod 754 /etc/rc.d/init.d/ntpd
385 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
386 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
387 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
388 %service -q ntpd restart
390 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
391 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
392 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
393 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
397 %defattr(644,root,root,755)
398 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
399 %attr(750,root,root) %dir %{_sysconfdir}
400 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
401 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.conf
402 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.leapseconds
403 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
404 %attr(754,root,root) /etc/rc.d/init.d/ntpd
405 %attr(755,root,root) %{_sbindir}/ntpd
406 %attr(755,root,root) %{_sbindir}/ntpdc
407 %attr(755,root,root) %{_sbindir}/ntp-keygen
408 %attr(755,root,root) %{_sbindir}/ntpq
409 %attr(755,root,root) %{_sbindir}/ntptime
410 %attr(755,root,root) %{_sbindir}/sntp
411 %attr(755,root,root) %{_sbindir}/tickadj
412 %{_mandir}/man1/ntpd.1*
413 %{_mandir}/man1/ntpdc.1*
414 %{_mandir}/man1/ntp-keygen.1*
415 %{_mandir}/man1/ntpq.1*
416 %{_mandir}/man1/ntptime.1*
417 %{_mandir}/man1/sntp.1*
418 %{_mandir}/man5/ntp.conf.5*
419 %{_mandir}/man5/ntp.keys.5*
421 %dir %attr(770,root,ntp) /var/lib/ntp
422 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
425 %defattr(644,root,root,755)
427 %attr(755,root,root) %{_sbindir}/ntpdate
428 %attr(755,root,root) %{_sbindir}/ntpdate-wrapper
429 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
430 %attr(754,root,root) /etc/cron.hourly/ntpdate
431 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
432 %{_mandir}/man1/ntpdate.1*
435 %defattr(644,root,root,755)
436 %{mibdir}/ntpv4-mib.mib
438 %files -n net-snmp-ntpd
439 %defattr(644,root,root,755)
441 %attr(755,root,root) %{_sbindir}/ntpsnmpd
442 %{_mandir}/man1/ntpsnmpd.1*
445 %defattr(644,root,root,755)
446 %attr(755,root,root) %{_sbindir}/calc_tickadj
447 %attr(755,root,root) %{_sbindir}/ntp-wait
448 %attr(755,root,root) %{_sbindir}/ntptrace
449 %attr(755,root,root) %{_sbindir}/update-leap
452 %{_mandir}/man1/calc_tickadj.1*
453 %{_mandir}/man1/ntp-wait.1*
454 %{_mandir}/man1/ntptrace.1*
455 %{_mandir}/man1/update-leap.1*
458 %defattr(644,root,root,755)