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