]> git.pld-linux.org Git - packages/chrony.git/blame - chrony.spec
- up to 2.4
[packages/chrony.git] / chrony.spec
CommitLineData
8aaf2ebf
ER
1Summary: An NTP client/server
2Name: chrony
0cb82a43 3Version: 2.4
23b58943 4Release: 1
8aaf2ebf
ER
5License: GPL v2
6Group: Daemons
6e56eb76 7Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
0cb82a43 8# Source0-md5: d0598aa8a9be8faccef9386f6fc0d5f2
8aaf2ebf
ER
9Source1: %{name}.conf
10Source2: %{name}.keys
11Source3: %{name}d.sysconfig
12Source4: %{name}d.init
13Source5: %{name}.logrotate
2e022141 14URL: http://chrony.tuxfamily.org/
0cb82a43 15BuildRequires: asciidoc
8aaf2ebf
ER
16BuildRequires: bison
17BuildRequires: libcap-devel
00e77c31 18BuildRequires: nss-devel
8aaf2ebf 19BuildRequires: readline-devel
57759dcc 20BuildRequires: rpmbuild(macros) >= 1.453
8aaf2ebf
ER
21Requires(postun): /usr/sbin/groupdel
22Requires(postun): /usr/sbin/userdel
23Requires(pre): /bin/id
24Requires(pre): /usr/bin/getgid
25Requires(pre): /usr/sbin/groupadd
26Requires(pre): /usr/sbin/useradd
27Provides: group(ntp)
28Provides: ntpdaemon
29Provides: user(ntp)
30Obsoletes: ntpdaemon
2e022141 31Conflicts: logrotate < 3.8.0
8aaf2ebf
ER
32BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34%define _sysconfdir /etc/ntp
35
57759dcc
ER
36# assume gcc 3.4 has it
37%if "%{cc_version}" >= "3.4"
38%define specflags -pie -fpie
39%endif
40
8aaf2ebf
ER
41%description
42A client/server for the Network Time Protocol, this program keeps your
43computer's clock accurate. It was specially designed to support
44systems with dial-up Internet connections, and also supports computers
45in permanently connected environments.
46
47%prep
6e56eb76
ER
48%setup -q
49
8aaf2ebf
ER
50%build
51# NOTE: It is not autoconf generated configre
52CC="%{__cc}" \
57759dcc 53CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
8aaf2ebf
ER
54CPPFLAGS="%{rpmcppflags}" \
55./configure \
56 --prefix=%{_prefix} \
57 --sysconfdir=%{_sysconfdir} \
58 --docdir=%{_docdir} \
8aaf2ebf
ER
59 --without-editline \
60
0cb82a43
AM
61%{__make} getdate all docs \
62 ADOC=asciidoc
8aaf2ebf
ER
63
64%install
65rm -rf $RPM_BUILD_ROOT
72931147 66install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \
8aaf2ebf
ER
67 $RPM_BUILD_ROOT{%{_sysconfdir},/var/{lib/ntp,log/chrony}}
68
69%{__make} install install-docs \
70 DESTDIR=$RPM_BUILD_ROOT
71
72rm -rf $RPM_BUILD_ROOT%{_docdir}
73
74cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
5e2ed499 75cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
8aaf2ebf
ER
76cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
77cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
78install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
79
80touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
81
82%clean
83rm -rf $RPM_BUILD_ROOT
84
85%pre
86%groupadd -g 246 ntp
87%useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
88
89%post
8aaf2ebf
ER
90/sbin/chkconfig --add chronyd
91%service chronyd restart
92
93%preun
94if [ "$1" = "0" ]; then
95 %service chronyd stop
96 /sbin/chkconfig --del chronyd
8aaf2ebf
ER
97fi
98
99%postun
100if [ "$1" = "0" ]; then
101 %userremove ntp
102 %groupremove ntp
103fi
104
105%files
106%defattr(644,root,root,755)
0cb82a43 107%doc NEWS README FAQ examples/* doc/{faq,installation}.html
8aaf2ebf
ER
108%dir %{_sysconfdir}
109%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
5e2ed499 110%attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
8aaf2ebf
ER
111%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
112%config(noreplace) /etc/logrotate.d/chrony
c59d8b3b 113%attr(754,root,root) /etc/rc.d/init.d/chronyd
8aaf2ebf
ER
114%attr(755,root,root) %{_bindir}/chronyc
115%attr(755,root,root) %{_sbindir}/chronyd
8aaf2ebf
ER
116%{_mandir}/man1/chronyc.1*
117%{_mandir}/man5/chrony.conf.5*
118%{_mandir}/man8/chronyd.8*
8aaf2ebf
ER
119
120%dir %attr(770,root,ntp) /var/lib/ntp
121%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
122%attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
123
124%dir %attr(770,ntp,ntp) /var/log/chrony
This page took 0.112919 seconds and 4 git commands to generate.