]> git.pld-linux.org Git - packages/ntp.git/blob - ntp.spec
- R(post,preun): chkconfig for client too
[packages/ntp.git] / ntp.spec
1 # TODO
2 # - update manual pages (from debian?)
3 %include        /usr/lib/rpm/macros.perl
4 Summary:        Network Time Protocol utilities
5 Summary(pl.UTF-8):      Narzędzia do synchronizacji czasu (Network Time Protocol)
6 Summary(pt_BR.UTF-8):   Network Time Protocol versão 4
7 Name:           ntp
8 Version:        4.2.4p4
9 Release:        1
10 License:        distributable
11 Group:          Daemons
12 Source0:        http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/%{name}-%{version}.tar.gz
13 # Source0-md5:  fcb32a01e1ae3f9ed5bac86b12c7a1cc
14 Source1:        %{name}.conf
15 Source2:        %{name}.keys
16 Source3:        %{name}.init
17 Source4:        %{name}.sysconfig
18 Source5:        %{name}-client.init
19 Source6:        %{name}-client.sysconfig
20 Source7:        %{name}-manpages.tar.gz
21 # Source7-md5:  208fcc9019e19ab26d28e4597290bffb
22 Patch0:         %{name}-time.patch
23 Patch1:         %{name}-no_libelf.patch
24 Patch2:         %{name}-ipv6.patch
25 Patch3:         %{name}-openssl_check.patch
26 Patch4:         %{name}-clock_settime.patch
27 Patch5:         %{name}-md5.patch
28 URL:            http://www.ntp.org/
29 BuildRequires:  autoconf
30 BuildRequires:  automake
31 BuildRequires:  libtool
32 BuildRequires:  openssl-devel >= 0.9.7d
33 BuildRequires:  readline-devel >= 4.2
34 BuildRequires:  rpm-perlprov >= 4.1-13
35 BuildRequires:  rpmbuild(macros) >= 1.268
36 Requires(post,preun):   /sbin/chkconfig
37 Requires:       rc-scripts >= 0.4.0.10
38 Obsoletes:      xntp3
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %define         _sysconfdir     /etc/ntp
42 %define         _bindir         %{_sbindir}
43
44 %description
45 The Network Time Protocol (NTP) is used to synchronize a computer's
46 time with another reference time source. The ntp package contains
47 utilities and daemons which will synchronize your computer's time to
48 Coordinated Universal Time (UTC) via the NTP protocol and NTP servers.
49 ntp package includes ntpd (a daemon which continuously adjusts system
50 time), while ntp-client package contains ntpdate (a program for
51 retrieving the date and time from remote machines via a network).
52
53 %description -l pl.UTF-8
54 Network Time Protocol (NTP) służy do synchronizacji czasu komputera z
55 innym, wzorcowym źródłem czasu. Pakiet ntp zawiera narzędzia i demony
56 służące do dokładnego synchronizowania czasu komputera według czasu
57 uniwersalnego (UTC) poprzez protokół NTP z serwerami NTP. Pakiet ntp
58 zawiera ntpd (demona, który w sposób ciągły aktualizuje czas
59 systemowy), natomiast pakiet ntp-client zawiera program ntpdate
60 (program do odczytywania daty i czasu z innych maszyn po sieci).
61
62 %description -l pt_BR.UTF-8
63 Esta é a versão 4 do Network Time Protocol (NTP). Este protocolo é
64 utilizado para sincronizar o relógio do computador com uma outra
65 referência de horário. Este pacote contém utilitários e servidores que
66 sincronizarão o relógio do seu computador com o horário universal
67 (UTC) através do protocolo NTP e utilizando servidores NTP públicos.
68
69 Instale o pacote ntp se você necessitar de ferramentas para manter o
70 relógio do seu computador constantemente atualizado.
71
72 Este pacote obsoleta o antigo xntp3.
73
74 %package doc-html
75 Summary:        HTML documentation for ntp
76 Summary(pl.UTF-8):      Dokumentacja HTML dla ntp
77 Summary(pt_BR.UTF-8):   Documentação adicional para o pacote ntp
78 Group:          Documentation
79
80 %description doc-html
81 HTML documentation for ntp.
82
83 %description doc-html -l pl.UTF-8
84 Dokumentacja do ntp w HTML.
85
86 %description doc-html -l pt_BR.UTF-8
87 Este pacote contém documentação adicional sobre o NTP versão 4.
88
89 %package client
90 Summary:        Network Time Protocol client
91 Summary(pl.UTF-8):      Klient do synchronizacji czasu po NTP (Network Time Protocol)
92 Group:          Applications/Networking
93 Requires(post,preun):   /sbin/chkconfig
94 Conflicts:      ntp < 4.2.0-3
95
96 %description client
97 Network Time Protocol client.
98
99 %description client -l pl.UTF-8
100 Klient do synchronizacji czasu po NTP (Network Time Protocol).
101
102 %package tools
103 Summary:        NTP tools
104 Group:          Applications/Networking
105 Obsoletes:      ntp-ntptrace
106
107 %description tools
108 This package contains ntp tools:
109 - ntptrace: Trace a chain of NTP servers back to the primary source
110 - ntp-wait: Wait for NTP server to synchronize
111
112 %prep
113 %setup -q -a7
114 %patch0 -p1
115 %patch1 -p1
116 %patch2 -p1
117 %patch3 -p1
118 %patch4 -p0
119 %patch5 -p1
120
121 echo 'AM_CONDITIONAL([NEED_LIBOPTS], false)' >> configure.ac
122
123 %build
124 %{__libtoolize}
125 %{__aclocal} -I m4 -I libopts/m4
126 %{__autoconf}
127 %{__automake}
128 %configure \
129         --with-binsubdir=sbin \
130         --enable-linuxcaps \
131         --enable-getifaddrs \
132         --enable-ipv6 \
133         --with-crypto=openssl
134
135 %{__make}
136
137 %install
138 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,cron.hourly},%{_mandir}/man1}
140
141 %{__make} install \
142         DESTDIR=$RPM_BUILD_ROOT
143
144 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/ntp.conf
145 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
146 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntpd
147 install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntp
148 install %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/ntpd
149 install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/ntp
150 install man/*.1  $RPM_BUILD_ROOT%{_mandir}/man1
151
152 cat > $RPM_BUILD_ROOT/etc/cron.hourly/ntp <<'EOF'
153 #!/bin/sh
154 /sbin/service ntp cronsettime
155 EOF
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %post
161 /sbin/chkconfig --add ntpd
162 %service ntpd restart "ntpd daemon"
163
164 %preun
165 if [ "$1" = "0" ]; then
166         %service ntpd stop
167         /sbin/chkconfig --del ntpd
168         rm -f /etc/ntp/drift
169 fi
170
171 %post client
172 /sbin/chkconfig --add ntp
173 %service ntp restart
174
175 %preun client
176 if [ "$1" = "0" ]; then
177         %service ntp stop
178         /sbin/chkconfig --del ntp
179 fi
180
181 %files
182 %defattr(644,root,root,755)
183 %doc NEWS TODO WHERE-TO-START conf/*.conf COPYRIGHT
184 %attr(750,root,root) %dir %{_sysconfdir}
185 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*
186 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntpd
187 %attr(754,root,root) /etc/rc.d/init.d/ntpd
188 %attr(755,root,root) %{_sbindir}/ntpd
189 %attr(755,root,root) %{_sbindir}/ntpdc
190 %attr(755,root,root) %{_sbindir}/ntp-keygen
191 %attr(755,root,root) %{_sbindir}/ntpq
192 %attr(755,root,root) %{_sbindir}/ntptime
193 %attr(755,root,root) %{_sbindir}/sntp
194 %attr(755,root,root) %{_sbindir}/tickadj
195 %{_mandir}/man1/ntpd.1*
196 %{_mandir}/man1/ntpdc.1*
197 %{_mandir}/man1/ntpdsim.1*
198 %{_mandir}/man1/ntp-keygen.1*
199 %{_mandir}/man1/ntpq.1*
200 %{_mandir}/man1/ntptime.1*
201 %{_mandir}/man1/sntp.1*
202
203 %files tools
204 %defattr(644,root,root,755)
205 %attr(755,root,root) %{_sbindir}/ntptrace
206 %attr(755,root,root) %{_sbindir}/ntp-wait
207 %{_mandir}/man1/ntptrace*
208
209 %files doc-html
210 %defattr(644,root,root,755)
211 %doc html/*
212
213 %files client
214 %defattr(644,root,root,755)
215 %doc COPYRIGHT
216 %attr(755,root,root) %{_sbindir}/ntpdate
217 %attr(754,root,root) /etc/rc.d/init.d/ntp
218 %attr(754,root,root) /etc/cron.hourly/ntp
219 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntp
220 %{_mandir}/man1/ntpdate*
This page took 0.049573 seconds and 4 git commands to generate.