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