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