]> git.pld-linux.org Git - packages/ntp.git/blame - ntp.spec
- missing BR: pciutils-devel
[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
0ffcfbfc 13Version: 4.2.6p3
d9e6f171 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
0ffcfbfc 18# Source0-md5: 59876a9009b098ff59767ee45a88ebd2
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
29f00086 29Patch0: %{name}-time.patch
dbdd74ae 30Patch1: %{name}-no_libelf.patch
262e8067 31Patch2: %{name}-ipv6.patch
0ffcfbfc
KK
32Patch3: %{name}-nano.patch
33Patch4: %{name}-no_avahi.patch
a8809dbd
ER
34# FC patches + 100
35Patch101: %{name}-4.2.6p1-sleep.patch
36Patch102: %{name}-4.2.6p1-droproot.patch
37Patch103: %{name}-4.2.6p1-bcast.patch
38Patch104: %{name}-4.2.6p1-cmsgalign.patch
39Patch105: %{name}-4.2.6p1-linkfastmath.patch
40Patch106: %{name}-4.2.6p1-tentative.patch
41Patch107: %{name}-4.2.6p1-retcode.patch
42Patch108: %{name}-4.2.6p1-rtnetlink.patch
43Patch109: %{name}-4.2.6p1-html2man.patch
44Patch110: %{name}-4.2.6p1-htmldoc.patch
45Patch112: %{name}-4.2.4p7-getprecision.patch
46Patch113: %{name}-4.2.6p1-logdefault.patch
47Patch114: %{name}-4.2.6p1-mlock.patch
0ffcfbfc
KK
48Patch116: %{name}-4.2.6p3-nosyspeer.patch
49Patch117: %{name}-4.2.6p3-broadcastdelay.patch
50Patch118: %{name}-4.2.6p3-delaycalib.patch
51Patch119: %{name}-4.2.6p3-ntpdaterecv.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
0d2671b6 64BuildRequires: rpmbuild(macros) >= 1.561
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
0d2671b6 105Requires: rc-scripts >= 0.4.3.0
932bc1ee 106Provides: group(ntp)
cb15c3e4
ER
107Provides: ntp = %{version}-%{release}
108Provides: ntpdaemon
932bc1ee 109Provides: user(ntp)
f6fec3df 110Obsoletes: ntp < 4.2.4p8-6
cb15c3e4 111Obsoletes: ntpdaemon
ef83998a 112Obsoletes: ntpd-upstart
cb15c3e4
ER
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
141%package -n ntpdate
142Summary: Utility to set the date and time via NTP
fcc994b7 143Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
df3fadd8 144Group: Applications/Networking
5acc7945 145Requires(post,preun): /sbin/chkconfig
932bc1ee
ER
146Requires(postun): /usr/sbin/groupdel
147Requires(postun): /usr/sbin/userdel
148Requires(pre): /bin/id
149Requires(pre): /usr/bin/getgid
150Requires(pre): /usr/sbin/groupadd
151Requires(pre): /usr/sbin/useradd
b2073411 152Requires: rc-scripts >= 0.4.3.0
92517d76
ER
153Provides: group(ntp)
154Provides: user(ntp)
691bd31f 155Conflicts: ntp < 4.2.0-3
cb15c3e4
ER
156# for upgrades
157Provides: ntp-client = %{version}-%{release}
f6fec3df 158Obsoletes: ntp-client < 4.2.4p8-6
92517d76
ER
159# virtual
160Provides: ntpclient
161Obsoletes: ntpclient
e1e25342 162
cb15c3e4
ER
163%description -n ntpdate
164ntpdate is a program for retrieving the date and time from NTP
165servers.
e1e25342 166
cb15c3e4 167%description -n ntpdate -l pl.UTF-8
c771054a 168Klient do synchronizacji czasu po NTP (Network Time Protocol).
e1e25342 169
a4cc90b2
ER
170%package -n mibs-ntp
171Summary: MIBs for NTP time entities
172Group: Applications/System
173Requires: mibs-dirs
174
175%description -n mibs-ntp
176The Management Information Base for NTP time entities.
177
178%package -n net-snmp-ntpd
179Summary: NTP SNMP subagent for Net-SNMP
180Group: Daemons
181Requires(post,preun): /sbin/chkconfig
182Requires: net-snmp
183Requires: rc-scripts
184Suggests: mibs-ntp
185
186%description -n net-snmp-ntpd
187NTP SNMP AgentX subagent for Net-SNMP.
188
2cf5b026
ER
189%package tools
190Summary: NTP tools
191Group: Applications/Networking
a9d9ccd1 192Obsoletes: ntp-ntptrace
2cf5b026
ER
193
194%description tools
195This package contains ntp tools:
196- ntptrace: Trace a chain of NTP servers back to the primary source
197- ntp-wait: Wait for NTP server to synchronize
198
82f74dd4
ER
199%package doc-html
200Summary: HTML documentation for ntp
201Summary(pl.UTF-8): Dokumentacja HTML dla ntp
202Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp
203Group: Documentation
204
205%description doc-html
206HTML documentation for ntp.
207
208%description doc-html -l pl.UTF-8
209Dokumentacja do ntp w HTML.
210
211%description doc-html -l pt_BR.UTF-8
212Este pacote contém documentação adicional sobre o NTP versão 4.
213
e24d986a 214%prep
bc6615d5 215%setup -q -a7
29f00086 216%patch0 -p1
be68fcb1 217%patch1 -p1
262e8067 218%patch2 -p1
e35272e3 219%patch3 -p1
0ffcfbfc 220%{!?with_avahi:%patch4 -p1}
71bab42e 221
23bc47dc 222## FC patches
23bc47dc
ER
223%patch101 -p1
224%patch102 -p1
225%patch103 -p1
226%patch104 -p1
a8809dbd 227%patch105 -p1
23bc47dc
ER
228%patch106 -p1
229%patch107 -p1
230%patch108 -p1
231%patch109 -p1
232%patch110 -p1
23bc47dc 233%patch112 -p1
a8809dbd 234%patch113 -p1
23bc47dc 235%patch114 -p1
0ffcfbfc
KK
236%patch116 -p1
237%patch117 -p1
238%patch118 -p1
239%patch119 -p1
6fca7355 240
2c17d85d 241echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
740223e3 242echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
2c17d85d 243
71bab42e 244%build
e35272e3 245%{__libtoolize}
0ffcfbfc 246%{__aclocal} -I m4 -I sntp/libopts/m4
e35272e3
JK
247%{__autoconf}
248%{__automake}
506da0ac 249cd sntp
250%{__libtoolize}
90a82b10 251%{__aclocal} -I ../m4 -I libopts/m4
506da0ac 252%{__autoconf}
253%{__automake}
506da0ac 254cd ..
740223e3 255
90a82b10 256CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
636118eb 257%configure \
2c17d85d
AM
258 --with-binsubdir=sbin \
259 --enable-linuxcaps \
260 --enable-getifaddrs \
261 --enable-ipv6 \
90a82b10 262 --with-lineeditlibs=readline \
282eb0fc 263 --with-crypto=openssl
deb05b4c 264
e24d986a 265%{__make}
71bab42e 266
267%install
268rm -rf $RPM_BUILD_ROOT
0d2671b6 269install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1}
71bab42e 270
1bf23378 271%{__make} install \
272 DESTDIR=$RPM_BUILD_ROOT
71bab42e 273
740223e3
ER
274cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
275cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
276install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
cb15c3e4 277install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
740223e3 278cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
cb15c3e4 279cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
ef83998a
ER
280cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
281cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/init/ntpdate.conf
aa729c5d 282cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
71bab42e 283
c52fbdbb
ER
284install -d $RPM_BUILD_ROOT/var/lib/ntp
285touch $RPM_BUILD_ROOT/var/lib/ntp/drift
286
cb15c3e4 287cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
394789ea 288#!/bin/sh
c52fbdbb 289exec /sbin/service ntpdate cronsettime
394789ea
AM
290EOF
291
a4cc90b2
ER
292install -d $RPM_BUILD_ROOT%{mibdir}
293cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir}
294
71bab42e 295%clean
be68fcb1 296rm -rf $RPM_BUILD_ROOT
71bab42e 297
932bc1ee
ER
298%pre -n ntpd
299%groupadd -g 246 ntp
300%useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
301
cb15c3e4 302%post -n ntpd
e1e25342 303/sbin/chkconfig --add ntpd
740223e3 304%service ntpd restart "NTP Daemon"
e1e25342 305
cb15c3e4 306%preun -n ntpd
e1e25342 307if [ "$1" = "0" ]; then
b9625068 308 %service ntpd stop
e1e25342 309 /sbin/chkconfig --del ntpd
c52fbdbb 310 rm -f /var/lib/ntp/drift
e1e25342
MK
311fi
312
932bc1ee
ER
313%postun -n ntp
314if [ "$1" = "0" ]; then
315 %userremove ntp
316 %groupremove ntp
317fi
318
0d2671b6 319
92517d76
ER
320%pre -n ntpdate
321%groupadd -g 246 ntp
322%useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
323
cb15c3e4
ER
324%post -n ntpdate
325/sbin/chkconfig --add ntpdate
326%service ntpdate restart "NTP Date"
e24d986a 327
cb15c3e4 328%preun -n ntpdate
d470477a 329if [ "$1" = "0" ]; then
cb15c3e4
ER
330 %service ntpdate stop
331 /sbin/chkconfig --del ntpdate
d470477a 332fi
71bab42e 333
92517d76
ER
334%postun -n ntpdate
335if [ "$1" = "0" ]; then
336 %userremove ntp
337 %groupremove ntp
338fi
339
7e284bc0
ER
340%triggerun -n ntpd -- ntp < 4.2.4p8-3.14
341# Prevent preun from ntp from working
342chmod a-x /etc/rc.d/init.d/ntpd
c52fbdbb 343
7e284bc0
ER
344%triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
345# Restore what triggerun removed
346chmod 754 /etc/rc.d/init.d/ntpd
c52fbdbb 347sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
7e284bc0
ER
348mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
349mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
c52fbdbb
ER
350%service -q ntpd restart
351
45735b52
ER
352%triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
353if [ -f /etc/sysconfig/ntp.rpmsave ]; then
354 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
355 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
356fi
357
cb15c3e4 358%files -n ntpd
71bab42e 359%defattr(644,root,root,755)
38034725 360%doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
c771054a 361%attr(750,root,root) %dir %{_sysconfdir}
8fb3cd7e 362%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
8fb3cd7e 363%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
2cf5b026 364%attr(754,root,root) /etc/rc.d/init.d/ntpd
ef83998a 365%config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
2cf5b026
ER
366%attr(755,root,root) %{_sbindir}/ntpd
367%attr(755,root,root) %{_sbindir}/ntpdc
368%attr(755,root,root) %{_sbindir}/ntp-keygen
369%attr(755,root,root) %{_sbindir}/ntpq
370%attr(755,root,root) %{_sbindir}/ntptime
371%attr(755,root,root) %{_sbindir}/sntp
372%attr(755,root,root) %{_sbindir}/tickadj
373%{_mandir}/man1/ntpd.1*
374%{_mandir}/man1/ntpdc.1*
2cf5b026
ER
375%{_mandir}/man1/ntp-keygen.1*
376%{_mandir}/man1/ntpq.1*
377%{_mandir}/man1/ntptime.1*
378%{_mandir}/man1/sntp.1*
379
c52fbdbb
ER
380%dir %attr(770,root,ntp) /var/lib/ntp
381%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
382
cb15c3e4
ER
383%files -n ntpdate
384%defattr(644,root,root,755)
385%doc COPYRIGHT
386%attr(755,root,root) %{_sbindir}/ntpdate
387%attr(754,root,root) /etc/rc.d/init.d/ntpdate
ef83998a 388%config(noreplace) %verify(not md5 mtime size) /etc/init/ntpdate.conf
cb15c3e4
ER
389%attr(754,root,root) /etc/cron.hourly/ntpdate
390%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpdate
391%{_mandir}/man1/ntpdate*
392
a4cc90b2
ER
393%files -n mibs-ntp
394%defattr(644,root,root,755)
395%{mibdir}/ntpv4-mib.mib
396
397%files -n net-snmp-ntpd
398%defattr(644,root,root,755)
936bfaef 399%doc ntpsnmpd/README
a4cc90b2
ER
400%attr(755,root,root) %{_sbindir}/ntpsnmpd
401%{_mandir}/man1/ntpsnmpd.1*
402
2cf5b026 403%files tools
df3fadd8
ER
404%defattr(644,root,root,755)
405%attr(755,root,root) %{_sbindir}/ntptrace
2cf5b026 406%attr(755,root,root) %{_sbindir}/ntp-wait
bc6615d5 407%{_mandir}/man1/ntptrace*
2d74fa1d 408
409%files doc-html
a47685aa 410%defattr(644,root,root,755)
2d74fa1d 411%doc html/*
This page took 0.092078 seconds and 4 git commands to generate.