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