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