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