]> git.pld-linux.org Git - packages/chrony.git/blame - chrony.spec
- updated to 4.5
[packages/chrony.git] / chrony.spec
CommitLineData
4024be8f 1%define nettle_ver 3.9
917d712f 2
8aaf2ebf 3Summary: An NTP client/server
0608c56c 4Summary(pl.UTF-8): Klient/serwer NTP
8aaf2ebf 5Name: chrony
f4e943fc 6Version: 4.5
c89c5fec 7Release: 1
8aaf2ebf
ER
8License: GPL v2
9Group: Daemons
6e56eb76 10Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz
f4e943fc 11# Source0-md5: fa50d026df54f9919e6a37fae1258c61
8aaf2ebf
ER
12Source1: %{name}.conf
13Source2: %{name}.keys
14Source3: %{name}d.sysconfig
15Source4: %{name}d.init
16Source5: %{name}.logrotate
3b8450f1 17Patch0: fix-seccomp-build.patch
c89c5fec 18Patch1: conf.d.patch
2e022141 19URL: http://chrony.tuxfamily.org/
0cb82a43 20BuildRequires: asciidoc
8aaf2ebf 21BuildRequires: bison
3f9e087d 22BuildRequires: gnutls-devel
8aaf2ebf 23BuildRequires: libcap-devel
0608c56c 24BuildRequires: libedit-devel
518bb5ef 25BuildRequires: libseccomp-devel
3f9e087d 26# for hashing; can be also nss 3.x, libtomcrypt, gnutls
917d712f 27BuildRequires: nettle-devel >= %{nettle_ver}
0608c56c 28BuildRequires: pkgconfig
3f9e087d 29BuildRequires: pps-tools-devel
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
6e56eb76 68
8aaf2ebf
ER
69%build
70# NOTE: It is not autoconf generated configre
71CC="%{__cc}" \
57759dcc 72CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \
8aaf2ebf
ER
73CPPFLAGS="%{rpmcppflags}" \
74./configure \
5e2590d3 75 --enable-debug \
518bb5ef
AM
76 --enable-ntp-signd \
77 --enable-scfilter \
8aaf2ebf
ER
78 --prefix=%{_prefix} \
79 --sysconfdir=%{_sysconfdir} \
80 --docdir=%{_docdir} \
518bb5ef
AM
81 --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
82 --with-hwclockfile=%{_sysconfdir}/adjtime \
0608c56c 83 --with-sendmail=%{_sbindir}/sendmail
8aaf2ebf 84
0cb82a43
AM
85%{__make} getdate all docs \
86 ADOC=asciidoc
8aaf2ebf
ER
87
88%install
89rm -rf $RPM_BUILD_ROOT
72931147 90install -d $RPM_BUILD_ROOT/etc/{sysconfig,logrotate.d,rc.d/init.d} \
34f29393 91 $RPM_BUILD_ROOT{%{_sysconfdir}/chrony.d,/var/{lib/ntp,log/chrony}}
8aaf2ebf
ER
92
93%{__make} install install-docs \
94 DESTDIR=$RPM_BUILD_ROOT
95
0608c56c 96%{__rm} -r $RPM_BUILD_ROOT%{_docdir}
8aaf2ebf
ER
97
98cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf
5e2ed499 99cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys
8aaf2ebf
ER
100cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd
101cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony
102install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd
103
104touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc}
105
106%clean
107rm -rf $RPM_BUILD_ROOT
108
109%pre
110%groupadd -g 246 ntp
111%useradd -u 246 -d %{_localstatedir}/lib/ntp -g ntp -c "NTP Daemon" ntp
112
113%post
8aaf2ebf
ER
114/sbin/chkconfig --add chronyd
115%service chronyd restart
116
117%preun
118if [ "$1" = "0" ]; then
119 %service chronyd stop
120 /sbin/chkconfig --del chronyd
8aaf2ebf
ER
121fi
122
123%postun
124if [ "$1" = "0" ]; then
125 %userremove ntp
126 %groupremove ntp
127fi
128
129%files
130%defattr(644,root,root,755)
0cb82a43 131%doc NEWS README FAQ examples/* doc/{faq,installation}.html
8aaf2ebf
ER
132%dir %{_sysconfdir}
133%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/chrony.conf
34f29393 134%attr(750,root,root) %dir %{_sysconfdir}/chrony.d
5e2ed499 135%attr(640,root,ntp) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/keys
8aaf2ebf
ER
136%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/chronyd
137%config(noreplace) /etc/logrotate.d/chrony
c59d8b3b 138%attr(754,root,root) /etc/rc.d/init.d/chronyd
8aaf2ebf
ER
139%attr(755,root,root) %{_bindir}/chronyc
140%attr(755,root,root) %{_sbindir}/chronyd
8aaf2ebf
ER
141%{_mandir}/man1/chronyc.1*
142%{_mandir}/man5/chrony.conf.5*
143%{_mandir}/man8/chronyd.8*
8aaf2ebf
ER
144
145%dir %attr(770,root,ntp) /var/lib/ntp
146%attr(640,ntp,ntp) %ghost /var/lib/ntp/drift
147%attr(640,ntp,ntp) %ghost /var/lib/ntp/rtc
148
149%dir %attr(770,ntp,ntp) /var/log/chrony
This page took 0.124755 seconds and 4 git commands to generate.