]> git.pld-linux.org Git - packages/chrony.git/blame - chrony.spec
- rel 3; use few features from example upstream configs
[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
f619f0a9 6Release: 3
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
2e022141 18URL: http://chrony.tuxfamily.org/
0cb82a43 19BuildRequires: asciidoc
8aaf2ebf
ER
20BuildRequires: bison
21BuildRequires: libcap-devel
518bb5ef 22BuildRequires: libseccomp-devel
917d712f 23BuildRequires: nettle-devel >= %{nettle_ver}
00e77c31 24BuildRequires: nss-devel
8aaf2ebf 25BuildRequires: readline-devel
57759dcc 26BuildRequires: rpmbuild(macros) >= 1.453
8aaf2ebf
ER
27Requires(postun): /usr/sbin/groupdel
28Requires(postun): /usr/sbin/userdel
29Requires(pre): /bin/id
30Requires(pre): /usr/bin/getgid
31Requires(pre): /usr/sbin/groupadd
32Requires(pre): /usr/sbin/useradd
33Provides: group(ntp)
34Provides: ntpdaemon
35Provides: user(ntp)
917d712f 36Requires: nettle >= %{nettle_ver}
8aaf2ebf 37Obsoletes: ntpdaemon
2e022141 38Conflicts: logrotate < 3.8.0
8aaf2ebf
ER
39BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41%define _sysconfdir /etc/ntp
42
57759dcc
ER
43# assume gcc 3.4 has it
44%if "%{cc_version}" >= "3.4"
45%define specflags -pie -fpie
46%endif
47
8aaf2ebf
ER
48%description
49A client/server for the Network Time Protocol, this program keeps your
50computer's clock accurate. It was specially designed to support
51systems with dial-up Internet connections, and also supports computers
52in permanently connected environments.
53
54%prep
6e56eb76 55%setup -q
518bb5ef
AM
56%patch0 -p1
57%patch1 -p1
6e56eb76 58
8aaf2ebf
ER
59%build
60# NOTE: It is not autoconf generated configre
61CC="%{__cc}" \
57759dcc 62CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
8aaf2ebf
ER
63CPPFLAGS="%{rpmcppflags}" \
64./configure \
518bb5ef
AM
65 --enable-ntp-signd \
66 --enable-scfilter \
8aaf2ebf
ER
67 --prefix=%{_prefix} \
68 --sysconfdir=%{_sysconfdir} \
69 --docdir=%{_docdir} \
518bb5ef
AM
70 --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
71 --with-hwclockfile=%{_sysconfdir}/adjtime \
72 --with-sendmail=%{_sbindir}/sendmail \
73 --without-editline
8aaf2ebf 74
0cb82a43
AM
75%{__make} getdate all docs \
76 ADOC=asciidoc
8aaf2ebf
ER
77
78%install
79rm -rf $RPM_BUILD_ROOT
72931147 80install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \
8aaf2ebf
ER
81 $RPM_BUILD_ROOT{%{_sysconfdir},/var/{lib/ntp,log/chrony}}
82
83%{__make} install install-docs \
84 DESTDIR=$RPM_BUILD_ROOT
85
86rm -rf $RPM_BUILD_ROOT%{_docdir}
87
88cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
5e2ed499 89cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
8aaf2ebf
ER
90cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
91cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
92install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
93
94touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
95
96%clean
97rm -rf $RPM_BUILD_ROOT
98
99%pre
100%groupadd -g 246 ntp
101%useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
102
103%post
8aaf2ebf
ER
104/sbin/chkconfig --add chronyd
105%service chronyd restart
106
107%preun
108if [ "$1" = "0" ]; then
109 %service chronyd stop
110 /sbin/chkconfig --del chronyd
8aaf2ebf
ER
111fi
112
113%postun
114if [ "$1" = "0" ]; then
115 %userremove ntp
116 %groupremove ntp
117fi
118
119%files
120%defattr(644,root,root,755)
0cb82a43 121%doc NEWS README FAQ examples/* doc/{faq,installation}.html
8aaf2ebf
ER
122%dir %{_sysconfdir}
123%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
5e2ed499 124%attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
8aaf2ebf
ER
125%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
126%config(noreplace) /etc/logrotate.d/chrony
c59d8b3b 127%attr(754,root,root) /etc/rc.d/init.d/chronyd
8aaf2ebf
ER
128%attr(755,root,root) %{_bindir}/chronyc
129%attr(755,root,root) %{_sbindir}/chronyd
8aaf2ebf
ER
130%{_mandir}/man1/chronyc.1*
131%{_mandir}/man5/chrony.conf.5*
132%{_mandir}/man8/chronyd.8*
8aaf2ebf
ER
133
134%dir %attr(770,root,ntp) /var/lib/ntp
135%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
136%attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
137
138%dir %attr(770,ntp,ntp) /var/log/chrony
This page took 0.163258 seconds and 4 git commands to generate.