]> git.pld-linux.org Git - packages/ntp.git/blob - ntp.spec
bf6ec25bae4f4e6b1abf2d888fff6775b619d71e
[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.6p3
14 Release:        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:  59876a9009b098ff59767ee45a88ebd2
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:        ntp.upstart
28 Source9:        ntpdate.upstart
29 Patch0:         %{name}-time.patch
30 Patch1:         %{name}-no_libelf.patch
31 Patch2:         %{name}-ipv6.patch
32 Patch3:         %{name}-nano.patch
33 Patch4:         %{name}-no_avahi.patch
34 # FC patches + 100
35 Patch101:       %{name}-4.2.6p1-sleep.patch
36 Patch102:       %{name}-4.2.6p1-droproot.patch
37 Patch103:       %{name}-4.2.6p1-bcast.patch
38 Patch104:       %{name}-4.2.6p1-cmsgalign.patch
39 Patch105:       %{name}-4.2.6p1-linkfastmath.patch
40 Patch106:       %{name}-4.2.6p1-tentative.patch
41 Patch107:       %{name}-4.2.6p1-retcode.patch
42 Patch108:       %{name}-4.2.6p1-rtnetlink.patch
43 Patch109:       %{name}-4.2.6p1-html2man.patch
44 Patch110:       %{name}-4.2.6p1-htmldoc.patch
45 Patch112:       %{name}-4.2.4p7-getprecision.patch
46 Patch113:       %{name}-4.2.6p1-logdefault.patch
47 Patch114:       %{name}-4.2.6p1-mlock.patch
48 Patch116:       %{name}-4.2.6p3-nosyspeer.patch
49 Patch117:       %{name}-4.2.6p3-broadcastdelay.patch
50 Patch118:       %{name}-4.2.6p3-delaycalib.patch
51 Patch119:       %{name}-4.2.6p3-ntpdaterecv.patch
52 URL:            http://www.ntp.org/
53 BuildRequires:  autoconf
54 BuildRequires:  automake
55 %{?with_avahi:BuildRequires:    avahi-compat-libdns_sd-devel}
56 BuildRequires:  libcap-devel
57 BuildRequires:  libnl-devel
58 BuildRequires:  libtool
59 BuildRequires:  net-snmp-devel
60 BuildRequires:  openssl-devel >= 0.9.7d
61 BuildRequires:  pciutils-devel
62 BuildRequires:  readline-devel >= 4.2
63 BuildRequires:  rpm-perlprov >= 4.1-13
64 BuildRequires:  rpmbuild(macros) >= 1.561
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 %define         _sysconfdir     /etc/ntp
68 %define         _bindir         %{_sbindir}
69 %define         mibdir          %{_datadir}/mibs
70
71 %description
72 The Network Time Protocol (NTP) is used to synchronize a computer's
73 time with another reference time source. The ntp package contains
74 utilities and daemons which will synchronize your computer's time to
75 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
76
77 %description -l pl.UTF-8
78 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
79 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
80 służące do dokładnego synchronizowania czasu komputera według czasu
81 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
82
83 %description -l pt_BR.UTF-8
84 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
85 utilizado para sincronizar o relógio do computador com uma outra
86 referência de horário. Este pacote contém utilitários e servidores que
87 sincronizarão o relógio do seu computador com o horário universal
88 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
89
90 Instale o pacote ntp se você necessitar de ferramentas para manter o
91 relógio do seu computador constantemente atualizado.
92
93 %package -n ntpd
94 Summary:        The NTP daemon
95 Summary(pl.UTF-8):      Narzędzia do synchronizacji czasu (Network Time Protocol)
96 Summary(pt_BR.UTF-8):   Network Time Protocol versão 4
97 Group:          Daemons
98 Requires(post,preun):   /sbin/chkconfig
99 Requires(postun):       /usr/sbin/groupdel
100 Requires(postun):       /usr/sbin/userdel
101 Requires(pre):  /bin/id
102 Requires(pre):  /usr/bin/getgid
103 Requires(pre):  /usr/sbin/groupadd
104 Requires(pre):  /usr/sbin/useradd
105 Requires:       rc-scripts >= 0.4.3.0
106 Provides:       group(ntp)
107 Provides:       ntp = %{version}-%{release}
108 Provides:       ntpdaemon
109 Provides:       user(ntp)
110 Obsoletes:      ntp < 4.2.4p8-6
111 Obsoletes:      ntpdaemon
112 Obsoletes:      ntpd-upstart
113 Obsoletes:      openntpd
114 Obsoletes:      xntp3
115
116 %description -n ntpd
117 The Network Time Protocol (NTP) is used to synchronize a computer's
118 time with another reference time source. The ntp package contains
119 utilities and daemons which will synchronize your computer's time to
120 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
121
122 This package includes ntpd (a daemon which continuously adjusts system
123 time)
124
125 %description -n ntpd -l pl.UTF-8
126 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
127 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
128 służące do dokładnego synchronizowania czasu komputera według czasu
129 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
130
131 Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
132 czas systemowy)
133
134 %description -n ntpd -l pt_BR.UTF-8
135 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
136 utilizado para sincronizar o relógio do computador com uma outra
137 referência de horário. Este pacote contém utilitários e servidores que
138 sincronizarão o relógio do seu computador com o horário universal
139 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
140
141 %package -n ntpdate
142 Summary:        Utility to set the date and time via NTP
143 Summary(pl.UTF-8):      Klient do synchronizacji czasu po NTP (Network Time Protocol)
144 Group:          Applications/Networking
145 Requires(post,preun):   /sbin/chkconfig
146 Requires(postun):       /usr/sbin/groupdel
147 Requires(postun):       /usr/sbin/userdel
148 Requires(pre):  /bin/id
149 Requires(pre):  /usr/bin/getgid
150 Requires(pre):  /usr/sbin/groupadd
151 Requires(pre):  /usr/sbin/useradd
152 Requires:       rc-scripts >= 0.4.3.0
153 Provides:       group(ntp)
154 Provides:       user(ntp)
155 Conflicts:      ntp < 4.2.0-3
156 # for upgrades
157 Provides:       ntp-client = %{version}-%{release}
158 Obsoletes:      ntp-client < 4.2.4p8-6
159 # virtual
160 Provides:       ntpclient
161 Obsoletes:      ntpclient
162
163 %description -n ntpdate
164 ntpdate is a program for retrieving the date and time from NTP
165 servers.
166
167 %description -n ntpdate -l pl.UTF-8
168 Klient do synchronizacji czasu po NTP (Network Time Protocol).
169
170 %package -n mibs-ntp
171 Summary:        MIBs for NTP time entities
172 Group:          Applications/System
173 Requires:       mibs-dirs
174
175 %description -n mibs-ntp
176 The Management Information Base for NTP time entities.
177
178 %package -n net-snmp-ntpd
179 Summary:        NTP SNMP subagent for Net-SNMP
180 Group:          Daemons
181 Requires(post,preun):   /sbin/chkconfig
182 Requires:       net-snmp
183 Requires:       rc-scripts
184 Suggests:       mibs-ntp
185
186 %description -n net-snmp-ntpd
187 NTP SNMP AgentX subagent for Net-SNMP.
188
189 %package tools
190 Summary:        NTP tools
191 Group:          Applications/Networking
192 Obsoletes:      ntp-ntptrace
193
194 %description tools
195 This package contains ntp tools:
196 - ntptrace: Trace a chain of NTP servers back to the primary source
197 - ntp-wait: Wait for NTP server to synchronize
198
199 %package doc-html
200 Summary:        HTML documentation for ntp
201 Summary(pl.UTF-8):      Dokumentacja HTML dla ntp
202 Summary(pt_BR.UTF-8):   Documentação adicional para o pacote ntp
203 Group:          Documentation
204
205 %description doc-html
206 HTML documentation for ntp.
207
208 %description doc-html -l pl.UTF-8
209 Dokumentacja do ntp w HTML.
210
211 %description doc-html -l pt_BR.UTF-8
212 Este pacote contém documentação adicional sobre o NTP versão 4.
213
214 %prep
215 %setup -q -a7
216 %patch0 -p1
217 %patch1 -p1
218 %patch2 -p1
219 %patch3 -p1
220 %{!?with_avahi:%patch4 -p1}
221
222 ## FC patches
223 %patch101 -p1
224 %patch102 -p1
225 %patch103 -p1
226 %patch104 -p1
227 %patch105 -p1
228 %patch106 -p1
229 %patch107 -p1
230 %patch108 -p1
231 %patch109 -p1
232 %patch110 -p1
233 %patch112 -p1
234 %patch113 -p1
235 %patch114 -p1
236 %patch116 -p1
237 %patch117 -p1
238 %patch118 -p1
239 %patch119 -p1
240
241 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
242 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
243
244 %build
245 %{__libtoolize}
246 %{__aclocal} -I m4 -I sntp/libopts/m4
247 %{__autoconf}
248 %{__automake}
249 cd sntp
250 %{__libtoolize}
251 %{__aclocal} -I ../m4 -I libopts/m4
252 %{__autoconf}
253 %{__automake}
254 cd ..
255
256 CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
257 %configure \
258         --with-binsubdir=sbin \
259         --enable-linuxcaps \
260         --enable-getifaddrs \
261         --enable-ipv6 \
262         --with-lineeditlibs=readline \
263         --with-crypto=openssl
264
265 %{__make}
266
267 %install
268 rm -rf $RPM_BUILD_ROOT
269 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1}
270
271 %{__make} install \
272         DESTDIR=$RPM_BUILD_ROOT
273
274 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
275 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
276 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
277 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
278 cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
279 cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
280 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
281 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/init/ntpdate.conf
282 cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
283
284 install -d $RPM_BUILD_ROOT/var/lib/ntp
285 touch $RPM_BUILD_ROOT/var/lib/ntp/drift
286
287 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
288 #!/bin/sh
289 exec /sbin/service ntpdate cronsettime
290 EOF
291
292 install -d $RPM_BUILD_ROOT%{mibdir}
293 cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
294
295 %clean
296 rm -rf $RPM_BUILD_ROOT
297
298 %pre -n ntpd
299 %groupadd -g 246 ntp
300 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
301
302 %post -n ntpd
303 /sbin/chkconfig --add ntpd
304 %service ntpd restart "NTP Daemon"
305
306 %preun -n ntpd
307 if [ "$1" = "0" ]; then
308         %service ntpd stop
309         /sbin/chkconfig --del ntpd
310         rm -f /var/lib/ntp/drift
311 fi
312
313 %postun -n ntp
314 if [ "$1" = "0" ]; then
315         %userremove ntp
316         %groupremove ntp
317 fi
318
319
320 %pre -n ntpdate
321 %groupadd -g 246 ntp
322 %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
323
324 %post -n ntpdate
325 /sbin/chkconfig --add ntpdate
326 %service ntpdate restart "NTP Date"
327
328 %preun -n ntpdate
329 if [ "$1" = "0" ]; then
330         %service ntpdate stop
331         /sbin/chkconfig --del ntpdate
332 fi
333
334 %postun -n ntpdate
335 if [ "$1" = "0" ]; then
336         %userremove ntp
337         %groupremove ntp
338 fi
339
340 %triggerun -n ntpd -- ntp < 4.2.4p8-3.14
341 # Prevent preun from ntp from working
342 chmod a-x /etc/rc.d/init.d/ntpd
343
344 %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
345 # Restore what triggerun removed
346 chmod 754 /etc/rc.d/init.d/ntpd
347 sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
348 mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
349 mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
350 %service -q ntpd restart
351
352 %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
353 if [ -f /etc/sysconfig/ntp.rpmsave ]; then
354         cp -f /etc/sysconfig/ntpdate{,.rpmnew}
355         mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
356 fi
357
358 %files -n ntpd
359 %defattr(644,root,root,755)
360 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
361 %attr(750,root,root) %dir %{_sysconfdir}
362 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
363 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
364 %attr(754,root,root) /etc/rc.d/init.d/ntpd
365 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
366 %attr(755,root,root) %{_sbindir}/ntpd
367 %attr(755,root,root) %{_sbindir}/ntpdc
368 %attr(755,root,root) %{_sbindir}/ntp-keygen
369 %attr(755,root,root) %{_sbindir}/ntpq
370 %attr(755,root,root) %{_sbindir}/ntptime
371 %attr(755,root,root) %{_sbindir}/sntp
372 %attr(755,root,root) %{_sbindir}/tickadj
373 %{_mandir}/man1/ntpd.1*
374 %{_mandir}/man1/ntpdc.1*
375 %{_mandir}/man1/ntp-keygen.1*
376 %{_mandir}/man1/ntpq.1*
377 %{_mandir}/man1/ntptime.1*
378 %{_mandir}/man1/sntp.1*
379
380 %dir %attr(770,root,ntp) /var/lib/ntp
381 %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
382
383 %files -n ntpdate
384 %defattr(644,root,root,755)
385 %doc COPYRIGHT
386 %attr(755,root,root) %{_sbindir}/ntpdate
387 %attr(754,root,root) /etc/rc.d/init.d/ntpdate
388 %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpdate.conf
389 %attr(754,root,root) /etc/cron.hourly/ntpdate
390 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
391 %{_mandir}/man1/ntpdate*
392
393 %files -n mibs-ntp
394 %defattr(644,root,root,755)
395 %{mibdir}/ntpv4-mib.mib
396
397 %files -n net-snmp-ntpd
398 %defattr(644,root,root,755)
399 %doc ntpsnmpd/README
400 %attr(755,root,root) %{_sbindir}/ntpsnmpd
401 %{_mandir}/man1/ntpsnmpd.1*
402
403 %files tools
404 %defattr(644,root,root,755)
405 %attr(755,root,root) %{_sbindir}/ntptrace
406 %attr(755,root,root) %{_sbindir}/ntp-wait
407 %{_mandir}/man1/ntptrace*
408
409 %files doc-html
410 %defattr(644,root,root,755)
411 %doc html/*
This page took 0.047584 seconds and 3 git commands to generate.