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