forked from pool/chrony
Accepting request 536990 from network:time
- Cleanup spec file: * Drop pre systemd support * Run spec-cleaner - Modified the spec file to comment out the pool statement in chrony.conf if _not_ building for openSUSE. (bsc#1063704). OBS-URL: https://build.opensuse.org/request/show/536990 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/chrony?expand=0&rev=8
This commit is contained in:
commit
a92d20fb0b
@ -1,3 +1,16 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 26 10:39:11 UTC 2017 - mpluskal@suse.com
|
||||||
|
|
||||||
|
- Cleanup spec file:
|
||||||
|
* Drop pre systemd support
|
||||||
|
* Run spec-cleaner
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 24 18:23:56 UTC 2017 - mpost@suse.com
|
||||||
|
|
||||||
|
- Modified the spec file to comment out the pool statement
|
||||||
|
in chrony.conf if _not_ building for openSUSE. (bsc#1063704).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 28 16:17:08 UTC 2017 - mrueckert@suse.de
|
Thu Sep 28 16:17:08 UTC 2017 - mrueckert@suse.de
|
||||||
|
|
||||||
|
114
chrony.init
114
chrony.init
@ -1,114 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# openSUSE system startup script for chronyd
|
|
||||||
# Copyright (C) 2010 Pascal Bleser <pascal.bleser@opensuse.org>
|
|
||||||
#
|
|
||||||
# This library is free software; you can redistribute it and/or modify it
|
|
||||||
# under the terms of the GNU Lesser General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2.1 of the License, or (at
|
|
||||||
# your option) any later version.
|
|
||||||
#
|
|
||||||
# This library is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# Lesser General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
|
||||||
# License along with this library; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
|
|
||||||
# USA.
|
|
||||||
#
|
|
||||||
# /etc/init.d/chronyd
|
|
||||||
# and its symbolic link
|
|
||||||
# /usr/sbin/rcchronyd
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: chronyd
|
|
||||||
# Required-Start: $syslog $remote_fs $network $time
|
|
||||||
# Should-Start: $time ypbind
|
|
||||||
# Required-Stop: $syslog $remote_fs $network $time
|
|
||||||
# Should-Stop: ypbind
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Short-Description: Chrony daemon providing system clock synchronization
|
|
||||||
# Description: Start the chrony daemon to manage the system clock
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
SERVICE=chronyd
|
|
||||||
|
|
||||||
# Check for missing binaries (stale symlinks should not happen)
|
|
||||||
# Note: Special treatment of stop for LSB conformance
|
|
||||||
CHRONYD_BIN=/usr/sbin/FOO
|
|
||||||
test -x "$CHRONYD_BIN" || { echo "$CHRONYD_BIN not installed";
|
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
|
||||||
else exit 5; fi; }
|
|
||||||
|
|
||||||
# Check for existence of needed config file and read it
|
|
||||||
CHRONYD_CONFIG="/etc/sysconfig/chronyd"
|
|
||||||
test -r "$CHRONYD_CONFIG" || { echo "$CHRONYD_CONFIG not existing";
|
|
||||||
if [ "$1" = "stop" ]; then exit 0;
|
|
||||||
else exit 6; fi; }
|
|
||||||
|
|
||||||
# Read config
|
|
||||||
. "$CHRONYD_CONFIG"
|
|
||||||
|
|
||||||
CHRONYD_USER=chrony
|
|
||||||
|
|
||||||
. /etc/rc.status
|
|
||||||
rc_reset # Reset status of this service
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
CHRONY_OPTIONS=""
|
|
||||||
[ "$CHRONY_IPV4" = "yes" -a "$CHRONY_IPV6" = "no" ] && CHRONY_OPTIONS="$CHRONY_OPTIONS -4"
|
|
||||||
[ "$CHRONY_IPV4" = "no" -a "$CHRONY_IPV6" = "yes" ] && CHRONY_OPTIONS="$CHRONY_OPTIONS -6"
|
|
||||||
[ "$CHRONY_LOCK_IN_RAM" = "yes" ] && CHRONY_OPTIONS="$CHRONY_OPTIONS -m"
|
|
||||||
echo -n "Starting $SERVICE "
|
|
||||||
/sbin/startproc "$CHRONYD_BIN" -u "$CHRONYD_USER" $CHRONY_OPTIONS
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
echo -n "Shutting down $SERVICE "
|
|
||||||
/sbin/killproc -TERM "$CHRONYD_BIN"
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
try-restart|condrestart)
|
|
||||||
if test "$1" = "condrestart"; then
|
|
||||||
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
|
|
||||||
fi
|
|
||||||
$0 status
|
|
||||||
if test $? = 0; then
|
|
||||||
$0 restart
|
|
||||||
else
|
|
||||||
rc_reset # Not running is not a failure.
|
|
||||||
fi
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
force-reload)
|
|
||||||
echo -n "Reload service $SERVICE "
|
|
||||||
$0 try-restart
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
rc_failed 3
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
echo -n "Checking for service $SERVICE "
|
|
||||||
/sbin/checkproc "$CHRONYD_BIN"
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
probe)
|
|
||||||
test /etc/chronyd.conf -nt /var/run/chronyd.pid && echo reload
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
rc_exit
|
|
117
chrony.spec
117
chrony.spec
@ -18,13 +18,6 @@
|
|||||||
|
|
||||||
%define vendorzone opensuse.
|
%define vendorzone opensuse.
|
||||||
%global clknetsim_ver 71dbbc5
|
%global clknetsim_ver 71dbbc5
|
||||||
%if 0%{?suse_version} > 1230
|
|
||||||
%bcond_without systemd
|
|
||||||
%bcond_without syscallfilter
|
|
||||||
%else
|
|
||||||
%bcond_with systemd
|
|
||||||
%bcond_with syscallfilter
|
|
||||||
%endif
|
|
||||||
Name: chrony
|
Name: chrony
|
||||||
Version: 3.2
|
Version: 3.2
|
||||||
Release: 0
|
Release: 0
|
||||||
@ -33,7 +26,6 @@ License: GPL-2.0
|
|||||||
Group: Productivity/Networking/Other
|
Group: Productivity/Networking/Other
|
||||||
Url: http://chrony.tuxfamily.org/
|
Url: http://chrony.tuxfamily.org/
|
||||||
Source: http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
|
Source: http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz
|
||||||
Source1: chrony.init
|
|
||||||
Source2: chrony.sysconfig
|
Source2: chrony.sysconfig
|
||||||
Source3: chrony.dhclient
|
Source3: chrony.dhclient
|
||||||
Source4: chrony.helper
|
Source4: chrony.helper
|
||||||
@ -47,7 +39,6 @@ Patch0: chrony-config.patch
|
|||||||
Patch1: chrony-service-helper.patch
|
Patch1: chrony-service-helper.patch
|
||||||
Patch2: chrony-logrotate.patch
|
Patch2: chrony-logrotate.patch
|
||||||
Patch5: chrony-fix-open.patch
|
Patch5: chrony-fix-open.patch
|
||||||
#
|
|
||||||
BuildRequires: NetworkManager-devel
|
BuildRequires: NetworkManager-devel
|
||||||
BuildRequires: bison
|
BuildRequires: bison
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
@ -58,25 +49,17 @@ BuildRequires: pkgconfig
|
|||||||
# The timezone package is needed for the "make check" tests. It can be
|
# The timezone package is needed for the "make check" tests. It can be
|
||||||
# removed if the call to make check is ever deleted.
|
# removed if the call to make check is ever deleted.
|
||||||
BuildRequires: timezone
|
BuildRequires: timezone
|
||||||
|
BuildRequires: pkgconfig(systemd)
|
||||||
Requires: logrotate
|
Requires: logrotate
|
||||||
Requires(pre): %fillup_prereq
|
Requires(pre): %fillup_prereq
|
||||||
Requires(pre): %{_sbindir}/groupadd
|
Requires(pre): %{_sbindir}/groupadd
|
||||||
Requires(pre): %{_sbindir}/useradd
|
Requires(pre): %{_sbindir}/useradd
|
||||||
Provides: ntp-daemon
|
Provides: ntp-daemon
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
||||||
%if %{with syscallfilter}
|
|
||||||
%ifarch s390 s390x ppc64le
|
%ifarch s390 s390x ppc64le
|
||||||
BuildRequires: libseccomp-devel >= 2.2.0
|
BuildRequires: libseccomp-devel >= 2.2.0
|
||||||
%else
|
%else
|
||||||
BuildRequires: libseccomp-devel
|
BuildRequires: libseccomp-devel
|
||||||
%endif
|
%endif
|
||||||
%endif
|
|
||||||
%if %{with systemd}
|
|
||||||
BuildRequires: pkgconfig(systemd)
|
|
||||||
%{?systemd_requires}
|
|
||||||
%else
|
|
||||||
Requires(pre): %insserv_prereq
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Chrony is an implementation of the Network Time Protocol (NTP). It can
|
Chrony is an implementation of the Network Time Protocol (NTP). It can
|
||||||
@ -107,9 +90,16 @@ or a different computer.
|
|||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
|
|
||||||
# use our vendor zone (2.*pool.ntp.org names include IPv6 addresses)
|
# If this is an openSUSE build, use our vendor zone
|
||||||
|
# (2.*pool.ntp.org names include IPv6 addresses). If not
|
||||||
|
# an openSUSE build, comment out the pool statement
|
||||||
|
%if 0%{?is_opensuse}
|
||||||
sed -e 's|^\(pool \)\(pool.ntp.org\)|\12.%{vendorzone}\2|' \
|
sed -e 's|^\(pool \)\(pool.ntp.org\)|\12.%{vendorzone}\2|' \
|
||||||
< examples/chrony.conf.example2 > chrony.conf
|
< examples/chrony.conf.example2 > chrony.conf
|
||||||
|
%else
|
||||||
|
sed -e 's|^\pool|! pool|' \
|
||||||
|
< examples/chrony.conf.example2 > chrony.conf
|
||||||
|
%endif
|
||||||
|
|
||||||
touch -r examples/chrony.conf.example2 chrony.conf
|
touch -r examples/chrony.conf.example2 chrony.conf
|
||||||
|
|
||||||
@ -130,90 +120,67 @@ export LDFLAGS="-pie -Wl,-z,relro,-z,now"
|
|||||||
--with-user=chrony \
|
--with-user=chrony \
|
||||||
--with-hwclockfile=%{_sysconfdir}/adjtime \
|
--with-hwclockfile=%{_sysconfdir}/adjtime \
|
||||||
--with-sendmail=%{_sbindir}/sendmail
|
--with-sendmail=%{_sbindir}/sendmail
|
||||||
|
|
||||||
make %{?_smp_mflags} all docs
|
make %{?_smp_mflags} all docs
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make %{?_smp_mflags} DESTDIR=%{buildroot} install
|
%make_install
|
||||||
|
install -Dpm 0644 chrony.conf \
|
||||||
|
%{buildroot}%{_sysconfdir}/chrony.conf
|
||||||
|
install -Dpm 0640 examples/chrony.keys.example \
|
||||||
|
%{buildroot}%{_sysconfdir}/chrony.keys
|
||||||
|
install -Dpm 0755 examples/chrony.nm-dispatcher \
|
||||||
|
%{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
|
||||||
|
install -Dpm 0755 %{SOURCE3} \
|
||||||
|
%{buildroot}%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
|
||||||
|
install -Dpm 0644 examples/chrony.logrotate \
|
||||||
|
%{buildroot}%{_sysconfdir}/logrotate.d/chrony
|
||||||
|
install -Dpm 0644 examples/chronyd.service \
|
||||||
|
%{buildroot}%{_unitdir}/chronyd.service
|
||||||
|
install -Dpm 0644 examples/chrony-wait.service \
|
||||||
|
%{buildroot}%{_unitdir}/chrony-wait.service
|
||||||
|
install -Dpm 0644 %{SOURCE5} \
|
||||||
|
%{buildroot}%{_unitdir}/chrony-dnssrv@.service
|
||||||
|
install -Dpm 0644 %{SOURCE6} \
|
||||||
|
%{buildroot}%{_unitdir}/chrony-dnssrv@.timer
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d}
|
install -d %{buildroot}%{sbindir}
|
||||||
mkdir -p %{buildroot}%{_localstatedir}/{lib,log}/chrony
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcchronyd
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcchrony-wait
|
||||||
mkdir -p %{buildroot}%{_sysconfdir}/dhcp/dhclient.d
|
|
||||||
mkdir -p %{buildroot}%{_datadir}
|
|
||||||
mkdir -p %{buildroot}{%{_unitdir},%{_prefix}/lib/systemd/ntp-units.d}
|
|
||||||
|
|
||||||
install -m 644 -p chrony.conf %{buildroot}%{_sysconfdir}/chrony.conf
|
|
||||||
|
|
||||||
install -m 640 -p examples/chrony.keys.example \
|
|
||||||
%{buildroot}%{_sysconfdir}/chrony.keys
|
|
||||||
install -m 755 -p examples/chrony.nm-dispatcher \
|
|
||||||
%{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
|
|
||||||
install -m 755 -p %{SOURCE3} \
|
|
||||||
%{buildroot}%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
|
|
||||||
install -m 644 -p examples/chrony.logrotate \
|
|
||||||
%{buildroot}%{_sysconfdir}/logrotate.d/chrony
|
|
||||||
|
|
||||||
%if %{with systemd}
|
|
||||||
install -m 644 -p examples/chronyd.service \
|
|
||||||
%{buildroot}%{_unitdir}/chronyd.service
|
|
||||||
install -m 644 -p examples/chrony-wait.service \
|
|
||||||
%{buildroot}%{_unitdir}/chrony-wait.service
|
|
||||||
install -m 644 -p %{SOURCE5} %{buildroot}%{_unitdir}/chrony-dnssrv@.service
|
|
||||||
install -m 644 -p %{SOURCE6} %{buildroot}%{_unitdir}/chrony-dnssrv@.timer
|
|
||||||
ln -s %{_sbindir}/service "%{buildroot}%{_sbindir}/rcchronyd"
|
|
||||||
ln -s %{_sbindir}/service "%{buildroot}%{_sbindir}/rcchrony-wait"
|
|
||||||
|
|
||||||
|
install -d %{buildroot}%{_prefix}/lib/systemd/ntp-units.d
|
||||||
echo 'chronyd.service' > \
|
echo 'chronyd.service' > \
|
||||||
%{buildroot}%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
|
%{buildroot}%{_prefix}/lib/systemd/ntp-units.d/50-chronyd.list
|
||||||
%else
|
|
||||||
install -D -m0755 "%{SOURCE1}" "%{buildroot}%{_initddir}/chronyd"
|
|
||||||
ln -s ../..%{_initddir}/chronyd "%{buildroot}%{_sbindir}/rcchronyd"
|
|
||||||
%endif
|
|
||||||
install -D -m0644 "%{SOURCE2}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd"
|
|
||||||
|
|
||||||
install -m 755 -p %{SOURCE4} %{buildroot}%{_datadir}/chrony-helper
|
install -Dpm 0644 %{SOURCE2} \
|
||||||
|
%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd
|
||||||
|
install -Dpm 755 %{SOURCE4} \
|
||||||
|
%{buildroot}%{_datadir}/chrony-helper
|
||||||
|
|
||||||
|
install -d %{buildroot}%{_localstatedir}/log/chrony
|
||||||
touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
|
touch %{buildroot}%{_localstatedir}/lib/chrony/{drift,rtc}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# Set random seed to get deterministic results
|
# Set random seed to get deterministic results
|
||||||
export CLKNETSIM_RANDOM_SEED=24501
|
export CLKNETSIM_RANDOM_SEED=24501
|
||||||
make %{?_smp_mflags} -C test/simulation/clknetsim
|
make %{?_smp_mflags} -C test/simulation/clknetsim
|
||||||
|
make %{?_smp_mflags} check
|
||||||
make check
|
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
%{_sbindir}/groupadd -r chrony >/dev/null 2>&1 || :
|
getent group %{name} >/dev/null || groupadd -r %{name}
|
||||||
%{_sbindir}/useradd -g chrony -s /bin/false -r -c "Chrony Daemon" -d "%{_localstatedir}/lib/chrony" chrony >/dev/null 2>&1 || :
|
getent passwd %{name} >/dev/null || useradd -r -g %{name} -d "%{_localstatedir}/lib/chrony" -s /bin/false -c "Chrony Daemon" %{name}
|
||||||
# START BIG SYSTEMD
|
|
||||||
%if %{with systemd}
|
|
||||||
%service_add_pre chronyd.service chrony-wait.service
|
%service_add_pre chronyd.service chrony-wait.service
|
||||||
%endif
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%if %{with systemd}
|
|
||||||
%service_del_preun chronyd.service chrony-wait.service
|
%service_del_preun chronyd.service chrony-wait.service
|
||||||
%else
|
|
||||||
%stop_on_removal chronyd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%fillup_only %{name}
|
%fillup_only %{name}
|
||||||
%if %{with systemd}
|
|
||||||
%service_add_post chronyd.service chrony-wait.service
|
%service_add_post chronyd.service chrony-wait.service
|
||||||
%endif
|
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%if %{with systemd}
|
|
||||||
%service_del_postun chronyd.service chrony-wait.service
|
%service_del_postun chronyd.service chrony-wait.service
|
||||||
%else
|
|
||||||
%restart_on_update chronyd
|
|
||||||
%insserv_cleanup
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
|
||||||
%doc FAQ NEWS README COPYING
|
%doc FAQ NEWS README COPYING
|
||||||
%doc examples
|
%doc examples
|
||||||
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/chrony.conf
|
%config(noreplace) %attr(0640,root,%{name}) %{_sysconfdir}/chrony.conf
|
||||||
@ -229,13 +196,9 @@ make check
|
|||||||
%{_mandir}/man1/chronyc.1%{ext_man}
|
%{_mandir}/man1/chronyc.1%{ext_man}
|
||||||
%{_mandir}/man5/chrony.conf.5%{ext_man}
|
%{_mandir}/man5/chrony.conf.5%{ext_man}
|
||||||
%{_mandir}/man8/chronyd.8%{ext_man}
|
%{_mandir}/man8/chronyd.8%{ext_man}
|
||||||
%if %{with systemd}
|
|
||||||
%{_prefix}/lib/systemd/ntp-units.d/*.list
|
%{_prefix}/lib/systemd/ntp-units.d/*.list
|
||||||
%{_unitdir}/chrony*.service
|
%{_unitdir}/chrony*.service
|
||||||
%{_unitdir}/chrony*.timer
|
%{_unitdir}/chrony*.timer
|
||||||
%else
|
|
||||||
%config %{_sysconfdir}/init.d/chronyd
|
|
||||||
%endif
|
|
||||||
%{_sbindir}/rcchrony*
|
%{_sbindir}/rcchrony*
|
||||||
%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd
|
%{_localstatedir}/adm/fillup-templates/sysconfig.chronyd
|
||||||
%dir %attr(750,chrony,chrony) %{_localstatedir}/lib/chrony
|
%dir %attr(750,chrony,chrony) %{_localstatedir}/lib/chrony
|
||||||
|
Loading…
x
Reference in New Issue
Block a user