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