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