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