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