Пакет ntp: Specfile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
Name: ntp
Version: 4.2.8
#define vers_rc p5
Release: alt0.M60P.1
%define srcname %name-%version%{?vers_rc:%vers_rc}

Summary: The Network Time Protocol (NTP)
License: BSD-Style
Group: System/Configuration/Other
Url: http://www.ntp.org/

Packager: Dmitry Lebkov <dlebkov@altlinux.ru>

Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%srcname.tar.gz
Source1: ntpd.init
Source2: ntpd.sysconfig
Source3: %name.conf
Source4: %name.keys

Source11: ntp.1
Source12: ntpd.8
Source13: ntpdate.8
Source14: ntpsweep.8

Patch1: %name-4.2.6p5-alt-compile-dirty-hack-NANO.patch

Requires: ntp-doc = %version-%release
Requires: ntp-utils = %version-%release
Requires: ntpdate = %version-%release
Requires: ntpd = %version-%release

# due to readline library linked with tinfo.
BuildPreReq: libreadline-devel >= 4.3-alt5

# due to ntp_drop_priv.
BuildRequires: libcap-devel

# ntp_crypto_rnd.c:93: undefined reference to `arc4random_buf'
BuildRequires: libssl-devel

# Root directory for chrooted environment, must not be same as real system root.
%define ROOT /var/lib/ntpd

%package aux
Summary: The Network Time Protocol (NTP) auxiliary package
Group: System/Configuration/Other
Conflicts: ntp < 4.1.1b
BuildArch: noarch

%package doc
Summary: The Network Time Protocol (NTP) documentation
Group: Development/Other
Requires: ntp-aux = %version-%release
BuildArch: noarch

%package -n perl-NTP-Util
Summary: Perl NTP module
Group: Development/Perl
BuildArch: noarch

%package utils
Summary: The Network Time Protocol (NTP) utilities
Group: System/Base
Requires: ntpdate = %version-%release

%package -n ntpdate
Summary: Set the date and time via NTP
Group: System/Base
Requires: ntp-aux = %version-%release
Requires(pre): shadow-utils
Requires: /var/empty

%package -n ntpd
Summary: The Network Time Protocol daemon
Group: System/Servers
Requires: ntpdate = %version-%release
Obsoletes: xntp3
Requires(pre): shadow-utils
PreReq: service, coreutils
# due to ntp_intres.
Requires: /var/resolv
Provides: ntp-server

%description
The Network Time Protocol (NTP) is used to synchronize the time
of a computer client or server to another server or reference time source,
such as a radio or satellite receiver or modem.  It provides client
accuracies typically within a millisecond on LANs and up to a few tens of
milliseconds on WANs.

%description aux
The Network Time Protocol (NTP) is used to synchronize the time
of a computer client or server to another server or reference time source,
such as a radio or satellite receiver or modem.  It provides client
accuracies typically within a millisecond on LANs and up to a few tens of
milliseconds on WANs.

This is an auxiliary package.

%description doc
The Network Time Protocol (NTP) is used to synchronize the time
of a computer client or server to another server or reference time source,
such as a radio or satellite receiver or modem.  It provides client
accuracies typically within a millisecond on LANs and up to a few tens of
milliseconds on WANs.

This package contains NTP documentation.

%description -n perl-NTP-Util
Perl NTP module

%description utils
The Network Time Protocol (NTP) is used to synchronize the time
of a computer client or server to another server or reference time source,
such as a radio or satellite receiver or modem.  It provides client
accuracies typically within a millisecond on LANs and up to a few tens of
milliseconds on WANs.

This package contains various NTP utilities.

%description -n ntpd
The Network Time Protocol (NTP) is used to synchronize the time
of a computer client or server to another server or reference time source,
such as a radio or satellite receiver or modem.  It provides client
accuracies typically within a millisecond on LANs and up to a few tens of
milliseconds on WANs.

This package contains Network Time Protocol daemon.

