]>
Commit | Line | Data |
---|---|---|
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 | 9 | Summary: Network Time Protocol utilities |
fcc994b7 ER |
10 | Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol) |
11 | Summary(pt_BR.UTF-8): Network Time Protocol versão 4 | |
45771d3d | 12 | Name: ntp |
3f2c666b AG |
13 | Version: 4.2.6p5 |
14 | Release: 1 | |
a030fe3d | 15 | License: distributable |
aa729c5d | 16 | Group: Networking/Daemons |
5aa7cc17 | 17 | Source0: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz |
3f2c666b | 18 | # Source0-md5: 00df80a84ec9528fcfb09498075525bc |
28dfddc3 | 19 | Source1: %{name}.conf |
20 | Source2: %{name}.keys | |
21 | Source3: %{name}.init | |
22 | Source4: %{name}.sysconfig | |
bc6615d5 ER |
23 | Source5: %{name}-client.init |
24 | Source6: %{name}-client.sysconfig | |
25 | Source7: %{name}-manpages.tar.gz | |
26 | # Source7-md5: 208fcc9019e19ab26d28e4597290bffb | |
d3eb2077 | 27 | Source8: ntp.upstart |
ef83998a | 28 | Source9: ntpdate.upstart |
29f00086 | 29 | Patch0: %{name}-time.patch |
dbdd74ae | 30 | Patch1: %{name}-no_libelf.patch |
262e8067 | 31 | Patch2: %{name}-ipv6.patch |
0ffcfbfc KK |
32 | Patch3: %{name}-nano.patch |
33 | Patch4: %{name}-no_avahi.patch | |
a8809dbd ER |
34 | # FC patches + 100 |
35 | Patch101: %{name}-4.2.6p1-sleep.patch | |
36 | Patch102: %{name}-4.2.6p1-droproot.patch | |
37 | Patch103: %{name}-4.2.6p1-bcast.patch | |
38 | Patch104: %{name}-4.2.6p1-cmsgalign.patch | |
39 | Patch105: %{name}-4.2.6p1-linkfastmath.patch | |
40 | Patch106: %{name}-4.2.6p1-tentative.patch | |
41 | Patch107: %{name}-4.2.6p1-retcode.patch | |
42 | Patch108: %{name}-4.2.6p1-rtnetlink.patch | |
15931ca5 AG |
43 | Patch109: %{name}-4.2.4p7-getprecision.patch |
44 | Patch110: %{name}-4.2.6p1-logdefault.patch | |
45 | Patch111: %{name}-4.2.6p1-mlock.patch | |
46 | Patch112: %{name}-4.2.6p3-broadcastdelay.patch | |
47 | Patch113: %{name}-4.2.6p3-delaycalib.patch | |
6cd8a392 | 48 | URL: http://www.ntp.org/ |
8338fb6d | 49 | BuildRequires: autoconf |
1ef6c8b4 | 50 | BuildRequires: automake |
8f6c2b65 | 51 | %{?with_avahi:BuildRequires: avahi-compat-libdns_sd-devel} |
61dbaaf1 | 52 | BuildRequires: libcap-devel |
8ee97dcb | 53 | BuildRequires: libnl-devel |
8338fb6d | 54 | BuildRequires: libtool |
5ecb988f | 55 | BuildRequires: net-snmp-devel |
e35272e3 | 56 | BuildRequires: openssl-devel >= 0.9.7d |
28341528 | 57 | BuildRequires: pciutils-devel |
ba10b9ba | 58 | BuildRequires: readline-devel >= 4.2 |
df3fadd8 | 59 | BuildRequires: rpm-perlprov >= 4.1-13 |
0d2671b6 | 60 | BuildRequires: rpmbuild(macros) >= 1.561 |
71bab42e | 61 | BuildRoot: %{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 | 68 | The Network Time Protocol (NTP) is used to synchronize a computer's |
69 | time with another reference time source. The ntp package contains | |
70 | utilities and daemons which will synchronize your computer's time to | |
a47685aa | 71 | Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. |
71bab42e | 72 | |
00337413 JR |
73 | %description -l pl.UTF-8 |
74 | Network Time Protocol (NTP) służy do synchronizacji czasu komputera z | |
75 | innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony | |
76 | służące do dokładnego synchronizowania czasu komputera według czasu | |
cb15c3e4 | 77 | uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP. |
71bab42e | 78 | |
00337413 JR |
79 | %description -l pt_BR.UTF-8 |
80 | Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é | |
81 | utilizado para sincronizar o relógio do computador com uma outra | |
82 | referência de horário. Este pacote contém utilitários e servidores que | |
83 | sincronizarã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 |
86 | Instale o pacote ntp se você necessitar de ferramentas para manter o |
87 | relógio do seu computador constantemente atualizado. | |
608ad171 | 88 | |
cb15c3e4 ER |
89 | %package -n ntpd |
90 | Summary: The NTP daemon | |
91 | Summary(pl.UTF-8): Narzędzia do synchronizacji czasu (Network Time Protocol) | |
92 | Summary(pt_BR.UTF-8): Network Time Protocol versão 4 | |
93 | Group: Daemons | |
94 | Requires(post,preun): /sbin/chkconfig | |
932bc1ee ER |
95 | Requires(postun): /usr/sbin/groupdel |
96 | Requires(postun): /usr/sbin/userdel | |
97 | Requires(pre): /bin/id | |
98 | Requires(pre): /usr/bin/getgid | |
99 | Requires(pre): /usr/sbin/groupadd | |
100 | Requires(pre): /usr/sbin/useradd | |
0d2671b6 | 101 | Requires: rc-scripts >= 0.4.3.0 |
932bc1ee | 102 | Provides: group(ntp) |
cb15c3e4 ER |
103 | Provides: ntp = %{version}-%{release} |
104 | Provides: ntpdaemon | |
932bc1ee | 105 | Provides: user(ntp) |
f6fec3df | 106 | Obsoletes: ntp < 4.2.4p8-6 |
cb15c3e4 | 107 | Obsoletes: ntpdaemon |
ef83998a | 108 | Obsoletes: ntpd-upstart |
cb15c3e4 ER |
109 | Obsoletes: openntpd |
110 | Obsoletes: xntp3 | |
111 | ||
112 | %description -n ntpd | |
113 | The Network Time Protocol (NTP) is used to synchronize a computer's | |
114 | time with another reference time source. The ntp package contains | |
115 | utilities and daemons which will synchronize your computer's time to | |
116 | Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. | |
117 | ||
118 | This package includes ntpd (a daemon which continuously adjusts system | |
119 | time) | |
120 | ||
121 | %description -n ntpd -l pl.UTF-8 | |
122 | Network Time Protocol (NTP) służy do synchronizacji czasu komputera z | |
123 | innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony | |
124 | służące do dokładnego synchronizowania czasu komputera według czasu | |
125 | uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP. | |
126 | ||
127 | Pakiet ntp zawiera ntpd (demona, który w sposób ciągły aktualizuje | |
128 | czas systemowy) | |
129 | ||
130 | %description -n ntpd -l pt_BR.UTF-8 | |
131 | Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é | |
132 | utilizado para sincronizar o relógio do computador com uma outra | |
133 | referência de horário. Este pacote contém utilitários e servidores que | |
134 | sincronizarã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 | |
138 | Summary: Utility to set the date and time via NTP | |
fcc994b7 | 139 | Summary(pl.UTF-8): Klient do synchronizacji czasu po NTP (Network Time Protocol) |
df3fadd8 | 140 | Group: Applications/Networking |
5acc7945 | 141 | Requires(post,preun): /sbin/chkconfig |
932bc1ee ER |
142 | Requires(postun): /usr/sbin/groupdel |
143 | Requires(postun): /usr/sbin/userdel | |
144 | Requires(pre): /bin/id | |
145 | Requires(pre): /usr/bin/getgid | |
146 | Requires(pre): /usr/sbin/groupadd | |
147 | Requires(pre): /usr/sbin/useradd | |
b2073411 | 148 | Requires: rc-scripts >= 0.4.3.0 |
92517d76 ER |
149 | Provides: group(ntp) |
150 | Provides: user(ntp) | |
691bd31f | 151 | Conflicts: ntp < 4.2.0-3 |
cb15c3e4 ER |
152 | # for upgrades |
153 | Provides: ntp-client = %{version}-%{release} | |
f6fec3df | 154 | Obsoletes: ntp-client < 4.2.4p8-6 |
92517d76 ER |
155 | # virtual |
156 | Provides: ntpclient | |
157 | Obsoletes: ntpclient | |
e1e25342 | 158 | |
cb15c3e4 ER |
159 | %description -n ntpdate |
160 | ntpdate is a program for retrieving the date and time from NTP | |
161 | servers. | |
e1e25342 | 162 | |
cb15c3e4 | 163 | %description -n ntpdate -l pl.UTF-8 |
c771054a | 164 | Klient do synchronizacji czasu po NTP (Network Time Protocol). |
e1e25342 | 165 | |
a4cc90b2 ER |
166 | %package -n mibs-ntp |
167 | Summary: MIBs for NTP time entities | |
168 | Group: Applications/System | |
169 | Requires: mibs-dirs | |
170 | ||
171 | %description -n mibs-ntp | |
172 | The Management Information Base for NTP time entities. | |
173 | ||
174 | %package -n net-snmp-ntpd | |
175 | Summary: NTP SNMP subagent for Net-SNMP | |
176 | Group: Daemons | |
177 | Requires(post,preun): /sbin/chkconfig | |
178 | Requires: net-snmp | |
179 | Requires: rc-scripts | |
180 | Suggests: mibs-ntp | |
181 | ||
182 | %description -n net-snmp-ntpd | |
183 | NTP SNMP AgentX subagent for Net-SNMP. | |
184 | ||
2cf5b026 ER |
185 | %package tools |
186 | Summary: NTP tools | |
187 | Group: Applications/Networking | |
a9d9ccd1 | 188 | Obsoletes: ntp-ntptrace |
2cf5b026 ER |
189 | |
190 | %description tools | |
191 | This 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 |
196 | Summary: HTML documentation for ntp | |
197 | Summary(pl.UTF-8): Dokumentacja HTML dla ntp | |
198 | Summary(pt_BR.UTF-8): Documentação adicional para o pacote ntp | |
199 | Group: Documentation | |
200 | ||
201 | %description doc-html | |
202 | HTML documentation for ntp. | |
203 | ||
204 | %description doc-html -l pl.UTF-8 | |
205 | Dokumentacja do ntp w HTML. | |
206 | ||
207 | %description doc-html -l pt_BR.UTF-8 | |
208 | Este 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 | 233 | echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac |
740223e3 | 234 | echo '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 | 241 | cd sntp |
242 | %{__libtoolize} | |
90a82b10 | 243 | %{__aclocal} -I ../m4 -I libopts/m4 |
506da0ac | 244 | %{__autoconf} |
245 | %{__automake} | |
506da0ac | 246 | cd .. |
740223e3 | 247 | |
90a82b10 | 248 | CPPFLAGS="%{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 | |
260 | rm -rf $RPM_BUILD_ROOT | |
0d2671b6 | 261 | install -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 |
266 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf |
267 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys | |
268 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd | |
cb15c3e4 | 269 | install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpdate |
740223e3 | 270 | cp -a %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd |
cb15c3e4 | 271 | cp -a %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntpdate |
ef83998a ER |
272 | cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/init/ntpd.conf |
273 | cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/init/ntpdate.conf | |
aa729c5d | 274 | cp -a man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
71bab42e | 275 | |
c52fbdbb ER |
276 | install -d $RPM_BUILD_ROOT/var/lib/ntp |
277 | touch $RPM_BUILD_ROOT/var/lib/ntp/drift | |
278 | ||
cb15c3e4 | 279 | cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntpdate <<'EOF' |
394789ea | 280 | #!/bin/sh |
c52fbdbb | 281 | exec /sbin/service ntpdate cronsettime |
394789ea AM |
282 | EOF |
283 | ||
a4cc90b2 ER |
284 | install -d $RPM_BUILD_ROOT%{mibdir} |
285 | cp -a ntpsnmpd/ntpv4-mib.mib $RPM_BUILD_ROOT%{mibdir} | |
286 | ||
71bab42e | 287 | %clean |
be68fcb1 | 288 | rm -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 | 299 | if [ "$1" = "0" ]; then |
b9625068 | 300 | %service ntpd stop |
e1e25342 | 301 | /sbin/chkconfig --del ntpd |
c52fbdbb | 302 | rm -f /var/lib/ntp/drift |
e1e25342 MK |
303 | fi |
304 | ||
932bc1ee ER |
305 | %postun -n ntp |
306 | if [ "$1" = "0" ]; then | |
307 | %userremove ntp | |
308 | %groupremove ntp | |
309 | fi | |
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 | 321 | if [ "$1" = "0" ]; then |
cb15c3e4 ER |
322 | %service ntpdate stop |
323 | /sbin/chkconfig --del ntpdate | |
d470477a | 324 | fi |
71bab42e | 325 | |
92517d76 ER |
326 | %postun -n ntpdate |
327 | if [ "$1" = "0" ]; then | |
328 | %userremove ntp | |
329 | %groupremove ntp | |
330 | fi | |
331 | ||
7e284bc0 ER |
332 | %triggerun -n ntpd -- ntp < 4.2.4p8-3.14 |
333 | # Prevent preun from ntp from working | |
334 | chmod 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 | |
338 | chmod 754 /etc/rc.d/init.d/ntpd | |
c52fbdbb | 339 | sed -i -e 's,/etc/ntp/drift,/var/lib/ntp/drift,' %{_sysconfdir}/ntp.conf |
7e284bc0 ER |
340 | mv -f /etc/ntp/ntp.drift /var/lib/ntp/drift 2>/dev/null |
341 | mv -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 |
345 | if [ -f /etc/sysconfig/ntp.rpmsave ]; then | |
346 | cp -f /etc/sysconfig/ntpdate{,.rpmnew} | |
347 | mv -f /etc/sysconfig/ntp.rpmsave /etc/sysconfig/ntpdate | |
348 | fi | |
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/* |