]> git.pld-linux.org Git - packages/ntp.git/blob - ntp.spec
a822520fa5f1e055336b760780874b5c617e4aa1
[packages/ntp.git] / ntp.spec
1 # TODO:
2 # - enable and package ntpdsim?
3 # - net-snmp-ntpd needs initscript
4 #
5 # Conditional build:
6 %bcond_without  avahi  # disable DNS-SD support via Avahi
7
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
12 Name:           ntp
13 Version:        4.2.6p5
14 Release:        11
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:  00df80a84ec9528fcfb09498075525bc
19 Source1:        %{name}.conf
20 Source2:        %{name}.keys
21 Source3:        %{name}d.init
22 Source4:        %{name}d.sysconfig
23 Source5:        %{name}date.init
24 Source6:        %{name}date.sysconfig
25 Source7:        %{name}-manpages.tar.gz
26 # Source7-md5:  208fcc9019e19ab26d28e4597290bffb
27 Source8:        %{name}.upstart
28 Source9:        %{name}date.upstart
29 Source10:       %{name}date-wrapper
30 Source11:       %{name}d.service
31 Source12:       %{name}date.service
32 Source13:       http://www.ietf.org/timezones/data/leap-seconds.list
33 # Source13-md5: e99a84cf28b14c77fba76c05565604ac
34 Patch0:         %{name}-time.patch
35 Patch1:         %{name}-no_libelf.patch
36 Patch2:         %{name}-ipv6.patch
37 Patch3:         %{name}-nano.patch
38 Patch4:         %{name}-no_avahi.patch
39 Patch5:         %{name}-format-security.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 Patch113:       %{name}-4.2.6p3-delaycalib.patch
54 URL:            http://www.ntp.org/
55 BuildRequires:  autoconf
56 BuildRequires:  automake
57 %{?with_avahi:BuildRequires:    avahi-compat-libdns_sd-devel}
58 BuildRequires:  libcap-devel
59 BuildRequires:  libnl-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 ntpd-upstart
145 Summary:        Upstart job description for the NTP daemon
146 Summary(pl.UTF-8):      Opis zadania Upstart dla demona NTP
147 Group:          Daemons
148 Requires:       ntpd = %{version}-%{release}
149 Requires:       upstart >= 0.6
150
151 %description -n ntpd-upstart
152 Upstart job description for the NTP daemon.
153
154 %description -n ntpd-upstart -l pl.UTF-8
155 Opis zadania Upstart dla demona NTP.
156
157 %package -n ntpdate
158 Summary:        Utility to set the date and time via NTP
159 Summary(pl.UTF-8):      Klient do synchronizacji czasu po NTP (Network Time Protocol)
160 Group:          Applications/Networking
161 Requires(post,preun):   /sbin/chkconfig
162 Requires(postun):       /usr/sbin/groupdel
163 Requires(postun):       /usr/sbin/userdel
164 Requires(pre):  /bin/id
165 Requires(pre):  /usr/bin/getgid
166 Requires(pre):  /usr/sbin/groupadd
167 Requires(pre):  /usr/sbin/useradd
168 Requires(post,preun,postun):    systemd-units >= 38
169 Requires:       rc-scripts >= 0.4.3.0
170 Requires:       systemd-units >= 38
171 Provides:       group(ntp)
172 Provides:       user(ntp)
173 Conflicts:      ntp < 4.2.0-3
174 # for upgrades
175 Provides:       ntp-client = %{version}-%{release}
176 Obsoletes:      ntp-client < 4.2.4p8-6
177 # virtual
178 Provides:       ntpclient
179 Obsoletes:      ntpclient
180
181 %description -n ntpdate
182 ntpdate is a program for retrieving the date and time from NTP
183 servers.
184
185 %description -n ntpdate -l pl.UTF-8
186 Klient do synchronizacji czasu po NTP (Network Time Protocol).
187
188 %package -n ntpdate-upstart
189 Summary:        Upstart job description for NTP client
190 Summary(pl.UTF-8):      Opis zadania Upstart dla klienta NTP
191 Group:          Daemons
192 Requires:       ntpdate = %{version}-%{release}
193 Requires:       upstart >= 0.6
194
195 %description -n ntpdate-upstart
196 Upstart job description for the NTP client.
197
198 %description -n ntpdate-upstart -l pl.UTF-8
199 Opis zadania Upstart dla klienta NTP.
200
201 %package -n mibs-ntp
202 Summary:        MIBs for NTP time entities
203 Group:          Applications/System
204 Requires:       mibs-dirs
205
206 %description -n mibs-ntp
207 The Management Information Base for NTP time entities.
208
209 %package -n net-snmp-ntpd
210 Summary:        NTP SNMP subagent for Net-SNMP
211 Group:          Daemons
212 Requires(post,preun):   /sbin/chkconfig
213 Requires:       net-snmp
214 Requires:       rc-scripts
215 Suggests:       mibs-ntp
216
217 %description -n net-snmp-ntpd
218 NTP SNMP AgentX subagent for Net-SNMP.
219
220 %package tools
221 Summary:        NTP tools
222 Group:          Applications/Networking
223 Obsoletes:      ntp-ntptrace
224
225 %description tools
226 This package contains ntp tools:
227 - ntptrace: Trace a chain of NTP servers back to the primary source
228 - ntp-wait: Wait for NTP server to synchronize
229
230 %package doc-html
231 Summary:        HTML documentation for ntp
232 Summary(pl.UTF-8):      Dokumentacja HTML dla ntp
233 Summary(pt_BR.UTF-8):   Documentação adicional para o pacote ntp
234 Group:          Documentation
235
236 %description doc-html
237 HTML documentation for ntp.
238
239 %description doc-html -l pl.UTF-8
240 Dokumentacja do ntp w HTML.
241
242 %description doc-html -l pt_BR.UTF-8
243 Este pacote contém documentação adicional sobre o NTP versão 4.
244
245 %prep
246 %setup -q -a7
247 %patch0 -p1
248 %patch1 -p1
249 %patch2 -p1
250 %patch3 -p1
251 %{!?with_avahi:%patch4 -p1}
252 %patch5 -p1
253
254 ## FC patches
255 %patch101 -p1
256 %patch102 -p1
257 %patch103 -p1
258 %patch104 -p1
259 %patch105 -p1
260 %patch106 -p1
261 %patch107 -p1
262 %patch108 -p1
263 %patch109 -p1
264 %patch110 -p1
265 %patch111 -p1
266 %patch112 -p1
267 %patch113 -p1
268
269 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
270 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
271
272 %build
273 %{__libtoolize}
274 %{__aclocal} -I m4 -I sntp/libopts/m4
275 %{__autoconf}
276 %{__automake}
277 cd sntp
278 %{__libtoolize}
279 %{__aclocal} -I ../m4 -I libopts/m4
280 %{__autoconf}
281 %{__automake}
282 cd ..
283
284 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
285 %configure \
286         --with-binsubdir=sbin \
287         --enable-linuxcaps \
288         --enable-getifaddrs \
289         --enable-ipv6 \
290         --enable-ntp-signd \
291         --with-lineeditlibs=readline \
292         --with-crypto=openssl
293
294 %{__make}
295
296 %install
297 rm -rf $RPM_BUILD_ROOT
298 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1,%{systemdunitdir}} \
299         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly,init}
300
301 %{__make} install \
302         DESTDIR=$RPM_BUILD_ROOT
303
304 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
305 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
306 cp -p %{SOURCE13} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.leapseconds
307
308 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
309 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
310 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
311 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
312 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
313 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/init/ntpdate.conf
314
315 install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
316 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
317 cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/ntpdate.service
318
319 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
320
321 install -d $RPM_BUILD_ROOT/var/lib/ntp
322 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
323
324 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
325 #!/bin/sh
326 # Source function library.
327 . /etc/rc.d/init.d/functions
328
329 # Source ntpdate configuration
330 . /etc/sysconfig/ntpdate
331
332 is_yes "$NTPDATE_CRON" || exit 0
333 exec %{_sbindir}/ntpdate-wrapper
334 EOF
335
336 install -d $RPM_BUILD_ROOT%{mibdir}
337 cp -p ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
338
339 %clean
340 rm -rf $RPM_BUILD_ROOT
341
342 %pre -n ntpd
343 %groupadd -g 246 ntp
344 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
345
346 %post -n ntpd
347 /sbin/chkconfig --add ntpd
348 %service ntpd restart "NTP Daemon"
349 %systemd_post ntpd.service
350
351 %preun -n ntpd
352 if [ "$1" = "0" ]; then
353         %service ntpd stop
354         /sbin/chkconfig --del ntpd
355         rm -f /var/lib/ntp/drift
356 fi
357 %systemd_preun ntpd.service
358
359 %postun -n ntp
360 if [ "$1" = "0" ]; then
361         %userremove ntp
362         %groupremove ntp
363 fi
364 %systemd_reload
365
366 %post -n ntpd-upstart
367 %upstart_post ntpd
368
369 %postun -n ntpd-upstart
370 %upstart_postun ntpd
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 %post -n ntpdate-upstart
396 %upstart_post ntpdate
397
398 %postun -n ntpdate-upstart
399 %upstart_postun ntpdate
400
401 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
402 # Prevent preun from ntp from working
403 chmod a-x /etc/rc.d/init.d/ntpd
404
405 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
406 # Restore what triggerun removed
407 chmod 754 /etc/rc.d/init.d/ntpd
408 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
409 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
410 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
411 %service -q ntpd restart
412 %systemd_trigger ntpd.service
413 %systemd_post ntpdate
414
415 %triggerpostun -n ntpd -- ntpd < 4.2.6p5-2
416 %systemd_trigger ntpd.service
417
418 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
419 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
420         cp -f /etc/sysconfig/ntpdate{,.rpmnew}
421         mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
422 fi
423 %systemd_trigger ntpdate.service
424
425 %triggerpostun -n ntpdate -- ntpdate < 4.2.6p5-2
426 %systemd_trigger ntpdate.service
427
428 %files -n ntpd
429 %defattr(644,root,root,755)
430 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
431 %attr(750,root,root) %dir %{_sysconfdir}
432 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
433 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.conf
434 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.leapseconds
435 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
436 %attr(754,root,root) /etc/rc.d/init.d/ntpd
437 %{systemdunitdir}/ntpd.service
438 %attr(755,root,root) %{_sbindir}/ntpd
439 %attr(755,root,root) %{_sbindir}/ntpdc
440 %attr(755,root,root) %{_sbindir}/ntp-keygen
441 %attr(755,root,root) %{_sbindir}/ntpq
442 %attr(755,root,root) %{_sbindir}/ntptime
443 %attr(755,root,root) %{_sbindir}/sntp
444 %attr(755,root,root) %{_sbindir}/tickadj
445 %{_mandir}/man1/ntpd.1*
446 %{_mandir}/man1/ntpdc.1*
447 %{_mandir}/man1/ntp-keygen.1*
448 %{_mandir}/man1/ntpq.1*
449 %{_mandir}/man1/ntptime.1*
450 %{_mandir}/man1/sntp.1*
451
452 %dir %attr(770,root,ntp) /var/lib/ntp
453 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
454
455 %files -n ntpd-upstart
456 %defattr(644,root,root,755)
457 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
458
459 %files -n ntpdate
460 %defattr(644,root,root,755)
461 %doc COPYRIGHT
462 %attr(755,root,root) %{_sbindir}/ntpdate
463 %attr(755,root,root) %{_sbindir}/ntpdate-wrapper
464 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
465 %attr(754,root,root) /etc/cron.hourly/ntpdate
466 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
467 %{systemdunitdir}/ntpdate.service
468 %{_mandir}/man1/ntpdate*
469
470 %files -n ntpdate-upstart
471 %defattr(644,root,root,755)
472 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpdate.conf
473
474 %files -n mibs-ntp
475 %defattr(644,root,root,755)
476 %{mibdir}/ntpv4-mib.mib
477
478 %files -n net-snmp-ntpd
479 %defattr(644,root,root,755)
480 %doc ntpsnmpd/README
481 %attr(755,root,root) %{_sbindir}/ntpsnmpd
482 %{_mandir}/man1/ntpsnmpd.1*
483
484 %files tools
485 %defattr(644,root,root,755)
486 %attr(755,root,root) %{_sbindir}/ntptrace
487 %attr(755,root,root) %{_sbindir}/ntp-wait
488 %{_mandir}/man1/ntptrace*
489
490 %files doc-html
491 %defattr(644,root,root,755)
492 %doc html/*
This page took 0.224536 seconds and 2 git commands to generate.