chrony/chrony.spec

142 lines
4.4 KiB
RPMSpec
Raw Normal View History

#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: chrony
Version: 1.27
Release: 0
License: GPL-2.0+
Summary: System Clock Synchronization Client and Server
Url: http://chrony.tuxfamily.org/
Group: Productivity/Networking/Other
Source: http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
Source1: chrony.init
Source2: chrony.sysconfig
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1: chrony-config.patch
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: libcap-devel
BuildRequires: make
BuildRequires: mozilla-nss-devel
BuildRequires: ncurses-devel
BuildRequires: pkg-config
BuildRequires: readline-devel
BuildRequires: texinfo
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): %fillup_prereq
Requires(pre): %insserv_prereq
Requires(pre): %install_info_prereq
Requires(pre): /usr/sbin/groupadd
Requires(pre): /usr/sbin/useradd
%description
Chrony is a pair of programs which are used to maintain the accuracy of the
system clock on a computer. The two programs are called chronyd and chronyc.
Chronyd is a daemon which runs in background on the system. It obtains
measurements via the network of the system clocks offset relative to time
servers on other systems and adjusts the system time accordingly. For isolated
systems, the user can periodically enter the correct time by hand (using
Chronyc). In either case, Chronyd determines the rate at which the computer
gains or loses time, and compensates for this. Chronyd implements the NTP
protocol and can act as either a client or a server.
Chronyc provides a user interface to Chronyd for monitoring its performance and
configuring various settings. It can do so while running on the same computer
as the Chronyd instance it is controlling or a different computer.
%prep
%setup -q
%patch1
%build
# not autoconf:
./configure \
--prefix="%{_prefix}" \
--exec-prefix="%{_exec_prefix}" \
--sysconfdir="%{_sysconfdir}" \
--bindir="%{_bindir}" \
--sbindir="%{_sbindir}" \
--datarootdir="%{_datadir}" \
--infodir="%{_infodir}" \
--mandir="%{_mandir}" \
--docdir="%{_docdir}/%{name}"
make %{?_smp_mflags} \
CC="gcc" \
CFLAGS="%{optflags} -Wall" \
prefix="%{_prefix}"
make chrony.txt prefix="%{_prefix}"
make chrony.info prefix="%{_prefix}"
%install
%makeinstall
rm -rf "%{buildroot}%{_docdir}/%{name}"
install -d "%{buildroot}%{_infodir}"
install -m0644 chrony.info "%{buildroot}%{_infodir}"/
install -D -m0755 "%{SOURCE1}" "%{buildroot}%{_initddir}/chronyd"
install -d "%{buildroot}%{_prefix}/sbin"
ln -s ../../etc/init.d/chronyd "%{buildroot}%{_sbindir}/rcchronyd"
install -D -m0644 "%{SOURCE2}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd"
install -d "%{buildroot}%{_localstatedir}/lib/chrony"
install -d "%{buildroot}%{_localstatedir}/log/chrony"
%if 0%{?suse_version} >= 1030 && 0%{?suse_version} <= 1140
h=/usr/share/doc/licenses/md5/$(md5sum COPYING|cut -f1 -d" ")
test -e "$h" && ln -s -f "$h" .
%endif
install -d "%{buildroot}%{_sysconfdir}"
install -m0644 examples/chrony.conf.example "%{buildroot}%{_sysconfdir}/chrony.conf"
install -m0600 examples/chrony.keys.example "%{buildroot}%{_sysconfdir}/chrony.keys"
rm examples/chrony.keys.example.orig
%pre
/usr/sbin/groupadd -r chrony || :
/usr/sbin/useradd -r -g chrony -c "Chrony Daemon" -d "%{_localstatedir}/lib/chrony" chrony || :
%post
%{fillup_only -an chronyd}
%install_info --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}"
%preun
%stop_on_removal chronyd
%postun
%restart_on_update chronyd
%insserv_cleanup
%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}"
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc README chrony.txt COPYING
%doc examples
%config(noreplace) %{_sysconfdir}/chrony.conf
%config(noreplace) %{_sysconfdir}/chrony.keys
%{_bindir}/chronyc
%{_sbindir}/chronyd
%doc %{_mandir}/man1/chrony.1%{ext_man}
%doc %{_mandir}/man1/chronyc.1%{ext_man}
%doc %{_mandir}/man5/chrony.conf.5%{ext_man}
%doc %{_mandir}/man8/chronyd.8%{ext_man}
%doc %{_infodir}/chrony.info%{ext_info}
%config %{_sysconfdir}/init.d/chronyd
%{_sbindir}/rcchronyd
%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd
%attr(0750,chrony,chrony) %{_localstatedir}/lib/chrony
%attr(0750,chrony,chrony) %{_localstatedir}/log/chrony
%changelog