]> git.pld-linux.org Git - packages/chrony.git/blame - chrony.spec
- rel 5; revert commit which breaks responses on some multihomed machines; https...
[packages/chrony.git] / chrony.spec
CommitLineData
917d712f
AM
1%define nettle_ver 3.4
2
8aaf2ebf
ER
3Summary: An NTP client/server
4Name: chrony
05113654 5Version: 3.5
56bdbca8 6Release: 5
8aaf2ebf
ER
7License: GPL v2
8Group: Daemons
6e56eb76 9Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
05113654 10# Source0-md5: 5f66338bc940a9b51eede8f391e7bed3
8aaf2ebf
ER
11Source1: %{name}.conf
12Source2: %{name}.keys
13Source3: %{name}d.sysconfig
14Source4: %{name}d.init
15Source5: %{name}.logrotate
518bb5ef
AM
16Patch0: allow-clock_adjtime.patch
17Patch1: fix-seccomp-build.patch
56bdbca8 18Patch2: dont-force-index.patch
2e022141 19URL: http://chrony.tuxfamily.org/
0cb82a43 20BuildRequires: asciidoc
8aaf2ebf
ER
21BuildRequires: bison
22BuildRequires: libcap-devel
518bb5ef 23BuildRequires: libseccomp-devel
917d712f 24BuildRequires: nettle-devel >= %{nettle_ver}
00e77c31 25BuildRequires: nss-devel
8aaf2ebf 26BuildRequires: readline-devel
57759dcc 27BuildRequires: rpmbuild(macros) >= 1.453
8aaf2ebf
ER
28Requires(postun): /usr/sbin/groupdel
29Requires(postun): /usr/sbin/userdel
30Requires(pre): /bin/id
31Requires(pre): /usr/bin/getgid
32Requires(pre): /usr/sbin/groupadd
33Requires(pre): /usr/sbin/useradd
34Provides: group(ntp)
35Provides: ntpdaemon
36Provides: user(ntp)
917d712f 37Requires: nettle >= %{nettle_ver}
8aaf2ebf 38Obsoletes: ntpdaemon
2e022141 39Conflicts: logrotate < 3.8.0
8aaf2ebf
ER
40BuildRoot: %{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
50A client/server for the Network Time Protocol, this program keeps your
51computer's clock accurate. It was specially designed to support
52systems with dial-up Internet connections, and also supports computers
53in 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
63CC="%{__cc}" \
57759dcc 64CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
8aaf2ebf
ER
65CPPFLAGS="%{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
82rm -rf $RPM_BUILD_ROOT
72931147 83install -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
89rm -rf $RPM_BUILD_ROOT%{_docdir}
90
91cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
5e2ed499 92cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
8aaf2ebf
ER
93cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
94cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
95install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
96
97touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
98
99%clean
100rm -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
111if [ "$1" = "0" ]; then
112 %service chronyd stop
113 /sbin/chkconfig --del chronyd
8aaf2ebf
ER
114fi
115
116%postun
117if [ "$1" = "0" ]; then
118 %userremove ntp
119 %groupremove ntp
120fi
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
This page took 0.057622 seconds and 4 git commands to generate.