%description -n ntpdate
The Network Time Protocol (NTP) is used to synchronize the time
of a computer client or server to another server or reference time source,
such as a radio or satellite receiver or modem.  It provides client
accuracies typically within a millisecond on LANs and up to a few tens of
milliseconds on WANs.

This package contains ntpdate program for retrieving the date and time
from remote machines via a network.

%prep
%setup -q -n %srcname

%patch1 -p1

# Fix progname initialization when argc==0.
fgrep -rl 'progname = argv[0];' . |
	xargs grep -l 'main *(' |
	while read f; do
		n="${f##*/}"
		n="${n%%.c}"
		subst 's/progname = argv\[0\];/progname = argc ? argv[0] : "PROGNAME";/' "$f"
		subst "s/PROGNAME/$n/" "$f"
	done

%__install -p -m644 %SOURCE2 ntpd.sysconfig
%__install -p -m644 $RPM_SOURCE_DIR/{ntp.1,{ntpd,ntpdate,ntpsweep}.8} .

find -type f -print0 |
	xargs -r0 %__grep -FZl '@ROOT@' -- |
	xargs -r0 %__subst -p 's,@ROOT@,%ROOT,g' --

%build
%add_optflags -D_GNU_SOURCE
%define _bindir %_sbindir
#autoreconf --force --verbose

%configure \
	--enable-linuxcaps \
	--without-readline
echo '#define HAVE_LIBREADLINE 1' >>config.h

%make_build

%install
make DESTDIR=$RPM_BUILD_ROOT perllibdir=%perl_vendor_privlib install

%__install -p -m755 scripts/ntpsweep/ntpsweep $RPM_BUILD_ROOT%_sbindir/

# Manpages.
%__mkdir_p $RPM_BUILD_ROOT{%_man1dir,%_man8dir}
%__install -p -m644 ntp.1 $RPM_BUILD_ROOT%_man1dir/
%__install -p -m644 {ntpd,ntpdate,ntpsweep}.8 $RPM_BUILD_ROOT%_man8dir/
for f in $RPM_BUILD_ROOT%_sbindir/*; do
	t="$RPM_BUILD_ROOT%_man8dir/${f##*/}.8"
	[ -f "$t" ] || %__ln_s ../man1/ntp.1 "$t"
done

# Docs.
%define docdir %_docdir/%name-%version
%__mkdir_p $RPM_BUILD_ROOT%docdir
mv $RPM_BUILD_ROOT%_docdir/ntp4 $RPM_BUILD_ROOT%docdir
mv $RPM_BUILD_ROOT%_docdir/sntp $RPM_BUILD_ROOT%docdir
%__cp -a COPYRIGHT NEWS TODO WHERE-TO-START README.bk README.hackers README.refclocks README.versions \
	$RPM_BUILD_ROOT%docdir/


%__install -pD -m755 %SOURCE1 $RPM_BUILD_ROOT%_initdir/ntpd
%__install -pD -m644 ntpd.sysconfig $RPM_BUILD_ROOT%_sysconfdir/sysconfig/ntpd
%__install -pD -m600 %SOURCE3 $RPM_BUILD_ROOT%_sysconfdir/%name.conf

%__mkdir_p $RPM_BUILD_ROOT%ROOT/tmp
%__install -pD -m600 %SOURCE4 $RPM_BUILD_ROOT%ROOT%_sysconfdir/%name/keys
touch $RPM_BUILD_ROOT%ROOT%_sysconfdir/%name/{drift,step-tickers}
%__ln_s ..%ROOT%_sysconfdir/%name $RPM_BUILD_ROOT%_sysconfdir/

%define r_dir %ROOT%_sysconfdir/%name
%define r_link %_sysconfdir/%name

%pre -n ntpdate
/usr/sbin/groupadd -r -f ntpd
/usr/sbin/useradd -r -g ntpd -d /dev/null -s /dev/null -n ntpd >/dev/null 2>&1 ||:

