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