]> git.pld-linux.org Git - packages/chrony.git/blame - chrony.spec
Rel 2; parse /etc/ntp/chrony.d/*.conf by default. Don't fail if there are no files...
[packages/chrony.git] / chrony.spec
CommitLineData
0608c56c 1# TODO: pps (BR: pps-tools-devel)
917d712f
AM
2%define nettle_ver 3.4
3
8aaf2ebf 4Summary: An NTP client/server
0608c56c 5Summary(pl.UTF-8): Klient/serwer NTP
8aaf2ebf 6Name: chrony
3b8450f1 7Version: 4.1
34f29393 8Release: 2
8aaf2ebf
ER
9License: GPL v2
10Group: Daemons
6e56eb76 11Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
3b8450f1 12# Source0-md5: 7133880806887b629678c36a48217806
8aaf2ebf
ER
13Source1: %{name}.conf
14Source2: %{name}.keys
15Source3: %{name}d.sysconfig
16Source4: %{name}d.init
17Source5: %{name}.logrotate
3b8450f1
MK
18Patch0: fix-seccomp-build.patch
19Patch1: chrony-seccomp.patch
34f29393 20Patch2: conf.d.patch
2e022141 21URL: http://chrony.tuxfamily.org/
0cb82a43 22BuildRequires: asciidoc
8aaf2ebf
ER
23BuildRequires: bison
24BuildRequires: libcap-devel
0608c56c 25BuildRequires: libedit-devel
518bb5ef 26BuildRequires: libseccomp-devel
0608c56c 27# for hashing; can be also nss 3.x or libtomcrypt
917d712f 28BuildRequires: nettle-devel >= %{nettle_ver}
0608c56c 29BuildRequires: pkgconfig
57759dcc 30BuildRequires: rpmbuild(macros) >= 1.453
8aaf2ebf
ER
31Requires(postun): /usr/sbin/groupdel
32Requires(postun): /usr/sbin/userdel
33Requires(pre): /bin/id
34Requires(pre): /usr/bin/getgid
35Requires(pre): /usr/sbin/groupadd
36Requires(pre): /usr/sbin/useradd
37Provides: group(ntp)
38Provides: ntpdaemon
39Provides: user(ntp)
917d712f 40Requires: nettle >= %{nettle_ver}
8aaf2ebf 41Obsoletes: ntpdaemon
2e022141 42Conflicts: logrotate < 3.8.0
8aaf2ebf
ER
43BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45%define _sysconfdir /etc/ntp
46
57759dcc
ER
47# assume gcc 3.4 has it
48%if "%{cc_version}" >= "3.4"
49%define specflags -pie -fpie
50%endif
51
8aaf2ebf
ER
52%description
53A client/server for the Network Time Protocol, this program keeps your
54computer's clock accurate. It was specially designed to support
55systems with dial-up Internet connections, and also supports computers
56in permanently connected environments.
57
0608c56c
JB
58%description -l pl.UTF-8
59Klient/serwer protokołu NTP (Network Time Protocol), pozwalający
60utrzymać zegar komputera dokładnym. Został zaprojektowany w
61szczególności do obsłużenia systemów z wdzwanianym połączeniem do
62Internetu, obsługuje także komputery na stałym łączu.
63
8aaf2ebf 64%prep
6e56eb76 65%setup -q
518bb5ef
AM
66%patch0 -p1
67%patch1 -p1
34f29393 68%patch2 -p1
6e56eb76 69
8aaf2ebf
ER
70%build
71# NOTE: It is not autoconf generated configre
72CC="%{__cc}" \
57759dcc 73CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
8aaf2ebf
ER
74CPPFLAGS="%{rpmcppflags}" \
75./configure \
5e2590d3 76 --enable-debug \
518bb5ef
AM
77 --enable-ntp-signd \
78 --enable-scfilter \
8aaf2ebf
ER
79 --prefix=%{_prefix} \
80 --sysconfdir=%{_sysconfdir} \
81 --docdir=%{_docdir} \
518bb5ef
AM
82 --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
83 --with-hwclockfile=%{_sysconfdir}/adjtime \
0608c56c 84 --with-sendmail=%{_sbindir}/sendmail
8aaf2ebf 85
0cb82a43
AM
86%{__make} getdate all docs \
87 ADOC=asciidoc
8aaf2ebf
ER
88
89%install
90rm -rf $RPM_BUILD_ROOT
72931147 91install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \
34f29393 92 $RPM_BUILD_ROOT{%{_sysconfdir}/chrony.d,/var/{lib/ntp,log/chrony}}
8aaf2ebf
ER
93
94%{__make} install install-docs \
95 DESTDIR=$RPM_BUILD_ROOT
96
0608c56c 97%{__rm} -r $RPM_BUILD_ROOT%{_docdir}
8aaf2ebf
ER
98
99cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
5e2ed499 100cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
8aaf2ebf
ER
101cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
102cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
103install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
104
105touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
106
107%clean
108rm -rf $RPM_BUILD_ROOT
109
110%pre
111%groupadd -g 246 ntp
112%useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
113
114%post
8aaf2ebf
ER
115/sbin/chkconfig --add chronyd
116%service chronyd restart
117
118%preun
119if [ "$1" = "0" ]; then
120 %service chronyd stop
121 /sbin/chkconfig --del chronyd
8aaf2ebf
ER
122fi
123
124%postun
125if [ "$1" = "0" ]; then
126 %userremove ntp
127 %groupremove ntp
128fi
129
130%files
131%defattr(644,root,root,755)
0cb82a43 132%doc NEWS README FAQ examples/* doc/{faq,installation}.html
8aaf2ebf
ER
133%dir %{_sysconfdir}
134%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
34f29393 135%attr(750,root,root) %dir %{_sysconfdir}/chrony.d
5e2ed499 136%attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
8aaf2ebf
ER
137%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
138%config(noreplace) /etc/logrotate.d/chrony
c59d8b3b 139%attr(754,root,root) /etc/rc.d/init.d/chronyd
8aaf2ebf
ER
140%attr(755,root,root) %{_bindir}/chronyc
141%attr(755,root,root) %{_sbindir}/chronyd
8aaf2ebf
ER
142%{_mandir}/man1/chronyc.1*
143%{_mandir}/man5/chrony.conf.5*
144%{_mandir}/man8/chronyd.8*
8aaf2ebf
ER
145
146%dir %attr(770,root,ntp) /var/lib/ntp
147%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
148%attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
149
150%dir %attr(770,ntp,ntp) /var/log/chrony
This page took 0.153001 seconds and 4 git commands to generate.