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