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