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