235 lines
8.9 KiB
RPMSpec
235 lines
8.9 KiB
RPMSpec
%define chrony_groupid 55
|
||
%define chrony_userid 55
|
||
|
||
Name: chrony
|
||
Version: 3.0
|
||
Release: 1mamba
|
||
Summary: A pair of programs which are used to maintain the accuracy of the system clock on a computer
|
||
Group: System/Servers
|
||
Vendor: openmamba
|
||
Distribution: openmamba
|
||
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||
URL: http://chrony.tuxfamily.org/index.html
|
||
Source: http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
|
||
Source1: chrony-conf
|
||
Source2: chronyd-initscript
|
||
Source3: chronyd-nm-dispatcher
|
||
Source4: chrony-wait.service
|
||
Source5: chronyd.service
|
||
Source6: chrony.helper
|
||
Patch0: %{name}-2.2-run-dir.patch
|
||
License: GPL
|
||
## AUTOBUILDREQ-BEGIN
|
||
BuildRequires: glibc-devel
|
||
BuildRequires: libcap-devel
|
||
BuildRequires: libedit-devel
|
||
BuildRequires: libnss-devel
|
||
## AUTOBUILDREQ-END
|
||
BuildRequires: libncurses-devel
|
||
BuildRequires: libreadline-devel
|
||
Provides: ntp
|
||
Obsoletes: ntp
|
||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||
|
||
%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 clock’s 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
|
||
#%patch0 -p1
|
||
|
||
%build
|
||
./configure \
|
||
--prefix=%{_prefix} \
|
||
--with-pidile=/run/chronyd.pid
|
||
|
||
%make CC=%{_host}-gcc
|
||
|
||
%install
|
||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||
%makeinstall
|
||
|
||
install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/chrony.conf
|
||
install -D -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/chronyd
|
||
install -D -m0755 %{SOURCE3} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/10_chronyd
|
||
install -d %{buildroot}%{_var}/log/chrony
|
||
|
||
# systemd stuff
|
||
install -d %{buildroot}/lib/systemd/system
|
||
install -m 0644 -p %{SOURCE4} %{buildroot}/lib/systemd/system/chrony-wait.service
|
||
install -m 0644 -p %{SOURCE5} %{buildroot}/lib/systemd/system/chronyd.service
|
||
install -D -m0755 -p %{SOURCE6} %{buildroot}%{_prefix}/libexec/chrony-helper
|
||
install -d -m0755 %{buildroot}%{_prefix}/lib/systemd/ntp-units.d
|
||
echo 'chronyd.service' > %{buildroot}%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
|
||
|
||
rm -rf %{buildroot}%{_docdir}/chrony
|
||
|
||
%clean
|
||
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
|
||
|
||
%pre
|
||
if [ $1 -ge 1 ]; then
|
||
/usr/sbin/groupadd chrony -g %{chrony_groupid} 2>/dev/null
|
||
/usr/sbin/useradd -u %{chrony_userid} -c 'Chrony daemon' -d /dev/null -g chrony \
|
||
-s /bin/false chrony 2>/dev/null
|
||
fi
|
||
:
|
||
|
||
%preun
|
||
if [ $1 -eq 0 ]; then
|
||
[ -x /sbin/service ] && /sbin/service chronyd stop
|
||
[ -x /sbin/chkconfig ] && /sbin/chkconfig --del chronyd
|
||
|
||
systemctl -q disable chronyd
|
||
systemctl -q daemon-reload
|
||
|
||
/usr/sbin/groupdel chrony 2>/dev/null
|
||
/usr/sbin/userdel chrony 2>/dev/null
|
||
fi
|
||
:
|
||
|
||
%post
|
||
if [ $1 -ge 1 ]; then
|
||
[ -e %{_sysconfdir}/chrony.drift ] || touch %{_sysconfdir}/chrony.drift
|
||
[ -e %{_sysconfdir}/chrony.keys ] || touch %{_sysconfdir}/chrony.keys
|
||
chown chrony.chrony %{_sysconfdir}/chrony.drift
|
||
chown chrony.chrony %{_sysconfdir}/chrony.keys
|
||
sed -i "s|/var/run/chronyd.pid|/run/chronyd.pid|" %{_sysconfdir}/chrony.conf
|
||
|
||
# service start/stop now managed by NetworkManager dispatcher
|
||
[ -x /sbin/chkconfig ] && /sbin/chkconfig --del chronyd
|
||
|
||
systemctl -q disable chronyd
|
||
systemctl -q daemon-reload
|
||
fi
|
||
:
|
||
|
||
%files
|
||
%defattr(-,root,root)
|
||
%config(noreplace) %{_sysconfdir}/chrony.conf
|
||
%{_sysconfdir}/NetworkManager/dispatcher.d/10_chronyd
|
||
%{_initrddir}/chronyd
|
||
%{_bindir}/chronyc
|
||
%{_sbindir}/chronyd
|
||
/lib/systemd/system/chrony-wait.service
|
||
/lib/systemd/system/chronyd.service
|
||
%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
|
||
%{_prefix}/libexec/chrony-helper
|
||
%dir %{_var}/log/chrony
|
||
#%{_mandir}/man1/chrony.*
|
||
%{_mandir}/man1/chronyc.*
|
||
%{_mandir}/man5/chrony.conf.*
|
||
%{_mandir}/man8/chronyd.*
|
||
%doc COPYING
|
||
#NEWS README chrony.txt examples/chrony.conf.example examples/chrony.keys.example
|
||
|
||
%changelog
|
||
* Sat Jan 21 2017 Automatic Build System <autodist@mambasoft.it> 3.0-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Tue Nov 22 2016 Automatic Build System <autodist@mambasoft.it> 2.4.1-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Tue Jun 07 2016 Automatic Build System <autodist@mambasoft.it> 2.4-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Tue Feb 16 2016 Automatic Build System <autodist@mambasoft.it> 2.3-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Wed Jan 20 2016 Automatic Build System <autodist@mambasoft.it> 2.2.1-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Sat Nov 21 2015 Automatic Build System <autodist@mambasoft.it> 2.2-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Wed Jul 01 2015 Automatic Build System <autodist@mambasoft.it> 2.1.1-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Thu Apr 30 2015 Automatic Build System <autodist@mambasoft.it> 2.0-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Wed Apr 08 2015 Automatic Build System <autodist@mambasoft.it> 1.31.1-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Thu Sep 18 2014 Automatic Build System <autodist@mambasoft.it> 1.31-1mamba
|
||
- automatic update by autodist
|
||
|
||
* Thu Jul 03 2014 Automatic Build System <autodist@mambasoft.it> 1.30-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Sat Feb 01 2014 Automatic Build System <autodist@mambasoft.it> 1.29.1-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Thu Sep 26 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.29-4mamba
|
||
- chronyd-nm-dispatcher: removed forgotten debugging line
|
||
|
||
* Wed Sep 18 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.29-3mamba
|
||
- chronyd-nm-dispatcher: re-add check on default route removed by mistake in previous release
|
||
- chronyd-nm-dispatcher: start chronyd with "systemctl --no-block ..."
|
||
|
||
* Wed Sep 11 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.29-2mamba
|
||
- disable service to let is be started by NetworkManager dispatcher
|
||
- chronyd-nm-dispatcher: need to start here chronyd for big time adjust to be made
|
||
- chronyd-nm-dispatcher: unmaintain (remove) non systemd code
|
||
- chronyd.service: don't start after network service to allow it starting inside nm dispatcher
|
||
- chrony-wait.service: fix service name (was chron-wait.service)
|
||
|
||
* Fri Aug 09 2013 Automatic Build System <autodist@mambasoft.it> 1.29-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Fri Jul 19 2013 Automatic Build System <autodist@mambasoft.it> 1.28-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Fri Jun 14 2013 openmamba WebBuild System <webbuild@openmamba.org> 1.27-8mamba
|
||
- rework NetworkManager dispatcher script for systemd integration
|
||
|
||
* Tue May 07 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.27-7mamba
|
||
- post: fix permissions of chrony.drift and chrony.keys if they where created with root permissions by previous releases
|
||
|
||
* Sat Apr 13 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.27-6mamba
|
||
- patch to use /run instead of /var/run for pid
|
||
|
||
* Sat Apr 13 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.27-5mamba
|
||
- x86_64: install chrony-helper under /usr/libexec instead of /usr/libexec64
|
||
- NetworkManager dispatcher.d file: do nothing if systemd is running
|
||
|
||
* Wed Apr 03 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.27-4mamba
|
||
- provide a chrony user as requested by new systemd service script
|
||
- remove BindTo=systemd-timedated-ntp.target from chronyd.service for recent systemd
|
||
|
||
* Fri Mar 29 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.27-3mamba
|
||
- added systemd service files
|
||
|
||
* Mon Mar 25 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 1.27-2mamba
|
||
- update NetworkManager dispatcher.d startup file to check for ip route on the interface
|
||
|
||
* Sat Feb 02 2013 Automatic Build System <autodist@mambasoft.it> 1.27-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Mon Jul 25 2011 Automatic Build System <autodist@mambasoft.it> 1.26-1mamba
|
||
- automatic version update by autodist
|
||
|
||
* Sun Jun 19 2011 Automatic Build System <autodist@mambasoft.it> 1.25-1mamba
|
||
- automatic update by autodist
|
||
|
||
* Thu Apr 14 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 1.24-4mamba
|
||
- configure to use NetworkManager dispatcher to start/stop service
|
||
|
||
* Fri Dec 03 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.24-3mamba
|
||
- enable big adjustement on service startup for a skew > 60 sec
|
||
|
||
* Fri Oct 22 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.24-2mamba
|
||
- create the directory %{_var}/log/chrony
|
||
|
||
* Fri Oct 15 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.24-1mamba
|
||
- package created by autospec
|