]> git.pld-linux.org Git - packages/ntp.git/blob - ntp.spec
- BR: net-snmp-devel
[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.6p1
14 Release:        0.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
19 Source1:        %{name}.conf
20 Source2:        %{name}.keys
21 Source3:        %{name}.init
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
35 # FC patches + 100
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)
61
62 %define         _sysconfdir     /etc/ntp
63 %define         _bindir         %{_sbindir}
64 %define         mibdir          %{_datadir}/mibs
65
66 %description
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.
71
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.
77
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.
84
85 Instale o pacote ntp se você necessitar de ferramentas para manter o
86 relógio do seu computador constantemente atualizado.
87
88 %package -n ntpd
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
92 Group:          Daemons
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
101 Provides:       group(ntp)
102 Provides:       ntp = %{version}-%{release}
103 Provides:       ntpdaemon
104 Provides:       user(ntp)
105 Obsoletes:      ntp < 4.2.4p8-6
106 Obsoletes:      ntpdaemon
107 Obsoletes:      openntpd
108 Obsoletes:      xntp3
109
110 %description -n ntpd
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.
115
116 This package includes ntpd (a daemon which continuously adjusts system
117 time)
118
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.
124
125 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
126 czas systemowy)
127
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.
134
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
138 Group:          Daemons
139 Requires:       ntpd = %{version}-%{release}
140 Requires:       upstart >= 0.6
141
142 %description -n ntpd-upstart
143 Upstart job description for the NTP daemon.
144
145 %description -n ntpd-upstart -l pl.UTF-8
146 Opis zadania Upstart dla demona NTP.
147
148 %package -n ntpdate
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
159 Provides:       group(ntp)
160 Provides:       user(ntp)
161 Conflicts:      ntp < 4.2.0-3
162 # for upgrades
163 Provides:       ntp-client = %{version}-%{release}
164 Obsoletes:      ntp-client < 4.2.4p8-6
165 # virtual
166 Provides:       ntpclient
167 Obsoletes:      ntpclient
168
169 %description -n ntpdate
170 ntpdate is a program for retrieving the date and time from NTP
171 servers.
172
173 %description -n ntpdate -l pl.UTF-8
174 Klient do synchronizacji czasu po NTP (Network Time Protocol).
175
176 %package -n mibs-ntp
177 Summary:        MIBs for NTP time entities
178 Group:          Applications/System
179 Requires:       mibs-dirs
180
181 %description -n mibs-ntp
182 The Management Information Base for NTP time entities.
183
184 %package -n net-snmp-ntpd
185 Summary:        NTP SNMP subagent for Net-SNMP
186 Group:          Daemons
187 Requires(post,preun):   /sbin/chkconfig
188 Requires:       net-snmp
189 Requires:       rc-scripts
190 Suggests:       mibs-ntp
191
192 %description -n net-snmp-ntpd
193 NTP SNMP AgentX subagent for Net-SNMP.
194
195 %package tools
196 Summary:        NTP tools
197 Group:          Applications/Networking
198 Obsoletes:      ntp-ntptrace
199
200 %description tools
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
204
205 %package doc-html
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
209 Group:          Documentation
210
211 %description doc-html
212 HTML documentation for ntp.
213
214 %description doc-html -l pl.UTF-8
215 Dokumentacja do ntp w HTML.
216
217 %description doc-html -l pt_BR.UTF-8
218 Este pacote contém documentação adicional sobre o NTP versão 4.
219
220 %prep
221 %setup -q -a7
222 %patch0 -p1
223 %patch1 -p1
224 %patch2 -p1
225 %patch3 -p1
226 %patch4 -p1
227 %patch5 -p1
228 %{!?with_avahi:%patch6 -p1}
229
230 ## FC patches
231 %patch101 -p1
232 %patch102 -p1
233 %patch103 -p1
234 %patch104 -p1
235 %patch105 -p1
236 %patch106 -p1
237 %patch107 -p1
238 %patch108 -p1
239 %patch109 -p1
240 %patch110 -p1
241 %patch112 -p1
242 %patch113 -p1
243 %patch114 -p1
244
245 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
246 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
247
248 %build
249 %{__libtoolize}
250 %{__aclocal} -I m4 -I libopts/m4
251 %{__autoconf}
252 %{__automake}
253 cd sntp
254 %{__libtoolize}
255 %{__aclocal} -I ../m4 -I libopts/m4
256 %{__autoconf}
257 %{__automake}
258 cd ..
259
260 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
261 %configure \
262         --with-binsubdir=sbin \
263         --enable-linuxcaps \
264         --enable-getifaddrs \
265         --enable-ipv6 \
266         --with-lineeditlibs=readline \
267         --with-crypto=openssl
268
269 %{__make}
270
271 %install
272 rm -rf $RPM_BUILD_ROOT
273 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1}
274
275 %{__make} install \
276         DESTDIR=$RPM_BUILD_ROOT
277
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
286
287 install -d $RPM_BUILD_ROOT/var/lib/ntp
288 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
289
290 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
291 #!/bin/sh
292 exec /sbin/service ntpdate cronsettime
293 EOF
294
295 install -d $RPM_BUILD_ROOT%{mibdir}
296 cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
297
298 %clean
299 rm -rf $RPM_BUILD_ROOT
300
301 %pre -n ntpd
302 %groupadd -g 246 ntp
303 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
304
305 %post -n ntpd
306 /sbin/chkconfig --add ntpd
307 %service ntpd restart "NTP Daemon"
308
309 %preun -n ntpd
310 if [ "$1" = "0" ]; then
311         %service ntpd stop
312         /sbin/chkconfig --del ntpd
313         rm -f /var/lib/ntp/drift
314 fi
315
316 %post -n ntpd-upstart
317 %upstart_post ntpd
318
319 %postun -n ntpd-upstart
320 %upstart_postun ntpd
321
322 %postun -n ntp
323 if [ "$1" = "0" ]; then
324         %userremove ntp
325         %groupremove ntp
326 fi
327
328
329 %pre -n ntpdate
330 %groupadd -g 246 ntp
331 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
332
333 %post -n ntpdate
334 /sbin/chkconfig --add ntpdate
335 %service ntpdate restart "NTP Date"
336
337 %preun -n ntpdate
338 if [ "$1" = "0" ]; then
339         %service ntpdate stop
340         /sbin/chkconfig --del ntpdate
341 fi
342
343 %postun -n ntpdate
344 if [ "$1" = "0" ]; then
345         %userremove ntp
346         %groupremove ntp
347 fi
348
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
352
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
360
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
365 fi
366
367 %files -n ntpd
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*
387
388 %dir %attr(770,root,ntp) /var/lib/ntp
389 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
390
391 %files -n ntpd-upstart
392 %defattr(644,root,root,755)
393 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
394
395 %files -n ntpdate
396 %defattr(644,root,root,755)
397 %doc COPYRIGHT
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*
403
404 %files -n mibs-ntp
405 %defattr(644,root,root,755)
406 %{mibdir}/ntpv4-mib.mib
407
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*
414
415 %files tools
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*
420
421 %files doc-html
422 %defattr(644,root,root,755)
423 %doc html/*
This page took 0.658287 seconds and 4 git commands to generate.