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