]> git.pld-linux.org Git - packages/ntp.git/blob - ntp.spec
- updated to 4.2.8p8 (fixes CVE-2015-7973 CVE-2015-7974 CVE-2015-7975 CVE-2015-7976
[packages/ntp.git] / ntp.spec
1 # TODO:
2 # - enable and package ntpdsim?
3 # - net-snmp-ntpd needs initscript
4 # - update FC patches
5 # - update man pages (from Debian?)
6 #
7 # Conditional build:
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
11
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
16 Name:           ntp
17 Version:        4.2.8p8
18 Release:        1
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:  4a8636260435b230636f053ffd070e34
23 Source1:        %{name}.conf
24 Source2:        %{name}.keys
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 Source11:       %{name}d.service
33 Source12:       %{name}date.service
34 Source13:       http://www.ietf.org/timezones/data/leap-seconds.list
35 # Source13-md5: 2fcae06100fa9193a3e770c1b59bbbe1
36 Patch0:         %{name}-build.patch
37 Patch1:         %{name}-no_libelf.patch
38 Patch2:         %{name}-ipv6.patch
39 Patch3:         %{name}-nano.patch
40 Patch4:         %{name}-no_avahi.patch
41 # FC patches + 100
42 Patch101:       %{name}-4.2.6p1-sleep.patch
43 Patch102:       %{name}-4.2.6p1-droproot.patch
44 Patch103:       %{name}-4.2.6p1-bcast.patch
45 Patch104:       %{name}-4.2.6p1-cmsgalign.patch
46 Patch105:       %{name}-4.2.6p1-linkfastmath.patch
47 Patch107:       %{name}-4.2.6p1-retcode.patch
48 Patch108:       %{name}-4.2.6p1-rtnetlink.patch
49 Patch110:       %{name}-logdefault.patch
50 Patch111:       %{name}-4.2.6p1-mlock.patch
51 URL:            http://www.ntp.org/
52 BuildRequires:  autoconf >= 2.61
53 BuildRequires:  autogen-devel
54 BuildRequires:  automake >= 1:1.10
55 %{?with_avahi:BuildRequires:    avahi-compat-libdns_sd-devel}
56 BuildRequires:  libcap-devel
57 %{?with_sntp:BuildRequires:     libevent-devel >= 2.0}
58 BuildRequires:  libnl-devel
59 %{?with_seccomp:BuildRequires:  libseccomp-devel}
60 BuildRequires:  libtool
61 BuildRequires:  net-snmp-devel
62 BuildRequires:  openssl-devel >= 0.9.7d
63 BuildRequires:  pciutils-devel
64 BuildRequires:  readline-devel >= 4.2
65 BuildRequires:  rpm-perlprov >= 4.1-13
66 BuildRequires:  rpmbuild(macros) >= 1.626
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %define         _sysconfdir     /etc/ntp
70 %define         _bindir         %{_sbindir}
71 %define         mibdir          %{_datadir}/mibs
72
73 %description
74 The Network Time Protocol (NTP) is used to synchronize a computer's
75 time with another reference time source. The ntp package contains
76 utilities and daemons which will synchronize your computer's time to
77 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
78
79 %description -l pl.UTF-8
80 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
81 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
82 służące do dokładnego synchronizowania czasu komputera według czasu
83 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
84
85 %description -l pt_BR.UTF-8
86 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
87 utilizado para sincronizar o relógio do computador com uma outra
88 referência de horário. Este pacote contém utilitários e servidores que
89 sincronizarão o relógio do seu computador com o horário universal
90 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
91
92 Instale o pacote ntp se você necessitar de ferramentas para manter o
93 relógio do seu computador constantemente atualizado.
94
95 %package -n ntpd
96 Summary:        The NTP daemon
97 Summary(pl.UTF-8):      Narzędzia do synchronizacji czasu (Network Time Protocol)
98 Summary(pt_BR.UTF-8):   Network Time Protocol versão 4
99 Group:          Daemons
100 Requires(post,preun):   /sbin/chkconfig
101 Requires(postun):       /usr/sbin/groupdel
102 Requires(postun):       /usr/sbin/userdel
103 Requires(pre):  /bin/id
104 Requires(pre):  /usr/bin/getgid
105 Requires(pre):  /usr/sbin/groupadd
106 Requires(pre):  /usr/sbin/useradd
107 Requires(post,preun,postun):    systemd-units >= 38
108 Requires:       rc-scripts >= 0.4.3.0
109 Requires:       systemd-units >= 38
110 Provides:       group(ntp)
111 Provides:       ntp = %{version}-%{release}
112 Provides:       ntpdaemon
113 Provides:       user(ntp)
114 Obsoletes:      ntp < 4.2.4p8-6
115 Obsoletes:      ntpdaemon
116 Obsoletes:      openntpd
117 Obsoletes:      xntp3
118
119 %description -n ntpd
120 The Network Time Protocol (NTP) is used to synchronize a computer's
121 time with another reference time source. The ntp package contains
122 utilities and daemons which will synchronize your computer's time to
123 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
124
125 This package includes ntpd (a daemon which continuously adjusts system
126 time)
127
128 %description -n ntpd -l pl.UTF-8
129 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
130 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
131 służące do dokładnego synchronizowania czasu komputera według czasu
132 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
133
134 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
135 czas systemowy)
136
137 %description -n ntpd -l pt_BR.UTF-8
138 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
139 utilizado para sincronizar o relógio do computador com uma outra
140 referência de horário. Este pacote contém utilitários e servidores que
141 sincronizarão o relógio do seu computador com o horário universal
142 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
143
144 %package -n ntpdate
145 Summary:        Utility to set the date and time via NTP
146 Summary(pl.UTF-8):      Klient do synchronizacji czasu po NTP (Network Time Protocol)
147 Group:          Applications/Networking
148 Requires(post,preun):   /sbin/chkconfig
149 Requires(postun):       /usr/sbin/groupdel
150 Requires(postun):       /usr/sbin/userdel
151 Requires(pre):  /bin/id
152 Requires(pre):  /usr/bin/getgid
153 Requires(pre):  /usr/sbin/groupadd
154 Requires(pre):  /usr/sbin/useradd
155 Requires(post,preun,postun):    systemd-units >= 38
156 Requires:       rc-scripts >= 0.4.3.0
157 Requires:       systemd-units >= 38
158 Provides:       group(ntp)
159 Provides:       user(ntp)
160 Conflicts:      ntp < 4.2.0-3
161 # for upgrades
162 Provides:       ntp-client = %{version}-%{release}
163 Obsoletes:      ntp-client < 4.2.4p8-6
164 # virtual
165 Provides:       ntpclient
166 Obsoletes:      ntpclient
167
168 %description -n ntpdate
169 ntpdate is a program for retrieving the date and time from NTP
170 servers.
171
172 %description -n ntpdate -l pl.UTF-8
173 Klient do synchronizacji czasu po NTP (Network Time Protocol).
174
175 %package -n mibs-ntp
176 Summary:        MIBs for NTP time entities
177 Summary(pl.UTF-8):      Pliki MIB dla elementów czasu NTP
178 Group:          Applications/System
179 Requires:       mibs-dirs
180 %if "%{_rpmversion}" >= "5"
181 BuildArch:      noarch
182 %endif
183
184 %description -n mibs-ntp
185 The Management Information Base for NTP time entities.
186
187 %description -n mibs-ntp -l pl.UTF-8
188 Pliki MIB (Management Information Base) dla elementów czasu NTP
189
190 %package -n net-snmp-ntpd
191 Summary:        NTP SNMP subagent for Net-SNMP
192 Summary(pl.UTF-8):      Podagent SNMP NTP dla usługi Net-SNMP
193 Group:          Daemons
194 Requires(post,preun):   /sbin/chkconfig
195 Requires:       net-snmp
196 Requires:       rc-scripts
197 Suggests:       mibs-ntp
198
199 %description -n net-snmp-ntpd
200 NTP SNMP AgentX subagent for Net-SNMP.
201
202 %description -n net-snmp-ntpd -l pl.UTF-8
203 Podagent SNMP AgentX NTP dla usługi Net-SNMP.
204
205 %package tools
206 Summary:        NTP tools
207 Summary(pl.UTF-8):      Narzędzia NTP
208 Group:          Applications/Networking
209 Obsoletes:      ntp-ntptrace
210
211 %description tools
212 This package contains NTP tools:
213 - ntptrace: Trace a chain of NTP servers back to the primary source
214 - ntp-wait: Wait for NTP server to synchronize
215 - calc_tickadj: Calculate optimal value for tick given ntp drift file
216
217 %description tools -l pl.UTF-8
218 Ten pakiet zawiera narzędzia NTP:
219 - ntptrace: śledzenie łańcucha serwerów NTP aż do oryginalnego źródła
220 - ntp-wait: oczekiwanie na synchronizację serwera NTP
221 - calc_tickadj: obliczenie optymalnej wartości dla pliku dryfu ntp
222
223 %package doc-html
224 Summary:        HTML documentation for ntp
225 Summary(pl.UTF-8):      Dokumentacja HTML dla ntp
226 Summary(pt_BR.UTF-8):   Documentação adicional para o pacote ntp
227 Group:          Documentation
228 %if "%{_rpmversion}" >= "5"
229 BuildArch:      noarch
230 %endif
231
232 %description doc-html
233 HTML documentation for ntp.
234
235 %description doc-html -l pl.UTF-8
236 Dokumentacja do ntp w HTML.
237
238 %description doc-html -l pt_BR.UTF-8
239 Este pacote contém documentação adicional sobre o NTP versão 4.
240
241 %prep
242 %setup -q -a7
243 %patch0 -p1
244 %patch1 -p1
245 %patch2 -p1
246 %patch3 -p1
247 %{!?with_avahi:%patch4 -p1}
248
249 ## FC patches
250 #%patch101 -p1
251 %patch102 -p1
252 #%patch103 -p1
253 %patch104 -p1
254 %patch105 -p1
255 %patch107 -p1
256 %patch108 -p1
257 %patch110 -p1
258 #%patch111 -p1  -- obsolete?
259
260 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
261 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
262
263 %{__rm} sntp/m4/{lt*,libtool}.m4 sntp/libevent/m4/{lt*,libtool}.m4
264
265 %build
266 %{__libtoolize}
267 %{__aclocal} -I sntp/m4 -I sntp/libopts/m4 -I sntp/libevent/m4
268 %{__autoconf}
269 %{__automake}
270 cd sntp
271 %{__libtoolize}
272 %{__aclocal} -I m4 -I libopts/m4 -I libevent/m4
273 %{__autoconf}
274 %{__automake}
275 cd libevent
276 %{__libtoolize}
277 %{__aclocal} -I m4
278 %{__autoconf}
279 %{__automake}
280 cd ../..
281
282 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
283 %configure \
284         --disable-silent-rules \
285         --with-binsubdir=sbin \
286         --enable-linuxcaps \
287         --enable-getifaddrs \
288         %{?with_seccomp:--enable-libseccomp} \
289         %{__with_without sntp} \
290         --enable-ipv6 \
291         --enable-ntp-signd \
292         --with-lineeditlibs=readline \
293         --with-crypto=openssl \
294         --disable-local-libopts \
295         --disable-local-libevent
296
297 %{__make} -j1
298
299 %install
300 rm -rf $RPM_BUILD_ROOT
301 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1,%{systemdunitdir}} \
302         $RPM_BUILD_ROOT%{_libexecdir}/systemd/ntp-units.d \
303         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly}
304
305 %{__make} install \
306         DESTDIR=$RPM_BUILD_ROOT
307
308 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
309 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
310 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.leapseconds
311
312 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
313 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
314 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
315 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
316
317 install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
318 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
319 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/ntpdate.service
320 echo 'ntpd.service' > \
321         $RPM_BUILD_ROOT%{_libexecdir}/systemd/ntp-units.d/50-ntpd.list
322
323 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
324
325 install -d $RPM_BUILD_ROOT/var/lib/ntp
326 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
327
328 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
329 #!/bin/sh
330 # Source function library.
331 . /etc/rc.d/init.d/functions
332
333 # Source ntpdate configuration
334 . /etc/sysconfig/ntpdate
335
336 is_yes "$NTPDATE_CRON" || exit 0
337 exec %{_sbindir}/ntpdate-wrapper
338 EOF
339
340 install -d $RPM_BUILD_ROOT%{mibdir}
341 cp -p ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
342
343 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/{ntp,sntp}
344
345 %clean
346 rm -rf $RPM_BUILD_ROOT
347
348 %pre -n ntpd
349 %groupadd -g 246 ntp
350 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
351
352 %post -n ntpd
353 /sbin/chkconfig --add ntpd
354 %service ntpd restart "NTP Daemon"
355 %systemd_post ntpd.service
356
357 %preun -n ntpd
358 if [ "$1" = "0" ]; then
359         %service ntpd stop
360         /sbin/chkconfig --del ntpd
361         rm -f /var/lib/ntp/drift
362 fi
363 %systemd_preun ntpd.service
364
365 %postun -n ntp
366 if [ "$1" = "0" ]; then
367         %userremove ntp
368         %groupremove ntp
369 fi
370 %systemd_reload
371
372 %pre -n ntpdate
373 %groupadd -g 246 ntp
374 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
375
376 %post -n ntpdate
377 /sbin/chkconfig --add ntpdate
378 %service ntpdate restart "NTP Date"
379 %systemd_post ntpdate.service
380
381 %preun -n ntpdate
382 if [ "$1" = "0" ]; then
383         %service ntpdate stop
384         /sbin/chkconfig --del ntpdate
385 fi
386 %systemd_preun ntpdate.service
387
388 %postun -n ntpdate
389 if [ "$1" = "0" ]; then
390         %userremove ntp
391         %groupremove ntp
392 fi
393 %systemd_reload
394
395 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
396 # Prevent preun from ntp from working
397 chmod a-x /etc/rc.d/init.d/ntpd
398
399 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
400 # Restore what triggerun removed
401 chmod 754 /etc/rc.d/init.d/ntpd
402 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
403 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
404 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
405 %service -q ntpd restart
406 %systemd_trigger ntpd.service
407 %systemd_post ntpdate
408
409 %triggerpostun -n ntpd -- ntpd < 4.2.6p5-2
410 %systemd_trigger ntpd.service
411
412 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
413 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
414         cp -f /etc/sysconfig/ntpdate{,.rpmnew}
415         mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
416 fi
417 %systemd_trigger ntpdate.service
418
419 %triggerpostun -n ntpdate -- ntpdate < 4.2.6p5-2
420 %systemd_trigger ntpdate.service
421
422 %files -n ntpd
423 %defattr(644,root,root,755)
424 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
425 %attr(750,root,root) %dir %{_sysconfdir}
426 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
427 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.conf
428 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.leapseconds
429 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
430 %attr(754,root,root) /etc/rc.d/init.d/ntpd
431 %{systemdunitdir}/ntpd.service
432 # dir not handled by systemd in pld
433 #%{_libexecdir}/systemd/ntp-units.d/50-ntpd.list
434 %attr(755,root,root) %{_sbindir}/ntpd
435 %attr(755,root,root) %{_sbindir}/ntpdc
436 %attr(755,root,root) %{_sbindir}/ntp-keygen
437 %attr(755,root,root) %{_sbindir}/ntpq
438 %attr(755,root,root) %{_sbindir}/ntptime
439 %attr(755,root,root) %{_sbindir}/sntp
440 %attr(755,root,root) %{_sbindir}/tickadj
441 %attr(755,root,root) %{_sbindir}/update-leap
442 %{_mandir}/man1/ntpd.1*
443 %{_mandir}/man1/ntpdc.1*
444 %{_mandir}/man1/ntp-keygen.1*
445 %{_mandir}/man1/ntpq.1*
446 %{_mandir}/man1/ntptime.1*
447 %{_mandir}/man1/sntp.1*
448 %{_mandir}/man1/update-leap.1*
449 %{_mandir}/man5/ntp.conf.5*
450 %{_mandir}/man5/ntp.keys.5*
451
452 %dir %attr(770,root,ntp) /var/lib/ntp
453 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
454
455 %files -n ntpdate
456 %defattr(644,root,root,755)
457 %doc COPYRIGHT
458 %attr(755,root,root) %{_sbindir}/ntpdate
459 %attr(755,root,root) %{_sbindir}/ntpdate-wrapper
460 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
461 %attr(754,root,root) /etc/cron.hourly/ntpdate
462 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
463 %{systemdunitdir}/ntpdate.service
464 %{_mandir}/man1/ntpdate.1*
465
466 %files -n mibs-ntp
467 %defattr(644,root,root,755)
468 %{mibdir}/ntpv4-mib.mib
469
470 %files -n net-snmp-ntpd
471 %defattr(644,root,root,755)
472 %doc ntpsnmpd/README
473 %attr(755,root,root) %{_sbindir}/ntpsnmpd
474 %{_mandir}/man1/ntpsnmpd.1*
475
476 %files tools
477 %defattr(644,root,root,755)
478 %attr(755,root,root) %{_sbindir}/calc_tickadj
479 %attr(755,root,root) %{_sbindir}/ntp-wait
480 %attr(755,root,root) %{_sbindir}/ntptrace
481 %dir %{_datadir}/ntp
482 %{_datadir}/ntp/lib
483 %{_mandir}/man1/calc_tickadj.1*
484 %{_mandir}/man1/ntp-wait.1*
485 %{_mandir}/man1/ntptrace.1*
486
487 %files doc-html
488 %defattr(644,root,root,755)
489 %doc html/*
This page took 0.092416 seconds and 3 git commands to generate.