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