]>
Commit | Line | Data |
---|---|---|
8aaf2ebf ER |
1 | Summary: An NTP client/server |
2 | Name: chrony | |
2c290ae3 | 3 | Version: 1.26 |
f97f5659 | 4 | Release: 6 |
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 |
2c290ae3 | 9 | # Source0-md5: ad6dd619ff1986e4ff780363c64e2246 |
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 | |
18 | BuildRequires: readline-devel | |
57759dcc | 19 | BuildRequires: rpmbuild(macros) >= 1.453 |
8aaf2ebf ER |
20 | BuildRequires: texinfo |
21 | Requires(postun): /usr/sbin/groupdel | |
22 | Requires(postun): /usr/sbin/userdel | |
23 | Requires(pre): /bin/id | |
24 | Requires(pre): /usr/bin/getgid | |
25 | Requires(pre): /usr/sbin/groupadd | |
26 | Requires(pre): /usr/sbin/useradd | |
27 | Provides: group(ntp) | |
28 | Provides: ntpdaemon | |
29 | Provides: user(ntp) | |
f97f5659 | 30 | Conflicts: logrotate < 3.8.0 |
8aaf2ebf ER |
31 | Obsoletes: ntpdaemon |
32 | BuildRoot: %{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 |
42 | A client/server for the Network Time Protocol, this program keeps your | |
43 | computer's clock accurate. It was specially designed to support | |
44 | systems with dial-up Internet connections, and also supports computers | |
45 | in permanently connected environments. | |
46 | ||
47 | %prep | |
6e56eb76 ER |
48 | %setup -q |
49 | ||
50 | %{__sed} -i -e 's,/usr/local,%{_prefix},g' *.texi | |
8aaf2ebf ER |
51 | |
52 | %build | |
53 | # NOTE: It is not autoconf generated configre | |
54 | CC="%{__cc}" \ | |
57759dcc | 55 | CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \ |
8aaf2ebf ER |
56 | CPPFLAGS="%{rpmcppflags}" \ |
57 | ./configure \ | |
58 | --prefix=%{_prefix} \ | |
59 | --sysconfdir=%{_sysconfdir} \ | |
60 | --docdir=%{_docdir} \ | |
8aaf2ebf ER |
61 | --without-editline \ |
62 | ||
63 | %{__make} getdate all docs | |
64 | ||
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
01dc901d | 67 | install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d,init} \ |
8aaf2ebf ER |
68 | $RPM_BUILD_ROOT{%{_sysconfdir},/var/{lib/ntp,log/chrony}} |
69 | ||
70 | %{__make} install install-docs \ | |
71 | DESTDIR=$RPM_BUILD_ROOT | |
72 | ||
73 | rm -rf $RPM_BUILD_ROOT%{_docdir} | |
74 | ||
75 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf | |
5e2ed499 | 76 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys |
8aaf2ebf ER |
77 | cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd |
78 | cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony | |
79 | install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd | |
01dc901d | 80 | cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/init/chronyd.conf |
8aaf2ebf ER |
81 | |
82 | touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc} | |
83 | ||
84 | %clean | |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
87 | %pre | |
88 | %groupadd -g 246 ntp | |
89 | %useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp | |
90 | ||
91 | %post | |
0ef1a5c8 | 92 | [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 |
8aaf2ebf ER |
93 | /sbin/chkconfig --add chronyd |
94 | %service chronyd restart | |
95 | ||
96 | %preun | |
97 | if [ "$1" = "0" ]; then | |
98 | %service chronyd stop | |
99 | /sbin/chkconfig --del chronyd | |
8aaf2ebf ER |
100 | fi |
101 | ||
102 | %postun | |
0ef1a5c8 | 103 | [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 |
8aaf2ebf ER |
104 | if [ "$1" = "0" ]; then |
105 | %userremove ntp | |
106 | %groupremove ntp | |
107 | fi | |
108 | ||
109 | %files | |
110 | %defattr(644,root,root,755) | |
111 | %doc NEWS README chrony.txt faq.txt examples/* | |
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 | 115 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd |
01dc901d | 116 | %config(noreplace) %verify(not md5 mtime size) /etc/init/chronyd.conf |
8aaf2ebf | 117 | %config(noreplace) /etc/logrotate.d/chrony |
c59d8b3b | 118 | %attr(754,root,root) /etc/rc.d/init.d/chronyd |
8aaf2ebf ER |
119 | %attr(755,root,root) %{_bindir}/chronyc |
120 | %attr(755,root,root) %{_sbindir}/chronyd | |
121 | %{_mandir}/man1/chrony.1* | |
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 |