%pre -n ntpd
/usr/sbin/groupadd -r -f ntpd
/usr/sbin/useradd -r -g ntpd -d /dev/null -s /dev/null -n ntpd >/dev/null 2>&1 ||:
f=%r_link
if [ -d "$f" -a ! -L "$f" ]; then
	%__rm -rf "$f"
	/bin/touch "$f.RPMLOCK"
fi

%post -n ntpd
if [ $1 = 1 ]; then
        /sbin/chkconfig --add ntpd
fi
d=%r_dir
f=%r_link
if [ -f "$f.RPMLOCK" -a -d "$f" -a ! -d "$d.RPMSAVE" ]; then
	%__mv "$d" "$d.RPMSAVE"
	%__rm -f "$f.RPMLOCK"
else
	/sbin/service ntpd condrestart ||:
fi

%preun -n ntpd
%preun_service ntpd

%triggerpostun -n ntpd -- %name < 4.1.1b
d=%r_dir
if [ -d "$d.RPMSAVE" -a ! -d "$d" ]; then
	%__mv "$d.RPMSAVE" "$d"
	/sbin/service ntpd condrestart ||:
fi

%files

%files aux

%files doc
%dir %docdir
%docdir/ntp4
%docdir/sntp
%docdir/[A-Z]*

%files -n perl-NTP-Util
%dir %perl_vendor_privlib/NTP
%perl_vendor_privlib/NTP/Util.pm

