]>
Commit | Line | Data |
---|---|---|
90a82b10 JK |
1 | # |
2 | # TODO: | |
3 | # - check which of the 'FC patches' are actually needed and update them | |
4 | # as needed | |
5 | # - ntpdseem.1 manual page 'disappeared' | |
6 | # - warning: Installed (but unpackaged) file(s) found: | |
7 | # /usr/share/man/man1/ntpsnmpd.1.gz | |
8 | # | |
df3fadd8 | 9 | %include /usr/lib/rpm/macros.perl |
71bab42e | 10 | Summary: Network Time Protocol utilities |
fcc994b7 ER |
11 | Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol) |
12 | Summary(pt_BR.UTF-8): Network Time Protocol versão 4 | |
45771d3d | 13 | Name: ntp |
121d6d6f JK |
14 | Version: 4.2.6p1 |
15 | Release: 0.1 | |
a030fe3d | 16 | License: distributable |
aa729c5d | 17 | Group: Networking/Daemons |
5aa7cc17 | 18 | Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz |
121d6d6f | 19 | # Source0-md5: 0510396dfbde40678b92f808ec07c0d2 |
28dfddc3 | 20 | Source1: %{name}.conf |
21 | Source2: %{name}.keys | |
22 | Source3: %{name}.init | |
23 | Source4: %{name}.sysconfig | |
bc6615d5 ER |
24 | Source5: %{name}-client.init |
25 | Source6: %{name}-client.sysconfig | |
26 | Source7: %{name}-manpages.tar.gz | |
27 | # Source7-md5: 208fcc9019e19ab26d28e4597290bffb | |
121d6d6f | 28 | Source8: %{name}.upstart |
29f00086 | 29 | Patch0: %{name}-time.patch |
dbdd74ae | 30 | Patch1: %{name}-no_libelf.patch |
262e8067 | 31 | Patch2: %{name}-ipv6.patch |
e35272e3 | 32 | Patch3: %{name}-openssl_check.patch |
90a82b10 JK |
33 | Patch4: %{name}-nano.patch |
34 | Patch5: %{name}-ntpdc-link_order.patch | |
6fca7355 ER |
35 | # FC patches |
36 | Patch101: %{name}-4.2.4p4-kernel.patch | |
37 | Patch102: %{name}-4.2.4p0-droproot.patch | |
38 | Patch103: %{name}-4.2.4-groups.patch | |
39 | Patch104: %{name}-4.2.4p7-daemonpll.patch | |
40 | Patch106: %{name}-4.2.4p2-tentative.patch | |
41 | Patch107: %{name}-4.2.4p2-noseed.patch | |
42 | Patch108: %{name}-4.2.4p4-multilisten.patch | |
43 | Patch109: %{name}-4.2.4-html2man.patch | |
44 | Patch110: %{name}-4.2.4p5-htmldoc.patch | |
45 | Patch111: %{name}-4.2.4p2-filegen.patch | |
46 | Patch112: %{name}-4.2.4-sprintf.patch | |
47 | Patch114: %{name}-4.2.4p8-mlock.patch | |
48 | Patch115: %{name}-4.2.4p2-clockselect.patch | |
49 | Patch117: %{name}-4.2.4p7-sleep.patch | |
50 | Patch118: %{name}-4.2.4p7-bcast.patch | |
51 | Patch119: %{name}-4.2.4p0-retcode.patch | |
52 | Patch120: %{name}-4.2.4p2-noif.patch | |
53 | Patch122: %{name}-4.2.4p4-cmsgalign.patch | |
54 | Patch124: %{name}-4.2.4p4-resinit.patch | |
55 | Patch125: %{name}-4.2.4p5-rtnetlink.patch | |
56 | Patch126: %{name}-4.2.4p7-stamode.patch | |
57 | Patch127: %{name}-4.2.4p5-driftonexit.patch | |
58 | Patch129: %{name}-4.2.4p7-minpoll.patch | |
59 | Patch130: %{name}-4.2.4p7-freqmode.patch | |
60 | Patch133: %{name}-4.2.4p7-getprecision.patch | |
6cd8a392 | 61 | URL: http://www.ntp.org/ |
8338fb6d | 62 | BuildRequires: autoconf |
1ef6c8b4 | 63 | BuildRequires: automake |
61dbaaf1 | 64 | BuildRequires: libcap-devel |
8338fb6d | 65 | BuildRequires: libtool |
e35272e3 | 66 | BuildRequires: openssl-devel >= 0.9.7d |
ba10b9ba | 67 | BuildRequires: readline-devel >= 4.2 |
df3fadd8 | 68 | BuildRequires: rpm-perlprov >= 4.1-13 |
0d2671b6 | 69 | BuildRequires: rpmbuild(macros) >= 1.561 |
71bab42e | 70 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
71 | ||
72 | %define _sysconfdir /etc/ntp | |
73 | %define _bindir %{_sbindir} | |
74 | ||
e24d986a | 75 | %description |
28dfddc3 | 76 | The Network Time Protocol (NTP) is used to synchronize a computer's |
77 | time with another reference time source. The ntp package contains | |
78 | utilities and daemons which will synchronize your computer's time to | |
a47685aa | 79 | Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. |
71bab42e | 80 | |
00337413 JR |
81 | %description -l pl.UTF-8 |
82 | Network Time Protocol (NTP) służy do synchronizacji czasu komputera z | |
83 | innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony | |
84 | służące do dokładnego synchronizowania czasu komputera według czasu | |
cb15c3e4 | 85 | uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP. |
71bab42e | 86 | |
00337413 JR |
87 | %description -l pt_BR.UTF-8 |
88 | Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é | |
89 | utilizado para sincronizar o relógio do computador com uma outra | |
90 | referência de horário. Este pacote contém utilitários e servidores que | |
91 | sincronizarão o relógio do seu computador com o horário universal | |
92 | (UTC) através do protocolo NTP e utilizando servidores NTP públicos. | |
608ad171 | 93 | |
00337413 JR |
94 | Instale o pacote ntp se você necessitar de ferramentas para manter o |
95 | relógio do seu computador constantemente atualizado. | |
608ad171 | 96 | |
cb15c3e4 ER |
97 | %package -n ntpd |
98 | Summary: The NTP daemon | |
99 | Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol) | |
100 | Summary(pt_BR.UTF-8): Network Time Protocol versão 4 | |
101 | Group: Daemons | |
102 | Requires(post,preun): /sbin/chkconfig | |
932bc1ee ER |
103 | Requires(postun): /usr/sbin/groupdel |
104 | Requires(postun): /usr/sbin/userdel | |
105 | Requires(pre): /bin/id | |
106 | Requires(pre): /usr/bin/getgid | |
107 | Requires(pre): /usr/sbin/groupadd | |
108 | Requires(pre): /usr/sbin/useradd | |
0d2671b6 | 109 | Requires: rc-scripts >= 0.4.3.0 |
932bc1ee | 110 | Provides: group(ntp) |
cb15c3e4 ER |
111 | Provides: ntp = %{version}-%{release} |
112 | Provides: ntpdaemon | |
932bc1ee | 113 | Provides: user(ntp) |
f6fec3df | 114 | Obsoletes: ntp < 4.2.4p8-6 |
cb15c3e4 ER |
115 | Obsoletes: ntpdaemon |
116 | Obsoletes: openntpd | |
117 | Obsoletes: xntp3 | |
118 | ||
119 | %description -n ntpd | |
120 | The Network Time Protocol (NTP) is used to synchronize a computer's | |
121 | time with another reference time source. The ntp package contains | |
122 | utilities and daemons which will synchronize your computer's time to | |
123 | Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. | |
124 | ||
125 | This package includes ntpd (a daemon which continuously adjusts system | |
126 | time) | |
127 | ||
128 | %description -n ntpd -l pl.UTF-8 | |
129 | Network Time Protocol (NTP) służy do synchronizacji czasu komputera z | |
130 | innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony | |
131 | służące do dokładnego synchronizowania czasu komputera według czasu | |
132 | uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP. | |
133 | ||
134 | Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje | |
135 | czas systemowy) | |
136 | ||
137 | %description -n ntpd -l pt_BR.UTF-8 | |
138 | Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é | |
139 | utilizado para sincronizar o relógio do computador com uma outra | |
140 | referência de horário. Este pacote contém utilitários e servidores que | |
141 | sincronizarão o relógio do seu computador com o horário universal | |
142 | (UTC) através do protocolo NTP e utilizando servidores NTP públicos. | |
143 | ||
0d2671b6 JK |
144 | %package -n ntpd-upstart |
145 | Summary: Upstart job description for the NTP daemon | |
146 | Summary(pl.UTF-8): Opis zadania Upstart dla demona NTP | |
147 | Group: Daemons | |
148 | Requires: ntpd = %{version}-%{release} | |
149 | Requires: upstart >= 0.6 | |
150 | ||
151 | %description -n ntpd-upstart | |
152 | Upstart job description for the NTP daemon. | |
153 | ||
154 | %description -n ntpd-upstart -l pl.UTF-8 | |
155 | Opis zadania Upstart dla demona NTP. | |
156 | ||
cb15c3e4 ER |
157 | %package -n ntpdate |
158 | Summary: Utility to set the date and time via NTP | |
fcc994b7 | 159 | Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol) |
df3fadd8 | 160 | Group: Applications/Networking |
5acc7945 | 161 | Requires(post,preun): /sbin/chkconfig |
932bc1ee ER |
162 | Requires(postun): /usr/sbin/groupdel |
163 | Requires(postun): /usr/sbin/userdel | |
164 | Requires(pre): /bin/id | |
165 | Requires(pre): /usr/bin/getgid | |
166 | Requires(pre): /usr/sbin/groupadd | |
167 | Requires(pre): /usr/sbin/useradd | |
92517d76 ER |
168 | Provides: group(ntp) |
169 | Provides: user(ntp) | |
691bd31f | 170 | Conflicts: ntp < 4.2.0-3 |
cb15c3e4 ER |
171 | # for upgrades |
172 | Provides: ntp-client = %{version}-%{release} | |
f6fec3df | 173 | Obsoletes: ntp-client < 4.2.4p8-6 |
92517d76 ER |
174 | # virtual |
175 | Provides: ntpclient | |
176 | Obsoletes: ntpclient | |
e1e25342 | 177 | |
cb15c3e4 ER |
178 | %description -n ntpdate |
179 | ntpdate is a program for retrieving the date and time from NTP | |
180 | servers. | |
e1e25342 | 181 | |
cb15c3e4 | 182 | %description -n ntpdate -l pl.UTF-8 |
c771054a | 183 | Klient do synchronizacji czasu po NTP (Network Time Protocol). |
e1e25342 | 184 | |
2cf5b026 ER |
185 | %package tools |
186 | Summary: NTP tools | |
187 | Group: Applications/Networking | |
a9d9ccd1 | 188 | Obsoletes: ntp-ntptrace |
2cf5b026 ER |
189 | |
190 | %description tools | |
191 | This package contains ntp tools: | |
192 | - ntptrace: Trace a chain of NTP servers back to the primary source | |
193 | - ntp-wait: Wait for NTP server to synchronize | |
194 | ||
82f74dd4 ER |
195 | %package doc-html |
196 | Summary: HTML documentation for ntp | |
197 | Summary(pl.UTF-8): Dokumentacja HTML dla ntp | |
198 | Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp | |
199 | Group: Documentation | |
200 | ||
201 | %description doc-html | |
202 | HTML documentation for ntp. | |
203 | ||
204 | %description doc-html -l pl.UTF-8 | |
205 | Dokumentacja do ntp w HTML. | |
206 | ||
207 | %description doc-html -l pt_BR.UTF-8 | |
208 | Este pacote contém documentação adicional sobre o NTP versão 4. | |
209 | ||
e24d986a | 210 | %prep |
bc6615d5 | 211 | %setup -q -a7 |
29f00086 | 212 | %patch0 -p1 |
be68fcb1 | 213 | %patch1 -p1 |
262e8067 | 214 | %patch2 -p1 |
e35272e3 | 215 | %patch3 -p1 |
90a82b10 | 216 | %patch4 -p1 |
636118eb | 217 | %patch5 -p1 |
71bab42e | 218 | |
90a82b10 JK |
219 | #%# FC patches |
220 | #%%patch101 -p1 | |
221 | #%%patch102 -p1 | |
222 | #%%patch103 -p1 | |
223 | #%%patch104 -p1 | |
224 | #%%patch106 -p1 | |
225 | #%%patch107 -p1 | |
226 | #%%patch108 -p1 | |
227 | #%%patch109 -p1 | |
228 | #%%patch110 -p1 | |
229 | #%%patch111 -p1 | |
230 | #%%patch112 -p1 | |
231 | #%%patch114 -p1 | |
232 | #%%patch115 -p1 | |
233 | #%%patch117 -p1 | |
234 | #%%patch118 -p1 | |
235 | #%%patch119 -p1 | |
236 | #%%patch120 -p1 | |
237 | #%%patch122 -p1 | |
238 | #%%patch124 -p1 | |
239 | #%%patch125 -p1 | |
240 | #%%patch126 -p1 | |
241 | #%%patch127 -p1 | |
242 | #%%patch129 -p1 | |
243 | #%%patch130 -p1 | |
244 | #%%patch133 -p1 | |
6fca7355 | 245 | |
2c17d85d | 246 | echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac |
740223e3 | 247 | echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac |
2c17d85d | 248 | |
71bab42e | 249 | %build |
e35272e3 | 250 | %{__libtoolize} |
2c17d85d | 251 | %{__aclocal} -I m4 -I libopts/m4 |
e35272e3 JK |
252 | %{__autoconf} |
253 | %{__automake} | |
506da0ac | 254 | cd sntp |
255 | %{__libtoolize} | |
90a82b10 | 256 | %{__aclocal} -I ../m4 -I libopts/m4 |
506da0ac | 257 | %{__autoconf} |
258 | %{__automake} | |
506da0ac | 259 | cd .. |
740223e3 | 260 | |
90a82b10 | 261 | CPPFLAGS="%{rpmcppflags} -I/usr/include/readline" |
636118eb | 262 | %configure \ |
2c17d85d AM |
263 | --with-binsubdir=sbin \ |
264 | --enable-linuxcaps \ | |
265 | --enable-getifaddrs \ | |
266 | --enable-ipv6 \ | |
90a82b10 | 267 | --with-lineeditlibs=readline \ |
282eb0fc | 268 | --with-crypto=openssl |
deb05b4c | 269 | |
e24d986a | 270 | %{__make} |
71bab42e | 271 | |
272 | %install | |
273 | rm -rf $RPM_BUILD_ROOT | |
0d2671b6 | 274 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1} |
71bab42e | 275 | |
1bf23378 | 276 | %{__make} install \ |
277 | DESTDIR=$RPM_BUILD_ROOT | |
71bab42e | 278 | |
740223e3 ER |
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 | |
cb15c3e4 | 282 | install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate |
740223e3 | 283 | cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd |
cb15c3e4 | 284 | cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate |
0d2671b6 | 285 | install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf |
aa729c5d | 286 | cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
71bab42e | 287 | |
c52fbdbb ER |
288 | install -d $RPM_BUILD_ROOT/var/lib/ntp |
289 | touch $RPM_BUILD_ROOT/var/lib/ntp/drift | |
290 | ||
cb15c3e4 | 291 | cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF' |
394789ea | 292 | #!/bin/sh |
c52fbdbb | 293 | exec /sbin/service ntpdate cronsettime |
394789ea AM |
294 | EOF |
295 | ||
71bab42e | 296 | %clean |
be68fcb1 | 297 | rm -rf $RPM_BUILD_ROOT |
71bab42e | 298 | |
932bc1ee ER |
299 | %pre -n ntpd |
300 | %groupadd -g 246 ntp | |
301 | %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp | |
302 | ||
cb15c3e4 | 303 | %post -n ntpd |
e1e25342 | 304 | /sbin/chkconfig --add ntpd |
740223e3 | 305 | %service ntpd restart "NTP Daemon" |
e1e25342 | 306 | |
cb15c3e4 | 307 | %preun -n ntpd |
e1e25342 | 308 | if [ "$1" = "0" ]; then |
b9625068 | 309 | %service ntpd stop |
e1e25342 | 310 | /sbin/chkconfig --del ntpd |
c52fbdbb | 311 | rm -f /var/lib/ntp/drift |
e1e25342 MK |
312 | fi |
313 | ||
0d2671b6 JK |
314 | %post -n ntpd-upstart |
315 | %upstart_post ntpd | |
316 | ||
317 | %postun -n ntpd-upstart | |
318 | %upstart_postun ntpd | |
319 | ||
932bc1ee ER |
320 | %postun -n ntp |
321 | if [ "$1" = "0" ]; then | |
322 | %userremove ntp | |
323 | %groupremove ntp | |
324 | fi | |
325 | ||
0d2671b6 | 326 | |
92517d76 ER |
327 | %pre -n ntpdate |
328 | %groupadd -g 246 ntp | |
329 | %useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp | |
330 | ||
cb15c3e4 ER |
331 | %post -n ntpdate |
332 | /sbin/chkconfig --add ntpdate | |
333 | %service ntpdate restart "NTP Date" | |
e24d986a | 334 | |
cb15c3e4 | 335 | %preun -n ntpdate |
d470477a | 336 | if [ "$1" = "0" ]; then |
cb15c3e4 ER |
337 | %service ntpdate stop |
338 | /sbin/chkconfig --del ntpdate | |
d470477a | 339 | fi |
71bab42e | 340 | |
92517d76 ER |
341 | %postun -n ntpdate |
342 | if [ "$1" = "0" ]; then | |
343 | %userremove ntp | |
344 | %groupremove ntp | |
345 | fi | |
346 | ||
7e284bc0 ER |
347 | %triggerun -n ntpd -- ntp < 4.2.4p8-3.14 |
348 | # Prevent preun from ntp from working | |
349 | chmod a-x /etc/rc.d/init.d/ntpd | |
c52fbdbb | 350 | |
7e284bc0 ER |
351 | %triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14 |
352 | # Restore what triggerun removed | |
353 | chmod 754 /etc/rc.d/init.d/ntpd | |
c52fbdbb | 354 | sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf |
7e284bc0 ER |
355 | mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null |
356 | mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null | |
c52fbdbb ER |
357 | %service -q ntpd restart |
358 | ||
45735b52 ER |
359 | %triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2 |
360 | if [ -f /etc/sysconfig/ntp.rpmsave ]; then | |
361 | cp -f /etc/sysconfig/ntpdate{,.rpmnew} | |
362 | mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate | |
363 | fi | |
364 | ||
cb15c3e4 | 365 | %files -n ntpd |
71bab42e | 366 | %defattr(644,root,root,755) |
38034725 | 367 | %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT |
c771054a | 368 | %attr(750,root,root) %dir %{_sysconfdir} |
8fb3cd7e | 369 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/* |
8fb3cd7e | 370 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd |
2cf5b026 ER |
371 | %attr(754,root,root) /etc/rc.d/init.d/ntpd |
372 | %attr(755,root,root) %{_sbindir}/ntpd | |
373 | %attr(755,root,root) %{_sbindir}/ntpdc | |
374 | %attr(755,root,root) %{_sbindir}/ntp-keygen | |
375 | %attr(755,root,root) %{_sbindir}/ntpq | |
376 | %attr(755,root,root) %{_sbindir}/ntptime | |
377 | %attr(755,root,root) %{_sbindir}/sntp | |
378 | %attr(755,root,root) %{_sbindir}/tickadj | |
379 | %{_mandir}/man1/ntpd.1* | |
380 | %{_mandir}/man1/ntpdc.1* | |
90a82b10 | 381 | #%{_mandir}/man1/ntpdsim.1* |
2cf5b026 ER |
382 | %{_mandir}/man1/ntp-keygen.1* |
383 | %{_mandir}/man1/ntpq.1* | |
384 | %{_mandir}/man1/ntptime.1* | |
385 | %{_mandir}/man1/sntp.1* | |
386 | ||
c52fbdbb ER |
387 | %dir %attr(770,root,ntp) /var/lib/ntp |
388 | %attr(640,ntp,ntp) %ghost /var/lib/ntp/drift | |
389 | ||
0d2671b6 JK |
390 | %files -n ntpd-upstart |
391 | %defattr(644,root,root,755) | |
392 | %config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf | |
393 | ||
cb15c3e4 ER |
394 | %files -n ntpdate |
395 | %defattr(644,root,root,755) | |
396 | %doc COPYRIGHT | |
397 | %attr(755,root,root) %{_sbindir}/ntpdate | |
398 | %attr(754,root,root) /etc/rc.d/init.d/ntpdate | |
399 | %attr(754,root,root) /etc/cron.hourly/ntpdate | |
400 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate | |
401 | %{_mandir}/man1/ntpdate* | |
402 | ||
2cf5b026 | 403 | %files tools |
df3fadd8 ER |
404 | %defattr(644,root,root,755) |
405 | %attr(755,root,root) %{_sbindir}/ntptrace | |
2cf5b026 | 406 | %attr(755,root,root) %{_sbindir}/ntp-wait |
bc6615d5 | 407 | %{_mandir}/man1/ntptrace* |
2d74fa1d | 408 | |
409 | %files doc-html | |
a47685aa | 410 | %defattr(644,root,root,755) |
2d74fa1d | 411 | %doc html/* |