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: 0510396dfbde40678b92f808ec07c0d2
22 Source4: %{name}.sysconfig
23 Source5: %{name}-client.init
24 Source6: %{name}-client.sysconfig
25 Source7: %{name}-manpages.tar.gz
26 # Source7-md5: 208fcc9019e19ab26d28e4597290bffb
27 Source8: %{name}.upstart
28 Patch0: %{name}-time.patch
29 Patch1: %{name}-no_libelf.patch
30 Patch2: %{name}-ipv6.patch
31 Patch3: %{name}-openssl_check.patch
32 Patch4: %{name}-nano.patch
33 Patch5: %{name}-ntpdc-link_order.patch
34 Patch6: %{name}-no_avahi.patch
36 Patch101: %{name}-4.2.6p1-sleep.patch
37 Patch102: %{name}-4.2.6p1-droproot.patch
38 Patch103: %{name}-4.2.6p1-bcast.patch
39 Patch104: %{name}-4.2.6p1-cmsgalign.patch
40 Patch105: %{name}-4.2.6p1-linkfastmath.patch
41 Patch106: %{name}-4.2.6p1-tentative.patch
42 Patch107: %{name}-4.2.6p1-retcode.patch
43 Patch108: %{name}-4.2.6p1-rtnetlink.patch
44 Patch109: %{name}-4.2.6p1-html2man.patch
45 Patch110: %{name}-4.2.6p1-htmldoc.patch
46 Patch112: %{name}-4.2.4p7-getprecision.patch
47 Patch113: %{name}-4.2.6p1-logdefault.patch
48 Patch114: %{name}-4.2.6p1-mlock.patch
49 URL: http://www.ntp.org/
50 BuildRequires: autoconf
51 BuildRequires: automake
52 %{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
53 BuildRequires: libcap-devel
54 BuildRequires: libtool
55 BuildRequires: net-snmp-devel
56 BuildRequires: openssl-devel >= 0.9.7d
57 BuildRequires: readline-devel >= 4.2
58 BuildRequires: rpm-perlprov >= 4.1-13
59 BuildRequires: rpmbuild(macros) >= 1.561
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 %define _sysconfdir /etc/ntp
63 %define _bindir %{_sbindir}
64 %define mibdir %{_datadir}/mibs
67 The Network Time Protocol (NTP) is used to synchronize a computer's
68 time with another reference time source. The ntp package contains
69 utilities and daemons which will synchronize your computer's time to
70 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
72 %description -l pl.UTF-8
73 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
74 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
75 służące do dokładnego synchronizowania czasu komputera według czasu
76 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
78 %description -l pt_BR.UTF-8
79 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
80 utilizado para sincronizar o relógio do computador com uma outra
81 referência de horário. Este pacote contém utilitários e servidores que
82 sincronizarão o relógio do seu computador com o horário universal
83 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
85 Instale o pacote ntp se você necessitar de ferramentas para manter o
86 relógio do seu computador constantemente atualizado.
89 Summary: The NTP daemon
90 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
91 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
93 Requires(post,preun): /sbin/chkconfig
94 Requires(postun): /usr/sbin/groupdel
95 Requires(postun): /usr/sbin/userdel
96 Requires(pre): /bin/id
97 Requires(pre): /usr/bin/getgid
98 Requires(pre): /usr/sbin/groupadd
99 Requires(pre): /usr/sbin/useradd
100 Requires: rc-scripts >= 0.4.3.0
102 Provides: ntp = %{version}-%{release}
105 Obsoletes: ntp < 4.2.4p8-6
111 The Network Time Protocol (NTP) is used to synchronize a computer's
112 time with another reference time source. The ntp package contains
113 utilities and daemons which will synchronize your computer's time to
114 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
116 This package includes ntpd (a daemon which continuously adjusts system
119 %description -n ntpd -l pl.UTF-8
120 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
121 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
122 służące do dokładnego synchronizowania czasu komputera według czasu
123 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
125 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
128 %description -n ntpd -l pt_BR.UTF-8
129 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
130 utilizado para sincronizar o relógio do computador com uma outra
131 referência de horário. Este pacote contém utilitários e servidores que
132 sincronizarão o relógio do seu computador com o horário universal
133 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
135 %package -n ntpd-upstart
136 Summary: Upstart job description for the NTP daemon
137 Summary(pl.UTF-8): Opis zadania Upstart dla demona NTP
139 Requires: ntpd = %{version}-%{release}
140 Requires: upstart >= 0.6
142 %description -n ntpd-upstart
143 Upstart job description for the NTP daemon.
145 %description -n ntpd-upstart -l pl.UTF-8
146 Opis zadania Upstart dla demona NTP.
149 Summary: Utility to set the date and time via NTP
150 Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
151 Group: Applications/Networking
152 Requires(post,preun): /sbin/chkconfig
153 Requires(postun): /usr/sbin/groupdel
154 Requires(postun): /usr/sbin/userdel
155 Requires(pre): /bin/id
156 Requires(pre): /usr/bin/getgid
157 Requires(pre): /usr/sbin/groupadd
158 Requires(pre): /usr/sbin/useradd
161 Conflicts: ntp < 4.2.0-3
163 Provides: ntp-client = %{version}-%{release}
164 Obsoletes: ntp-client < 4.2.4p8-6
169 %description -n ntpdate
170 ntpdate is a program for retrieving the date and time from NTP
173 %description -n ntpdate -l pl.UTF-8
174 Klient do synchronizacji czasu po NTP (Network Time Protocol).
177 Summary: MIBs for NTP time entities
178 Group: Applications/System
181 %description -n mibs-ntp
182 The Management Information Base for NTP time entities.
184 %package -n net-snmp-ntpd
185 Summary: NTP SNMP subagent for Net-SNMP
187 Requires(post,preun): /sbin/chkconfig
192 %description -n net-snmp-ntpd
193 NTP SNMP AgentX subagent for Net-SNMP.
197 Group: Applications/Networking
198 Obsoletes: ntp-ntptrace
201 This package contains ntp tools:
202 - ntptrace: Trace a chain of NTP servers back to the primary source
203 - ntp-wait: Wait for NTP server to synchronize
206 Summary: HTML documentation for ntp
207 Summary(pl.UTF-8): Dokumentacja HTML dla ntp
208 Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
211 %description doc-html
212 HTML documentation for ntp.
214 %description doc-html -l pl.UTF-8
215 Dokumentacja do ntp w HTML.
217 %description doc-html -l pt_BR.UTF-8
218 Este pacote contém documentação adicional sobre o NTP versão 4.
228 %{!?with_avahi:%patch6 -p1}
245 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
246 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
250 %{__aclocal} -I m4 -I libopts/m4
255 %{__aclocal} -I ../m4 -I libopts/m4
260 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
262 --with-binsubdir=sbin \
264 --enable-getifaddrs \
266 --with-lineeditlibs=readline \
267 --with-crypto=openssl
272 rm -rf $RPM_BUILD_ROOT
273 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1}
276 DESTDIR=$RPM_BUILD_ROOT
278 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
279 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
280 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
281 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
282 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
283 cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
284 install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
285 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
287 install -d $RPM_BUILD_ROOT/var/lib/ntp
288 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
290 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
292 exec /sbin/service ntpdate cronsettime
295 install -d $RPM_BUILD_ROOT%{mibdir}
296 cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
299 rm -rf $RPM_BUILD_ROOT
303 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
306 /sbin/chkconfig --add ntpd
307 %service ntpd restart "NTP Daemon"
310 if [ "$1" = "0" ]; then
312 /sbin/chkconfig --del ntpd
313 rm -f /var/lib/ntp/drift
316 %post -n ntpd-upstart
319 %postun -n ntpd-upstart
323 if [ "$1" = "0" ]; then
331 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
334 /sbin/chkconfig --add ntpdate
335 %service ntpdate restart "NTP Date"
338 if [ "$1" = "0" ]; then
339 %service ntpdate stop
340 /sbin/chkconfig --del ntpdate
344 if [ "$1" = "0" ]; then
349 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
350 # Prevent preun from ntp from working
351 chmod a-x /etc/rc.d/init.d/ntpd
353 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
354 # Restore what triggerun removed
355 chmod 754 /etc/rc.d/init.d/ntpd
356 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
357 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
358 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
359 %service -q ntpd restart
361 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
362 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
363 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
364 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
368 %defattr(644,root,root,755)
369 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
370 %attr(750,root,root) %dir %{_sysconfdir}
371 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
372 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
373 %attr(754,root,root) /etc/rc.d/init.d/ntpd
374 %attr(755,root,root) %{_sbindir}/ntpd
375 %attr(755,root,root) %{_sbindir}/ntpdc
376 %attr(755,root,root) %{_sbindir}/ntp-keygen
377 %attr(755,root,root) %{_sbindir}/ntpq
378 %attr(755,root,root) %{_sbindir}/ntptime
379 %attr(755,root,root) %{_sbindir}/sntp
380 %attr(755,root,root) %{_sbindir}/tickadj
381 %{_mandir}/man1/ntpd.1*
382 %{_mandir}/man1/ntpdc.1*
383 %{_mandir}/man1/ntp-keygen.1*
384 %{_mandir}/man1/ntpq.1*
385 %{_mandir}/man1/ntptime.1*
386 %{_mandir}/man1/sntp.1*
388 %dir %attr(770,root,ntp) /var/lib/ntp
389 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
391 %files -n ntpd-upstart
392 %defattr(644,root,root,755)
393 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
396 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_sbindir}/ntpdate
399 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
400 %attr(754,root,root) /etc/cron.hourly/ntpdate
401 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
402 %{_mandir}/man1/ntpdate*
405 %defattr(644,root,root,755)
406 %{mibdir}/ntpv4-mib.mib
408 %files -n net-snmp-ntpd
409 %defattr(644,root,root,755)
410 # TODO: -n mibs-ntpd for the mib file if it is needed
411 %doc ntpsnmpd/README ntpsnmpd/ntpv4-mib.mib
412 %attr(755,root,root) %{_sbindir}/ntpsnmpd
413 %{_mandir}/man1/ntpsnmpd.1*
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_sbindir}/ntptrace
418 %attr(755,root,root) %{_sbindir}/ntp-wait
419 %{_mandir}/man1/ntptrace*
422 %defattr(644,root,root,755)