%files utils
%_sbindir/*
%_mandir/man?/*
%exclude %_sbindir/ntpd
%exclude %_sbindir/ntpdate
%exclude %_man1dir/ntpd.1
%exclude %_man8dir/ntpd.*
%exclude %_man8dir/ntpdate.*

%files -n ntpdate
%_sbindir/ntpdate
%_man8dir/ntpdate.*

%files -n ntpd
%config %_initdir/ntpd
%config(noreplace) %_sysconfdir/sysconfig/ntpd
%config(noreplace) %_sysconfdir/%name.conf
%_sysconfdir/%name
%_sbindir/ntpd
%_man8dir/ntpd.*
%_man1dir/ntpd.1

%defattr(640,root,ntpd,710)
%dir %ROOT
%dir %ROOT%_sysconfdir
%attr(1770,root,ntpd) %dir %ROOT/tmp
%attr(1770,root,ntpd) %dir %ROOT%_sysconfdir/%name
%config(noreplace) %ROOT%_sysconfdir/%name/keys
%config(noreplace) %verify(not md5 size mtime) %ROOT%_sysconfdir/%name/step-tickers
%attr(640,ntpd,ntpd) %ghost %ROOT%_sysconfdir/%name/drift

%changelog
* Wed Dec 24 2014 Sergey Y. Afonin <asy@altlinux.ru> 4.2.8-alt0.M60P.1
- branch p6 backport

* Mon Dec 22 2014 Sergey Y. Afonin <asy@altlinux.ru> 4.2.8-alt1
- 4.2.8 (ALT #30591, CVEs 2014 9293-9296)
- refactored ntp.conf (ALT #19494#c7)

* Wed Feb 26 2014 Sergey Y. Afonin <asy@altlinux.ru> 4.2.6-alt0.M60P.2
- branch p6 backport

* Tue Feb 18 2014 Sergey Y. Afonin <asy@altlinux.ru> 4.2.6-alt2
- refactored ntp.conf (temporary solution for ALT #19494)

* Fri Feb 14 2014 Sergey Y. Afonin <asy@altlinux.ru> 4.2.6-alt1
- NMU
- 4.2.6p5 (closes: #27162)
- removed unsupported option from ntp.conf (closes: #27162)
- added "disable monitor" to ntp.conf (CVE-2013-5211)
- moved man1/ntpd.1.gz to ntpd package (closes: #27948)
- added "BuildArch: noarch" for ntp-aux and ntp-doc

* Wed May 20 2009 Dmitry Lebkov <dlebkov@altlinux.ru> 4.2.4-alt5.p7
- 4.2.4p7
- fix for CVE-2009-1252 (closes: #20099)
- fix for CVE-2009-0159 (closes: #19779)

* Sun Apr 05 2009 Stanislav Ievlev <inger@altlinux.org> 4.2.4-alt4.p6.1
- Provides ntp-server

* Sat Jan 10 2009 Dmitry Lebkov <dlebkov@altlinux.ru> 4.2.4-alt4.p6
- 4.2.4p6 ( fix for http://www.ocert.org/advisories/ocert-2008-016.html )
- LSB header for init-script

* Sat Apr 05 2008 Dmitry Lebkov <dlebkov@altlinux.ru> 4.2.4-alt3.p4
- add NTPD_GROUP to /etc/sysconfig/ntpd and init-script

* Tue Apr 01 2008 Dmitry Lebkov <dlebkov@altlinux.ru> 4.2.4-alt2.p4
- add ntptrace output to service ntp status (#8411)
  + fix from Denis Smirnov <mithraen@altlinux.ru> in 4.2.2-alt2.p4.3
- add pid-file creation to init-script (#3825)

* Sun Mar 30 2008 Dmitry Lebkov <dlebkov@altlinux.ru> 4.2.4-alt1.p4
- 4.2.4p4
- fix for #11139 and #13233

* Mon Mar 12 2007 Dmitry Lebkov <dlebkov@altlinux.ru> 4.2.4-alt1.p0
- 4.2.4p0

* Fri Nov 24 2006 Denis Smirnov <mithraen@altlinux.ru> 4.2.2-alt1.p4.3
- fix buffer overflow in WWV Audio driver (#216309 from fedora)

* Sun Nov 19 2006 Denis Smirnov <mithraen@altlinux.ru> 4.2.2-alt1.p4.2
- Chroot and change user to ntpd by default
- Ignore -T in ntpdate (for compatibility with old /etc/sysconfig/ntp)

* Fri Nov 17 2006 Denis Smirnov <mithraen@altlinux.ru> 4.2.2-alt1.p4.1
- Version update

* Fri Dec 30 2005 ALT QA Team Robot <qa-robot@altlinux.org> 4.1.2-alt3.1
- Rebuilt with libreadline.so.5.

* Tue Apr 20 2004 Dmitry V. Levin <ldv@altlinux.org> 4.1.2-alt3
- ntpd, ntpdate:
  Do not try to drop privileges when run by unprivileged user.
- ntpd: Create pid file by default.
- Fix progname initialization when argc==0.
- Updated alt-tinfo patch (now called alt-readline patch).

* Sun Feb 15 2004 Dmitry V. Levin <ldv@altlinux.org> 4.1.2-alt2
- Fixed chroot jailing and droppriv code (#3461).
- Changed default settings:
  ntpd: switch to ntpd:ntpd, chroot to %ROOT;
  ntp_intres: switch to ntpd:ntpd, chroot to /var/resolv;
  ntpdate: switch to ntpd:ntpd, chroot to /var/empty.
- Added auxiliary subpackage for better interpackage dependencies.

* Sun Aug 17 2003 Dmitry V. Levin <ldv@altlinux.org> 4.1.2-alt1
- Updated to 4.1.2.
- Rewritten start/stop script to new rc scheme.

* Tue Feb 25 2003 Dmitry V. Levin <ldv@altlinux.org> 4.1.1c-alt1.rc1
- Updated to 4.1.1c-rc1.
- More new RH patches to be considered:
  4.1.73-limit, 4.1.1c-loopfilter.

* Tue Nov 19 2002 Dmitry V. Levin <ldv@altlinux.org> 4.1.1b-alt1
- Updated to 4.1.1b.
- Merged in RH patches:
  + ntp-4.1.0b-rc1-genkey
  + ntp-4.1.1a-genkey2
  - ntp-4.1.1a-mfp (not needed in 4.1.1b)
- Updated droproot patch.
- Removed ntp-4.0.99j-rh-vsnprintf patch (merged upstream).
- Enabled (fixed) readline support.
- Packaged ntpsweep.
- Added manpages from Debian
  (and mentioned our chroot support options there).
- Split into several subpackages.

* Tue Apr 16 2002 Dmitry V. Levin <ldv@altlinux.org> 4.1.1-alt3
- Updated startup script.
- Updated dependencies.

* Mon Apr 01 2002 Dmitry V. Levin <ldv@altlinux.org> 4.1.1-alt2
- 4.1.1
- Chrooted by default to %ROOT.
- Updated default config (cornet).

* Wed Oct 03 2001 Dmitry V. Levin <ldv@altlinux.ru> 4.1.0-alt1
- 4.1.0 (not chrooted yet).

* Thu May 17 2001 Dmitry V. Levin <ldv@altlinux.ru> 4.0.99k-ipl4mdk
- Conflicts: xntp3
- Use service macros.

* Mon Apr 09 2001 Dmitry V. Levin <ldv@altlinux.ru> 4.0.99k-ipl3mdk
- Fixed buffer overrun.
- Fixed glibc-2.2.2 compilation.

* Sat Jan 20 2001 Dmitry V. Levin <ldv@fandra.org> 4.0.99k-ipl2mdk
- RE adaptions.

* Thu Aug 31 2000 Warly <warly@mandrakesoft.com> 4.0.99k-2mdk
- add condrestart

* Mon Jul 24 2000 Warly <warly@mandrakesoft.com> 4.0.99k-1mdk
- new release
- BM

* Wed Apr 05 2000 Daouda Lo <daouda@mandrakesoft.com> 4.0.99g-3mdk
- fix the conf files permissions
- bunzip'ed conf files

* Fri Mar 31 2000 Warly <warly@mandrakesoft.com> 4.0.99g-2mdk
- New group: System/Configuration/Other

* Tue Mar 07 2000 Daouda LO <daouda@mandrakesoft.com>
- Mandrakised (relocatable + %%define )

* Sun May 23 1999 David E. Myers <dem@skyline.rtp.nc.us>
- Changes for submission to Red Hat Contrib|Net.

* Wed Apr 14 1999 Cristian Gafton <gafton@redhat.com>
- disallow remote updates by default in ntp.conf (#2170)

* Fri Mar 26 1999 Cristian Gafton <gafton@redhat.com>
- use %configure
- fix initscript not to sit out the output of ntpdate (use syslog instead)
- eliminate subshell from the install stage

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 9)

* Sun Nov 22 1998 Jeff Johnson <jbj@redhat.com>
- ntp.conf: default local clock stratum to 10.

* Wed Oct 21 1998 Jeff Johnson <jbj@redhat.com>
- update to 5.93e.

* Mon Oct 12 1998 Cristian Gafton <gafton@redhat.com>
- strip binaries

* Thu Aug  6 1998 Jeff Johnson <jbj@redhat.com>
- update to 5.93c.
- implement suggestions from James Youngman <JYoungman@vggas.com>:
-   correct default /etc/ntp/keys
-   use /etc/ntp/step-tickers for ntpdate hosts

* Sun May 10 1998 Cristian Gafton <gafton@redhat.com>
- start it after named

* Mon May 04 1998 Jeff Johnson <jbj@redhat.com>
- Update to 5.93.

* Mon Feb  2 1998 Jeff Johnson <jbj@jbj.org>
- Fiddles for RH-5.0. Update to xntp3-5.92.

* Mon Feb  2 1998 Jeff Johnson <jbj@jbj.org>
- Fiddles for RH-5.0. Update to xntp3-5.92.

* Sat Oct 18 1997 Manoj Kasichainula <manojk@io.com>
- Initial release for 5.91