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