]> git.pld-linux.org Git - packages/ntp.git/blame_incremental - ntp.spec
- PLD patches updated
[packages/ntp.git] / ntp.spec
... / ...
CommitLineData
1#
2# TODO:
3# - check which of the 'FC patches' are actually needed and update them
4# as needed
5# - ntpdseem.1 manual page 'disappeared'
6# - warning: Installed (but unpackaged) file(s) found:
7# /usr/share/man/man1/ntpsnmpd.1.gz
8#
9%include /usr/lib/rpm/macros.perl
10Summary: Network Time Protocol utilities
11Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
12Summary(pt_BR.UTF-8): Network Time Protocol versão 4
13Name: ntp
14Version: 4.2.6p1
15Release: 0.1
16License: distributable
17Group: Networking/Daemons
18Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
19# Source0-md5: 0510396dfbde40678b92f808ec07c0d2
20Source1: %{name}.conf
21Source2: %{name}.keys
22Source3: %{name}.init
23Source4: %{name}.sysconfig
24Source5: %{name}-client.init
25Source6: %{name}-client.sysconfig
26Source7: %{name}-manpages.tar.gz
27# Source7-md5: 208fcc9019e19ab26d28e4597290bffb
28Source8: %{name}.upstart
29Patch0: %{name}-time.patch
30Patch1: %{name}-no_libelf.patch
31Patch2: %{name}-ipv6.patch
32Patch3: %{name}-openssl_check.patch
33Patch4: %{name}-nano.patch
34Patch5: %{name}-ntpdc-link_order.patch
35# FC patches
36Patch101: %{name}-4.2.4p4-kernel.patch
37Patch102: %{name}-4.2.4p0-droproot.patch
38Patch103: %{name}-4.2.4-groups.patch
39Patch104: %{name}-4.2.4p7-daemonpll.patch
40Patch106: %{name}-4.2.4p2-tentative.patch
41Patch107: %{name}-4.2.4p2-noseed.patch
42Patch108: %{name}-4.2.4p4-multilisten.patch
43Patch109: %{name}-4.2.4-html2man.patch
44Patch110: %{name}-4.2.4p5-htmldoc.patch
45Patch111: %{name}-4.2.4p2-filegen.patch
46Patch112: %{name}-4.2.4-sprintf.patch
47Patch114: %{name}-4.2.4p8-mlock.patch
48Patch115: %{name}-4.2.4p2-clockselect.patch
49Patch117: %{name}-4.2.4p7-sleep.patch
50Patch118: %{name}-4.2.4p7-bcast.patch
51Patch119: %{name}-4.2.4p0-retcode.patch
52Patch120: %{name}-4.2.4p2-noif.patch
53Patch122: %{name}-4.2.4p4-cmsgalign.patch
54Patch124: %{name}-4.2.4p4-resinit.patch
55Patch125: %{name}-4.2.4p5-rtnetlink.patch
56Patch126: %{name}-4.2.4p7-stamode.patch
57Patch127: %{name}-4.2.4p5-driftonexit.patch
58Patch129: %{name}-4.2.4p7-minpoll.patch
59Patch130: %{name}-4.2.4p7-freqmode.patch
60Patch133: %{name}-4.2.4p7-getprecision.patch
61URL: http://www.ntp.org/
62BuildRequires: autoconf
63BuildRequires: automake
64BuildRequires: libcap-devel
65BuildRequires: libtool
66BuildRequires: openssl-devel >= 0.9.7d
67BuildRequires: readline-devel >= 4.2
68BuildRequires: rpm-perlprov >= 4.1-13
69BuildRequires: rpmbuild(macros) >= 1.561
70BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72%define _sysconfdir /etc/ntp
73%define _bindir %{_sbindir}
74
75%description
76The Network Time Protocol (NTP) is used to synchronize a computer's
77time with another reference time source. The ntp package contains
78utilities and daemons which will synchronize your computer's time to
79Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
80
81%description -l pl.UTF-8
82Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
83innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
84służące do dokładnego synchronizowania czasu komputera według czasu
85uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
86
87%description -l pt_BR.UTF-8
88Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
89utilizado para sincronizar o relógio do computador com uma outra
90referência de horário. Este pacote contém utilitários e servidores que
91sincronizarão o relógio do seu computador com o horário universal
92(UTC) através do protocolo NTP e utilizando servidores NTP públicos.
93
94Instale o pacote ntp se você necessitar de ferramentas para manter o
95relógio do seu computador constantemente atualizado.
96
97%package -n ntpd
98Summary: The NTP daemon
99Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol)
100Summary(pt_BR.UTF-8): Network Time Protocol versão 4
101Group: Daemons
102Requires(post,preun): /sbin/chkconfig
103Requires(postun): /usr/sbin/groupdel
104Requires(postun): /usr/sbin/userdel
105Requires(pre): /bin/id
106Requires(pre): /usr/bin/getgid
107Requires(pre): /usr/sbin/groupadd
108Requires(pre): /usr/sbin/useradd
109Requires: rc-scripts >= 0.4.3.0
110Provides: group(ntp)
111Provides: ntp = %{version}-%{release}
112Provides: ntpdaemon
113Provides: user(ntp)
114Obsoletes: ntp < 4.2.4p8-6
115Obsoletes: ntpdaemon
116Obsoletes: openntpd
117Obsoletes: xntp3
118
119%description -n ntpd
120The Network Time Protocol (NTP) is used to synchronize a computer's
121time with another reference time source. The ntp package contains
122utilities and daemons which will synchronize your computer's time to
123Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
124
125This package includes ntpd (a daemon which continuously adjusts system
126time)
127
128%description -n ntpd -l pl.UTF-8
129Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
130innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
131służące do dokładnego synchronizowania czasu komputera według czasu
132uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP.
133
134Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje
135czas systemowy)
136
137%description -n ntpd -l pt_BR.UTF-8
138Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
139utilizado para sincronizar o relógio do computador com uma outra
140referência de horário. Este pacote contém utilitários e servidores que
141sincronizarão o relógio do seu computador com o horário universal
142(UTC) através do protocolo NTP e utilizando servidores NTP públicos.
143
144%package -n ntpd-upstart
145Summary: Upstart job description for the NTP daemon
146Summary(pl.UTF-8): Opis zadania Upstart dla demona NTP
147Group: Daemons
148Requires: ntpd = %{version}-%{release}
149Requires: upstart >= 0.6
150
151%description -n ntpd-upstart
152Upstart job description for the NTP daemon.
153
154%description -n ntpd-upstart -l pl.UTF-8
155Opis zadania Upstart dla demona NTP.
156
157%package -n ntpdate
158Summary: Utility to set the date and time via NTP
159Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol)
160Group: Applications/Networking
161Requires(post,preun): /sbin/chkconfig
162Requires(postun): /usr/sbin/groupdel
163Requires(postun): /usr/sbin/userdel
164Requires(pre): /bin/id
165Requires(pre): /usr/bin/getgid
166Requires(pre): /usr/sbin/groupadd
167Requires(pre): /usr/sbin/useradd
168Provides: group(ntp)
169Provides: user(ntp)
170Conflicts: ntp < 4.2.0-3
171# for upgrades
172Provides: ntp-client = %{version}-%{release}
173Obsoletes: ntp-client < 4.2.4p8-6
174# virtual
175Provides: ntpclient
176Obsoletes: ntpclient
177
178%description -n ntpdate
179ntpdate is a program for retrieving the date and time from NTP
180servers.
181
182%description -n ntpdate -l pl.UTF-8
183Klient do synchronizacji czasu po NTP (Network Time Protocol).
184
185%package tools
186Summary: NTP tools
187Group: Applications/Networking
188Obsoletes: ntp-ntptrace
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
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
210%prep
211%setup -q -a7
212%patch0 -p1
213%patch1 -p1
214%patch2 -p1
215%patch3 -p1
216%patch4 -p1
217%patch5 -p1
218
219#%# FC patches
220#%%patch101 -p1
221#%%patch102 -p1
222#%%patch103 -p1
223#%%patch104 -p1
224#%%patch106 -p1
225#%%patch107 -p1
226#%%patch108 -p1
227#%%patch109 -p1
228#%%patch110 -p1
229#%%patch111 -p1
230#%%patch112 -p1
231#%%patch114 -p1
232#%%patch115 -p1
233#%%patch117 -p1
234#%%patch118 -p1
235#%%patch119 -p1
236#%%patch120 -p1
237#%%patch122 -p1
238#%%patch124 -p1
239#%%patch125 -p1
240#%%patch126 -p1
241#%%patch127 -p1
242#%%patch129 -p1
243#%%patch130 -p1
244#%%patch133 -p1
245
246echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
247echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> sntp/configure.ac
248
249%build
250%{__libtoolize}
251%{__aclocal} -I m4 -I libopts/m4
252%{__autoconf}
253%{__automake}
254cd sntp
255%{__libtoolize}
256%{__aclocal} -I ../m4 -I libopts/m4
257%{__autoconf}
258%{__automake}
259cd ..
260
261CPPFLAGS="%{rpmcppflags} -I/usr/include/readline"
262%configure \
263 --with-binsubdir=sbin \
264 --enable-linuxcaps \
265 --enable-getifaddrs \
266 --enable-ipv6 \
267 --with-lineeditlibs=readline \
268 --with-crypto=openssl
269
270%{__make}
271
272%install
273rm -rf $RPM_BUILD_ROOT
274install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly,init},%{_mandir}/man1}
275
276%{__make} install \
277 DESTDIR=$RPM_BUILD_ROOT
278
279cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
280cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
281install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
282install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate
283cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
284cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate
285install -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf
286cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
287
288install -d $RPM_BUILD_ROOT/var/lib/ntp
289touch $RPM_BUILD_ROOT/var/lib/ntp/drift
290
291cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF'
292#!/bin/sh
293exec /sbin/service ntpdate cronsettime
294EOF
295
296%clean
297rm -rf $RPM_BUILD_ROOT
298
299%pre -n ntpd
300%groupadd -g 246 ntp
301%useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
302
303%post -n ntpd
304/sbin/chkconfig --add ntpd
305%service ntpd restart "NTP Daemon"
306
307%preun -n ntpd
308if [ "$1" = "0" ]; then
309 %service ntpd stop
310 /sbin/chkconfig --del ntpd
311 rm -f /var/lib/ntp/drift
312fi
313
314%post -n ntpd-upstart
315%upstart_post ntpd
316
317%postun -n ntpd-upstart
318%upstart_postun ntpd
319
320%postun -n ntp
321if [ "$1" = "0" ]; then
322 %userremove ntp
323 %groupremove ntp
324fi
325
326
327%pre -n ntpdate
328%groupadd -g 246 ntp
329%useradd -u 246 -d %{_sysconfdir} -g ntp -c "NTP Daemon" ntp
330
331%post -n ntpdate
332/sbin/chkconfig --add ntpdate
333%service ntpdate restart "NTP Date"
334
335%preun -n ntpdate
336if [ "$1" = "0" ]; then
337 %service ntpdate stop
338 /sbin/chkconfig --del ntpdate
339fi
340
341%postun -n ntpdate
342if [ "$1" = "0" ]; then
343 %userremove ntp
344 %groupremove ntp
345fi
346
347%triggerun -n ntpd -- ntp < 4.2.4p8-3.14
348# Prevent preun from ntp from working
349chmod a-x /etc/rc.d/init.d/ntpd
350
351%triggerpostun -n ntpd -- ntp < 4.2.4p8-3.14
352# Restore what triggerun removed
353chmod 754 /etc/rc.d/init.d/ntpd
354sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf
355mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null
356mv -f /etc/ntp/drift /var/lib/ntp/drift 2>/dev/null
357%service -q ntpd restart
358
359%triggerpostun -n ntpdate -- ntp-client < 4.2.4p8-3.2
360if [ -f /etc/sysconfig/ntp.rpmsave ]; then
361 cp -f /etc/sysconfig/ntpdate{,.rpmnew}
362 mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate
363fi
364
365%files -n ntpd
366%defattr(644,root,root,755)
367%doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
368%attr(750,root,root) %dir %{_sysconfdir}
369%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
370%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
371%attr(754,root,root) /etc/rc.d/init.d/ntpd
372%attr(755,root,root) %{_sbindir}/ntpd
373%attr(755,root,root) %{_sbindir}/ntpdc
374%attr(755,root,root) %{_sbindir}/ntp-keygen
375%attr(755,root,root) %{_sbindir}/ntpq
376%attr(755,root,root) %{_sbindir}/ntptime
377%attr(755,root,root) %{_sbindir}/sntp
378%attr(755,root,root) %{_sbindir}/tickadj
379%{_mandir}/man1/ntpd.1*
380%{_mandir}/man1/ntpdc.1*
381#%{_mandir}/man1/ntpdsim.1*
382%{_mandir}/man1/ntp-keygen.1*
383%{_mandir}/man1/ntpq.1*
384%{_mandir}/man1/ntptime.1*
385%{_mandir}/man1/sntp.1*
386
387%dir %attr(770,root,ntp) /var/lib/ntp
388%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
389
390%files -n ntpd-upstart
391%defattr(644,root,root,755)
392%config(noreplace) %verify(not md5 mtime size) /etc/init/ntpd.conf
393
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
403%files tools
404%defattr(644,root,root,755)
405%attr(755,root,root) %{_sbindir}/ntptrace
406%attr(755,root,root) %{_sbindir}/ntp-wait
407%{_mandir}/man1/ntptrace*
408
409%files doc-html
410%defattr(644,root,root,755)
411%doc html/*
This page took 0.084145 seconds and 4 git commands to generate.