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