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