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