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