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