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