]>
Commit | Line | Data |
---|---|---|
0608c56c | 1 | # TODO: pps (BR: pps-tools-devel) |
917d712f AM |
2 | %define nettle_ver 3.4 |
3 | ||
8aaf2ebf | 4 | Summary: An NTP client/server |
0608c56c | 5 | Summary(pl.UTF-8): Klient/serwer NTP |
8aaf2ebf | 6 | Name: chrony |
3b8450f1 MK |
7 | Version: 4.1 |
8 | Release: 1 | |
8aaf2ebf ER |
9 | License: GPL v2 |
10 | Group: Daemons | |
6e56eb76 | 11 | Source0: http://download.tuxfamily.org/chrony/%{name}-%{version}.tar.gz |
3b8450f1 | 12 | # Source0-md5: 7133880806887b629678c36a48217806 |
8aaf2ebf ER |
13 | Source1: %{name}.conf |
14 | Source2: %{name}.keys | |
15 | Source3: %{name}d.sysconfig | |
16 | Source4: %{name}d.init | |
17 | Source5: %{name}.logrotate | |
3b8450f1 MK |
18 | Patch0: fix-seccomp-build.patch |
19 | Patch1: chrony-seccomp.patch | |
2e022141 | 20 | URL: http://chrony.tuxfamily.org/ |
0cb82a43 | 21 | BuildRequires: asciidoc |
8aaf2ebf ER |
22 | BuildRequires: bison |
23 | BuildRequires: libcap-devel | |
0608c56c | 24 | BuildRequires: libedit-devel |
518bb5ef | 25 | BuildRequires: libseccomp-devel |
0608c56c | 26 | # for hashing; can be also nss 3.x or libtomcrypt |
917d712f | 27 | BuildRequires: nettle-devel >= %{nettle_ver} |
0608c56c | 28 | BuildRequires: pkgconfig |
57759dcc | 29 | BuildRequires: rpmbuild(macros) >= 1.453 |
8aaf2ebf ER |
30 | Requires(postun): /usr/sbin/groupdel |
31 | Requires(postun): /usr/sbin/userdel | |
32 | Requires(pre): /bin/id | |
33 | Requires(pre): /usr/bin/getgid | |
34 | Requires(pre): /usr/sbin/groupadd | |
35 | Requires(pre): /usr/sbin/useradd | |
36 | Provides: group(ntp) | |
37 | Provides: ntpdaemon | |
38 | Provides: user(ntp) | |
917d712f | 39 | Requires: nettle >= %{nettle_ver} |
8aaf2ebf | 40 | Obsoletes: ntpdaemon |
2e022141 | 41 | Conflicts: logrotate < 3.8.0 |
8aaf2ebf ER |
42 | BuildRoot: %{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 |
52 | A client/server for the Network Time Protocol, this program keeps your | |
53 | computer's clock accurate. It was specially designed to support | |
54 | systems with dial-up Internet connections, and also supports computers | |
55 | in permanently connected environments. | |
56 | ||
0608c56c JB |
57 | %description -l pl.UTF-8 |
58 | Klient/serwer protokołu NTP (Network Time Protocol), pozwalający | |
59 | utrzymać zegar komputera dokładnym. Został zaprojektowany w | |
60 | szczególności do obsłużenia systemów z wdzwanianym połączeniem do | |
61 | Internetu, 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 | |
70 | CC="%{__cc}" \ | |
57759dcc | 71 | CFLAGS="%{rpmcflags} -Wmissing-prototypes -Wall" \ |
8aaf2ebf ER |
72 | CPPFLAGS="%{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 | |
88 | rm -rf $RPM_BUILD_ROOT | |
72931147 | 89 | install -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 | |
97 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/chrony.conf | |
5e2ed499 | 98 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/keys |
8aaf2ebf ER |
99 | cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/chronyd |
100 | cp -a %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/chrony | |
101 | install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/chronyd | |
102 | ||
103 | touch $RPM_BUILD_ROOT%{_localstatedir}/lib/ntp/{drift,rtc} | |
104 | ||
105 | %clean | |
106 | rm -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 | |
117 | if [ "$1" = "0" ]; then | |
118 | %service chronyd stop | |
119 | /sbin/chkconfig --del chronyd | |
8aaf2ebf ER |
120 | fi |
121 | ||
122 | %postun | |
123 | if [ "$1" = "0" ]; then | |
124 | %userremove ntp | |
125 | %groupremove ntp | |
126 | fi | |
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 |