]> git.pld-linux.org Git - packages/ntp.git/blame - ntp.spec
verbose files; cosmetics
[packages/ntp.git] / ntp.spec
CommitLineData
90a82b10 1# TODO:
a4cc90b2
ER
2# - enable and package ntpdsim?
3# - net-snmp-ntpd needs initscript
8f6c2b65
JK
4#
5# Conditional build:
6%bcond_without avahi # disable DNS-SD support via Avahi
a4cc90b2 7
df3fadd8 8%include /usr/lib/rpm/macros.perl
71bab42e 9Summary: Network Time Protocol utilities
fcc994b7
ER
10Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
11Summary(pt_BR.UTF-8): Network Time Protocol versão 4
45771d3d 12Name: ntp
3f2c666b 13Version: 4.2.6p5
784e30ae 14Release: 8
a030fe3d 15License: distributable
aa729c5d 16Group: Networking/Daemons
5aa7cc17 17Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
3f2c666b 18# Source0-md5: 00df80a84ec9528fcfb09498075525bc
28dfddc3 19Source1: %{name}.conf
20Source2: %{name}.keys
21Source3: %{name}.init
22Source4: %{name}.sysconfig
bc6615d5
ER
23Source5: %{name}-client.init
24Source6: %{name}-client.sysconfig
25Source7: %{name}-manpages.tar.gz
26# Source7-md5: 208fcc9019e19ab26d28e4597290bffb
299584e5
ER
27Source8: %{name}.upstart
28Source9: %{name}date.upstart
29Source10: %{name}date-wrapper
30Source11: %{name}d.service
31Source12: %{name}date.service
29f00086 32Patch0: %{name}-time.patch
dbdd74ae 33Patch1: %{name}-no_libelf.patch
262e8067 34Patch2: %{name}-ipv6.patch
0ffcfbfc
KK
35Patch3: %{name}-nano.patch
36Patch4: %{name}-no_avahi.patch
f59e8d31 37Patch5: %{name}-format-security.patch
a8809dbd
ER
38# FC patches + 100
39Patch101: %{name}-4.2.6p1-sleep.patch
40Patch102: %{name}-4.2.6p1-droproot.patch
41Patch103: %{name}-4.2.6p1-bcast.patch
42Patch104: %{name}-4.2.6p1-cmsgalign.patch
43Patch105: %{name}-4.2.6p1-linkfastmath.patch
44Patch106: %{name}-4.2.6p1-tentative.patch
45Patch107: %{name}-4.2.6p1-retcode.patch
46Patch108: %{name}-4.2.6p1-rtnetlink.patch
15931ca5
AG
47Patch109: %{name}-4.2.4p7-getprecision.patch
48Patch110: %{name}-4.2.6p1-logdefault.patch
49Patch111: %{name}-4.2.6p1-mlock.patch
50Patch112: %{name}-4.2.6p3-broadcastdelay.patch
51Patch113: %{name}-4.2.6p3-delaycalib.patch
6cd8a392 52URL: http://www.ntp.org/
8338fb6d 53BuildRequires: autoconf
1ef6c8b4 54BuildRequires: automake
8f6c2b65 55%{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel}
61dbaaf1 56BuildRequires: libcap-devel
8ee97dcb 57BuildRequires: libnl-devel
8338fb6d 58BuildRequires: libtool
5ecb988f 59BuildRequires: net-snmp-devel
e35272e3 60BuildRequires: openssl-devel >= 0.9.7d
28341528 61BuildRequires: pciutils-devel
ba10b9ba 62BuildRequires: readline-devel >= 4.2
df3fadd8 63BuildRequires: rpm-perlprov >= 4.1-13
034cfc5e 64BuildRequires: rpmbuild(macros) >= 1.626
71bab42e 65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67%define _sysconfdir /etc/ntp
68%define _bindir %{_sbindir}
a4cc90b2 69%define mibdir %{_datadir}/mibs
71bab42e 70
e24d986a 71%description
28dfddc3 72The Network Time Protocol (NTP) is used to synchronize a computer's
73time with another reference time source. The ntp package contains
74utilities and daemons which will synchronize your computer's time to
a47685aa 75Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
71bab42e 76
00337413
JR
77%description -l pl.UTF-8
78Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
79innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
80służące do dokładnego synchronizowania czasu komputera według czasu
cb15c3e4 81uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
71bab42e 82
00337413
JR
83%description -l pt_BR.UTF-8
84Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
85utilizado para sincronizar o relógio do computador com uma outra
86referência de horário. Este pacote contém utilitários e servidores que
87sincronizarã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.
608ad171 89
00337413
JR
90Instale o pacote ntp se você necessitar de ferramentas para manter o
91relógio do seu computador constantemente atualizado.
608ad171 92
cb15c3e4
ER
93%package -n ntpd
94Summary: The NTP daemon
95Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
96Summary(pt_BR.UTF-8): Network Time Protocol versão 4
97Group: Daemons
98Requires(post,preun): /sbin/chkconfig
932bc1ee
ER
99Requires(postun): /usr/sbin/groupdel
100Requires(postun): /usr/sbin/userdel
101Requires(pre): /bin/id
102Requires(pre): /usr/bin/getgid
103Requires(pre): /usr/sbin/groupadd
104Requires(pre): /usr/sbin/useradd
6ff9635b 105Requires(post,preun,postun): systemd-units >= 38
0d2671b6 106Requires: rc-scripts >= 0.4.3.0
6ff9635b 107Requires: systemd-units >= 38
932bc1ee 108Provides: group(ntp)
cb15c3e4
ER
109Provides: ntp = %{version}-%{release}
110Provides: ntpdaemon
932bc1ee 111Provides: user(ntp)
f6fec3df 112Obsoletes: ntp < 4.2.4p8-6
cb15c3e4
ER
113Obsoletes: ntpdaemon
114Obsoletes: openntpd
115Obsoletes: xntp3
116
117%description -n ntpd
118The Network Time Protocol (NTP) is used to synchronize a computer's
119time with another reference time source. The ntp package contains
120utilities and daemons which will synchronize your computer's time to
121Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
122
123This package includes ntpd (a daemon which continuously adjusts system
124time)
125
126%description -n ntpd -l pl.UTF-8
127Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
128innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
129służące do dokładnego synchronizowania czasu komputera według czasu
130uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
131
132Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
133czas systemowy)
134
135%description -n ntpd -l pt_BR.UTF-8
136Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
137utilizado para sincronizar o relógio do computador com uma outra
138referência de horário. Este pacote contém utilitários e servidores que
139sincronizarão o relógio do seu computador com o horário universal
140(UTC) através do protocolo NTP e utilizando servidores NTP públicos.
141
4aef70db
JR
142%package -n ntpd-upstart
143Summary: Upstart job description for the NTP daemon
144Summary(pl.UTF-8): Opis zadania Upstart dla demona NTP
145Group: Daemons
146Requires: ntpd = %{version}-%{release}
147Requires: upstart >= 0.6
148
149%description -n ntpd-upstart
150Upstart job description for the NTP daemon.
151
152%description -n ntpd-upstart -l pl.UTF-8
153Opis zadania Upstart dla demona NTP.
154
cb15c3e4
ER
155%package -n ntpdate
156Summary: Utility to set the date and time via NTP
fcc994b7 157Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
df3fadd8 158Group: Applications/Networking
5acc7945 159Requires(post,preun): /sbin/chkconfig
932bc1ee
ER
160Requires(postun): /usr/sbin/groupdel
161Requires(postun): /usr/sbin/userdel
162Requires(pre): /bin/id
163Requires(pre): /usr/bin/getgid
164Requires(pre): /usr/sbin/groupadd
165Requires(pre): /usr/sbin/useradd
6ff9635b 166Requires(post,preun,postun): systemd-units >= 38
b2073411 167Requires: rc-scripts >= 0.4.3.0
6ff9635b 168Requires: systemd-units >= 38
92517d76
ER
169Provides: group(ntp)
170Provides: user(ntp)
691bd31f 171Conflicts: ntp < 4.2.0-3
cb15c3e4
ER
172# for upgrades
173Provides: ntp-client = %{version}-%{release}
f6fec3df 174Obsoletes: ntp-client < 4.2.4p8-6
92517d76
ER
175# virtual
176Provides: ntpclient
177Obsoletes: ntpclient
e1e25342 178
cb15c3e4
ER
179%description -n ntpdate
180ntpdate is a program for retrieving the date and time from NTP
181servers.
e1e25342 182
cb15c3e4 183%description -n ntpdate -l pl.UTF-8
c771054a 184Klient do synchronizacji czasu po NTP (Network Time Protocol).
e1e25342 185
4aef70db
JR
186%package -n ntpdate-upstart
187Summary: Upstart job description for NTP client
188Summary(pl.UTF-8): Opis zadania Upstart dla klienta NTP
189Group: Daemons
190Requires: ntpdate = %{version}-%{release}
191Requires: upstart >= 0.6
192
193%description -n ntpdate-upstart
194Upstart job description for the NTP client.
195
196%description -n ntpdate-upstart -l pl.UTF-8
197Opis zadania Upstart dla klienta NTP.
198
a4cc90b2
ER
199%package -n mibs-ntp
200Summary: MIBs for NTP time entities
201Group: Applications/System
202Requires: mibs-dirs
203
204%description -n mibs-ntp
205The Management Information Base for NTP time entities.
206
207%package -n net-snmp-ntpd
208Summary: NTP SNMP subagent for Net-SNMP
209Group: Daemons
210Requires(post,preun): /sbin/chkconfig
211Requires: net-snmp
212Requires: rc-scripts
213Suggests: mibs-ntp
214
215%description -n net-snmp-ntpd
216NTP SNMP AgentX subagent for Net-SNMP.
217
2cf5b026
ER
218%package tools
219Summary: NTP tools
220Group: Applications/Networking
a9d9ccd1 221Obsoletes: ntp-ntptrace
2cf5b026
ER
222
223%description tools
224This package contains ntp tools:
225- ntptrace: Trace a chain of NTP servers back to the primary source
226- ntp-wait: Wait for NTP server to synchronize
227
82f74dd4
ER
228%package doc-html
229Summary: HTML documentation for ntp
230Summary(pl.UTF-8): Dokumentacja HTML dla ntp
231Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
232Group: Documentation
233
234%description doc-html
235HTML documentation for ntp.
236
237%description doc-html -l pl.UTF-8
238Dokumentacja do ntp w HTML.
239
240%description doc-html -l pt_BR.UTF-8
241Este pacote contém documentação adicional sobre o NTP versão 4.
242
e24d986a 243%prep
bc6615d5 244%setup -q -a7
29f00086 245%patch0 -p1
be68fcb1 246%patch1 -p1
262e8067 247%patch2 -p1
e35272e3 248%patch3 -p1
0ffcfbfc 249%{!?with_avahi:%patch4 -p1}
f59e8d31 250%patch5 -p1
71bab42e 251
23bc47dc 252## FC patches
23bc47dc
ER
253%patch101 -p1
254%patch102 -p1
255%patch103 -p1
256%patch104 -p1
a8809dbd 257%patch105 -p1
23bc47dc
ER
258%patch106 -p1
259%patch107 -p1
260%patch108 -p1
15931ca5
AG
261%patch109 -p1
262%patch110 -p1
263%patch111 -p1
23bc47dc 264%patch112 -p1
a8809dbd 265%patch113 -p1
6fca7355 266
2c17d85d 267echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
740223e3 268echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
2c17d85d 269
71bab42e 270%build
e35272e3 271%{__libtoolize}
0ffcfbfc 272%{__aclocal} -I m4 -I sntp/libopts/m4
e35272e3
JK
273%{__autoconf}
274%{__automake}
506da0ac 275cd sntp
276%{__libtoolize}
90a82b10 277%{__aclocal} -I ../m4 -I libopts/m4
506da0ac 278%{__autoconf}
279%{__automake}
506da0ac 280cd ..
740223e3 281
90a82b10 282CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
636118eb 283%configure \
2c17d85d
AM
284 --with-binsubdir=sbin \
285 --enable-linuxcaps \
286 --enable-getifaddrs \
287 --enable-ipv6 \
784e30ae 288 --enable-ntp-signd \
90a82b10 289 --with-lineeditlibs=readline \
282eb0fc 290 --with-crypto=openssl
deb05b4c 291
e24d986a 292%{__make}
71bab42e 293
294%install
295rm -rf $RPM_BUILD_ROOT
4aef70db
JR
296install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_mandir}/man1,%{systemdunitdir}} \
297 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.hourly,init}
71bab42e 298
1bf23378 299%{__make} install \
300 DESTDIR=$RPM_BUILD_ROOT
71bab42e 301
299584e5
ER
302cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
303cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
304
740223e3 305install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
cb15c3e4 306install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
299584e5
ER
307cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
308cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
ef83998a
ER
309cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
310cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/init/ntpdate.conf
4aef70db 311
a114c2aa
ER
312install -p %{SOURCE10} $RPM_BUILD_ROOT%{_sbindir}/ntpdate-wrapper
313cp -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}/ntpd.service
314cp -p %{SOURCE12} $RPM_BUILD_ROOT%{systemdunitdir}/ntpdate.service
4aef70db 315
299584e5 316cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
71bab42e 317
c52fbdbb
ER
318install -d $RPM_BUILD_ROOT/var/lib/ntp
319touch $RPM_BUILD_ROOT/var/lib/ntp/drift
320
cb15c3e4 321cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
394789ea 322#!/bin/sh
7d2f2be2
ER
323# Source function library.
324. /etc/rc.d/init.d/functions
325
a114c2aa
ER
326# Source ntpdate configuration
327. /etc/sysconfig/ntpdate
328
329is_yes "$NTPDATE_CRON" || exit 0
299584e5 330exec %{_sbindir}/ntpdate-wrapper
394789ea
AM
331EOF
332
a4cc90b2 333install -d $RPM_BUILD_ROOT%{mibdir}
299584e5 334cp -p ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
a4cc90b2 335
71bab42e 336%clean
be68fcb1 337rm -rf $RPM_BUILD_ROOT
71bab42e 338
932bc1ee
ER
339%pre -n ntpd
340%groupadd -g 246 ntp
341%useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
342
cb15c3e4 343%post -n ntpd
e1e25342 344/sbin/chkconfig --add ntpd
740223e3 345%service ntpd restart "NTP Daemon"
4aef70db 346%systemd_post ntpd.service
e1e25342 347
cb15c3e4 348%preun -n ntpd
e1e25342 349if [ "$1" = "0" ]; then
b9625068 350 %service ntpd stop
e1e25342 351 /sbin/chkconfig --del ntpd
c52fbdbb 352 rm -f /var/lib/ntp/drift
e1e25342 353fi
4aef70db 354%systemd_preun ntpd.service
e1e25342 355
932bc1ee
ER
356%postun -n ntp
357if [ "$1" = "0" ]; then
358 %userremove ntp
359 %groupremove ntp
360fi
4aef70db
JR
361%systemd_reload
362
363%post -n ntpd-upstart
364%upstart_post ntpd
932bc1ee 365
4aef70db
JR
366%postun -n ntpd-upstart
367%upstart_postun ntpd
0d2671b6 368
92517d76
ER
369%pre -n ntpdate
370%groupadd -g 246 ntp
371%useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
372
cb15c3e4
ER
373%post -n ntpdate
374/sbin/chkconfig --add ntpdate
375%service ntpdate restart "NTP Date"
4aef70db 376%systemd_post ntpdate.service
e24d986a 377
cb15c3e4 378%preun -n ntpdate
d470477a 379if [ "$1" = "0" ]; then
cb15c3e4
ER
380 %service ntpdate stop
381 /sbin/chkconfig --del ntpdate
d470477a 382fi
4aef70db 383%systemd_preun ntpdate.service
71bab42e 384
92517d76
ER
385%postun -n ntpdate
386if [ "$1" = "0" ]; then
387 %userremove ntp
388 %groupremove ntp
389fi
4aef70db
JR
390%systemd_reload
391
392%post -n ntpdate-upstart
393%upstart_post ntpdate
394
395%postun -n ntpdate-upstart
396%upstart_postun ntpdate
92517d76 397
7e284bc0
ER
398%triggerun -n ntpd -- ntp < 4.2.4p8-3.14
399# Prevent preun from ntp from working
400chmod a-x /etc/rc.d/init.d/ntpd
c52fbdbb 401
7e284bc0
ER
402%triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
403# Restore what triggerun removed
404chmod 754 /etc/rc.d/init.d/ntpd
c52fbdbb 405sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
7e284bc0
ER
406mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
407mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
c52fbdbb 408%service -q ntpd restart
4aef70db
JR
409%systemd_trigger ntpd.service
410%systemd_post ntpdate
411
412%triggerpostun -n ntpd -- ntpd < 4.2.6p5-2
413%systemd_trigger ntpd.service
c52fbdbb 414
45735b52
ER
415%triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
416if [ -f /etc/sysconfig/ntp.rpmsave ]; then
417 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
418 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
419fi
4aef70db
JR
420%systemd_trigger ntpdate.service
421
422%triggerpostun -n ntpdate -- ntpdate < 4.2.6p5-2
423%systemd_trigger ntpdate.service
45735b52 424
cb15c3e4 425%files -n ntpd
71bab42e 426%defattr(644,root,root,755)
38034725 427%doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
c771054a 428%attr(750,root,root) %dir %{_sysconfdir}
299584e5
ER
429%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
430%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntp.conf
8fb3cd7e 431%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
2cf5b026 432%attr(754,root,root) /etc/rc.d/init.d/ntpd
4aef70db 433%{systemdunitdir}/ntpd.service
2cf5b026
ER
434%attr(755,root,root) %{_sbindir}/ntpd
435%attr(755,root,root) %{_sbindir}/ntpdc
436%attr(755,root,root) %{_sbindir}/ntp-keygen
437%attr(755,root,root) %{_sbindir}/ntpq
438%attr(755,root,root) %{_sbindir}/ntptime
439%attr(755,root,root) %{_sbindir}/sntp
440%attr(755,root,root) %{_sbindir}/tickadj
441%{_mandir}/man1/ntpd.1*
442%{_mandir}/man1/ntpdc.1*
2cf5b026
ER
443%{_mandir}/man1/ntp-keygen.1*
444%{_mandir}/man1/ntpq.1*
445%{_mandir}/man1/ntptime.1*
446%{_mandir}/man1/sntp.1*
447
c52fbdbb
ER
448%dir %attr(770,root,ntp) /var/lib/ntp
449%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
450
4aef70db
JR
451%files -n ntpd-upstart
452%defattr(644,root,root,755)
453%config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
454
cb15c3e4
ER
455%files -n ntpdate
456%defattr(644,root,root,755)
457%doc COPYRIGHT
458%attr(755,root,root) %{_sbindir}/ntpdate
4aef70db 459%attr(755,root,root) %{_sbindir}/ntpdate-wrapper
cb15c3e4
ER
460%attr(754,root,root) /etc/rc.d/init.d/ntpdate
461%attr(754,root,root) /etc/cron.hourly/ntpdate
462%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
4aef70db 463%{systemdunitdir}/ntpdate.service
cb15c3e4
ER
464%{_mandir}/man1/ntpdate*
465
4aef70db
JR
466%files -n ntpdate-upstart
467%defattr(644,root,root,755)
468%config(noreplace) %verify(not md5 mtime size) /etc/init/ntpdate.conf
469
a4cc90b2
ER
470%files -n mibs-ntp
471%defattr(644,root,root,755)
472%{mibdir}/ntpv4-mib.mib
473
474%files -n net-snmp-ntpd
475%defattr(644,root,root,755)
936bfaef 476%doc ntpsnmpd/README
a4cc90b2
ER
477%attr(755,root,root) %{_sbindir}/ntpsnmpd
478%{_mandir}/man1/ntpsnmpd.1*
479
2cf5b026 480%files tools
df3fadd8
ER
481%defattr(644,root,root,755)
482%attr(755,root,root) %{_sbindir}/ntptrace
2cf5b026 483%attr(755,root,root) %{_sbindir}/ntp-wait
bc6615d5 484%{_mandir}/man1/ntptrace*
2d74fa1d 485
486%files doc-html
a47685aa 487%defattr(644,root,root,755)
2d74fa1d 488%doc html/*
This page took 0.167538 seconds and 4 git commands to generate.