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