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: libnl-devel
55 BuildRequires: libtool
56 BuildRequires: net-snmp-devel
57 BuildRequires: openssl-devel >= 0.9.7d
58 BuildRequires: readline-devel >= 4.2
59 BuildRequires: rpm-perlprov >= 4.1-13
60 BuildRequires: rpmbuild(macros) >= 1.561
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 %define _sysconfdir /etc/ntp
64 %define _bindir %{_sbindir}
65 %define mibdir %{_datadir}/mibs
68 The Network Time Protocol (NTP) is used to synchronize a computer's
69 time with another reference time source. The ntp package contains
70 utilities and daemons which will synchronize your computer's time to
71 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
73 %description -l pl.UTF-8
74 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
75 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
76 służące do dokładnego synchronizowania czasu komputera według czasu
77 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
79 %description -l pt_BR.UTF-8
80 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
81 utilizado para sincronizar o relógio do computador com uma outra
82 referência de horário. Este pacote contém utilitários e servidores que
83 sincronizarão o relógio do seu computador com o horário universal
84 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
86 Instale o pacote ntp se você necessitar de ferramentas para manter o
87 relógio do seu computador constantemente atualizado.
90 Summary: The NTP daemon
91 Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
92 Summary(pt_BR.UTF-8): Network Time Protocol versão 4
94 Requires(post,preun): /sbin/chkconfig
95 Requires(postun): /usr/sbin/groupdel
96 Requires(postun): /usr/sbin/userdel
97 Requires(pre): /bin/id
98 Requires(pre): /usr/bin/getgid
99 Requires(pre): /usr/sbin/groupadd
100 Requires(pre): /usr/sbin/useradd
101 Requires: rc-scripts >= 0.4.3.0
103 Provides: ntp = %{version}-%{release}
106 Obsoletes: ntp < 4.2.4p8-6
112 The Network Time Protocol (NTP) is used to synchronize a computer's
113 time with another reference time source. The ntp package contains
114 utilities and daemons which will synchronize your computer's time to
115 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
117 This package includes ntpd (a daemon which continuously adjusts system
120 %description -n ntpd -l pl.UTF-8
121 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
122 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
123 służące do dokładnego synchronizowania czasu komputera według czasu
124 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
126 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
129 %description -n ntpd -l pt_BR.UTF-8
130 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
131 utilizado para sincronizar o relógio do computador com uma outra
132 referência de horário. Este pacote contém utilitários e servidores que
133 sincronizarão o relógio do seu computador com o horário universal
134 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
136 %package -n ntpd-upstart
137 Summary: Upstart job description for the NTP daemon
138 Summary(pl.UTF-8): Opis zadania Upstart dla demona NTP
140 Requires: ntpd = %{version}-%{release}
141 Requires: upstart >= 0.6
143 %description -n ntpd-upstart
144 Upstart job description for the NTP daemon.
146 %description -n ntpd-upstart -l pl.UTF-8
147 Opis zadania Upstart dla demona NTP.
150 Summary: Utility to set the date and time via NTP
151 Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
152 Group: Applications/Networking
153 Requires(post,preun): /sbin/chkconfig
154 Requires(postun): /usr/sbin/groupdel
155 Requires(postun): /usr/sbin/userdel
156 Requires(pre): /bin/id
157 Requires(pre): /usr/bin/getgid
158 Requires(pre): /usr/sbin/groupadd
159 Requires(pre): /usr/sbin/useradd
162 Conflicts: ntp < 4.2.0-3
164 Provides: ntp-client = %{version}-%{release}
165 Obsoletes: ntp-client < 4.2.4p8-6
170 %description -n ntpdate
171 ntpdate is a program for retrieving the date and time from NTP
174 %description -n ntpdate -l pl.UTF-8
175 Klient do synchronizacji czasu po NTP (Network Time Protocol).
178 Summary: MIBs for NTP time entities
179 Group: Applications/System
182 %description -n mibs-ntp
183 The Management Information Base for NTP time entities.
185 %package -n net-snmp-ntpd
186 Summary: NTP SNMP subagent for Net-SNMP
188 Requires(post,preun): /sbin/chkconfig
193 %description -n net-snmp-ntpd
194 NTP SNMP AgentX subagent for Net-SNMP.
198 Group: Applications/Networking
199 Obsoletes: ntp-ntptrace
202 This package contains ntp tools:
203 - ntptrace: Trace a chain of NTP servers back to the primary source
204 - ntp-wait: Wait for NTP server to synchronize
207 Summary: HTML documentation for ntp
208 Summary(pl.UTF-8): Dokumentacja HTML dla ntp
209 Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
212 %description doc-html
213 HTML documentation for ntp.
215 %description doc-html -l pl.UTF-8
216 Dokumentacja do ntp w HTML.
218 %description doc-html -l pt_BR.UTF-8
219 Este pacote contém documentação adicional sobre o NTP versão 4.
229 %{!?with_avahi:%patch6 -p1}
246 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
247 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
251 %{__aclocal} -I m4 -I libopts/m4
256 %{__aclocal} -I ../m4 -I libopts/m4
261 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
263 --with-binsubdir=sbin \
265 --enable-getifaddrs \
267 --with-lineeditlibs=readline \
268 --with-crypto=openssl
273 rm -rf $RPM_BUILD_ROOT
274 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1}
277 DESTDIR=$RPM_BUILD_ROOT
279 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
280 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
281 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
282 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
283 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
284 cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
285 install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
286 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
288 install -d $RPM_BUILD_ROOT/var/lib/ntp
289 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
291 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
293 exec /sbin/service ntpdate cronsettime
296 install -d $RPM_BUILD_ROOT%{mibdir}
297 cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
300 rm -rf $RPM_BUILD_ROOT
304 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
307 /sbin/chkconfig --add ntpd
308 %service ntpd restart "NTP Daemon"
311 if [ "$1" = "0" ]; then
313 /sbin/chkconfig --del ntpd
314 rm -f /var/lib/ntp/drift
317 %post -n ntpd-upstart
320 %postun -n ntpd-upstart
324 if [ "$1" = "0" ]; then
332 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
335 /sbin/chkconfig --add ntpdate
336 %service ntpdate restart "NTP Date"
339 if [ "$1" = "0" ]; then
340 %service ntpdate stop
341 /sbin/chkconfig --del ntpdate
345 if [ "$1" = "0" ]; then
350 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
351 # Prevent preun from ntp from working
352 chmod a-x /etc/rc.d/init.d/ntpd
354 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
355 # Restore what triggerun removed
356 chmod 754 /etc/rc.d/init.d/ntpd
357 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
358 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
359 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
360 %service -q ntpd restart
362 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
363 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
364 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
365 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
369 %defattr(644,root,root,755)
370 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
371 %attr(750,root,root) %dir %{_sysconfdir}
372 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
373 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
374 %attr(754,root,root) /etc/rc.d/init.d/ntpd
375 %attr(755,root,root) %{_sbindir}/ntpd
376 %attr(755,root,root) %{_sbindir}/ntpdc
377 %attr(755,root,root) %{_sbindir}/ntp-keygen
378 %attr(755,root,root) %{_sbindir}/ntpq
379 %attr(755,root,root) %{_sbindir}/ntptime
380 %attr(755,root,root) %{_sbindir}/sntp
381 %attr(755,root,root) %{_sbindir}/tickadj
382 %{_mandir}/man1/ntpd.1*
383 %{_mandir}/man1/ntpdc.1*
384 %{_mandir}/man1/ntp-keygen.1*
385 %{_mandir}/man1/ntpq.1*
386 %{_mandir}/man1/ntptime.1*
387 %{_mandir}/man1/sntp.1*
389 %dir %attr(770,root,ntp) /var/lib/ntp
390 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
392 %files -n ntpd-upstart
393 %defattr(644,root,root,755)
394 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
397 %defattr(644,root,root,755)
399 %attr(755,root,root) %{_sbindir}/ntpdate
400 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
401 %attr(754,root,root) /etc/cron.hourly/ntpdate
402 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
403 %{_mandir}/man1/ntpdate*
406 %defattr(644,root,root,755)
407 %{mibdir}/ntpv4-mib.mib
409 %files -n net-snmp-ntpd
410 %defattr(644,root,root,755)
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)