|
@@ -1,8 +1,8 @@
|
|
|
%bcond_with systemd
|
|
|
|
|
|
Name: chrony
|
|
|
-Version: 3.5.1
|
|
|
-Release: 2%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
+Version: 4.1
|
|
|
+Release: 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
Summary: An NTP client/server
|
|
|
Group: system
|
|
|
Vendor: Project Vine
|
|
@@ -17,14 +17,13 @@ Source2: chrony.dhclient
|
|
|
Source3: chronyd.sysconfig
|
|
|
Source4: chronyd.init
|
|
|
Source5: chrony.logrotate
|
|
|
-Source6: chrony.helper
|
|
|
-Source7: chrony-dnssrv@.service
|
|
|
-Source8: chrony-dnssrv@.timer
|
|
|
|
|
|
-# add NTP servers from DHCP when starting service
|
|
|
-Patch2: chrony-service-helper.patch
|
|
|
-
|
|
|
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
+# add distribution-specific bits to DHCP dispatcher
|
|
|
+Patch1: chrony-nm-dispatcher-dhcp.patch
|
|
|
+# update seccomp filter for new glibc
|
|
|
+Patch2: chrony-seccomp.patch
|
|
|
+# harden chronyd and chrony-wait services
|
|
|
+Patch3: chrony-services.patch
|
|
|
|
|
|
BuildRequires: libcap-devel readline-devel ncurses-devel bison
|
|
|
BuildRequires: libseccomp-devel
|
|
@@ -44,7 +43,6 @@ Requires(postun): initscripts
|
|
|
%if "%{?_dist_release}" == "vl7"
|
|
|
Obsoletes: ntp < 4.2.6p5
|
|
|
%endif
|
|
|
-Obsoletes: networkmanager-dispatcher-chrony
|
|
|
|
|
|
%description
|
|
|
A client/server for the Network Time Protocol, this program keeps your
|
|
@@ -59,7 +57,9 @@ clocks, system real-time clock or manual input as time references.
|
|
|
|
|
|
%prep
|
|
|
%setup -q -n %{name}-%{version}%{?prerelease}
|
|
|
-%patch2 -p1 -b .service-helper
|
|
|
+%patch1 -p1 -b .nm-dispatcher-dhcp
|
|
|
+%patch2 -p1 -b .seccomp
|
|
|
+%patch3 -p1 -b .services
|
|
|
|
|
|
echo '# Keys used by chronyd for command and NTP authentication' > chrony.keys
|
|
|
|
|
@@ -68,51 +68,46 @@ rm -f getdate.c
|
|
|
|
|
|
|
|
|
%build
|
|
|
-#CFLAGS="$RPM_OPT_FLAGS"
|
|
|
-#%ifarch %{sparc}
|
|
|
-#CFLAGS="$CFLAGS -pie -fPIE"
|
|
|
-#%else
|
|
|
-#CFLAGS="$CFLAGS -pie -fpie"
|
|
|
-#%endif
|
|
|
-#export CFLAGS
|
|
|
-#export LDFLAGS="-Wl,-z,relro,-z,now"
|
|
|
-
|
|
|
%configure \
|
|
|
--docdir=%{_docdir} \
|
|
|
--enable-ntp-signd \
|
|
|
--enable-scfilter \
|
|
|
+ --disable-nts \
|
|
|
+ --with-ntp-era=$(date -d '1970-01-01 00:00:00+00:00' +'%s') \
|
|
|
--with-user=chrony \
|
|
|
--with-sendmail=%{_sbindir}/sendmail \
|
|
|
%if %{with systemd}
|
|
|
--chronyrundir=/run/chrony \
|
|
|
--with-pidfile=/run/chrony/chronyd.pid \
|
|
|
%endif
|
|
|
- --enable-forcednsretry
|
|
|
-make %{?_smp_mflags} all docs
|
|
|
+ %{mil}
|
|
|
+make %{?_smp_mflags}
|
|
|
|
|
|
|
|
|
%install
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
-make install install-docs DESTDIR=%{buildroot}
|
|
|
+make install DESTDIR=%{buildroot}
|
|
|
|
|
|
rm -rf %{buildroot}%{_docdir}
|
|
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d}
|
|
|
mkdir -p %{buildroot}%{_initrddir}
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/{lib,log}/chrony
|
|
|
-mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/dhcp/dhclient.d
|
|
|
+mkdir -p %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d
|
|
|
|
|
|
install -m 644 -p %{SOURCE1} %{buildroot}%{_sysconfdir}/chrony.conf
|
|
|
install -m 640 -p chrony.keys %{buildroot}%{_sysconfdir}/chrony.keys
|
|
|
-install -m 755 -p examples/chrony.nm-dispatcher \
|
|
|
- %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
|
|
|
install -m 755 -p %{SOURCE2} \
|
|
|
%{buildroot}%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
|
|
|
+install -m 644 -p %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/chrony
|
|
|
+install -m 755 -p examples/chrony.nm-dispatcher.onoffline \
|
|
|
+ %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony-onoffline
|
|
|
+install -m 755 -p examples/chrony.nm-dispatcher.dhcp \
|
|
|
+ %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony-dhcp
|
|
|
|
|
|
install -m 644 -p %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/chronyd
|
|
|
-install -m 644 -p %{SOURCE5} %{buildroot}%{_sysconfdir}/logrotate.d/chrony
|
|
|
|
|
|
%if %{with systemd}
|
|
|
mkdir -p %{buildroot}{%{_unitdir},/lib/systemd/ntp-units.d}
|
|
@@ -120,10 +115,7 @@ 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 %{SOURCE7} %{buildroot}%{_unitdir}/chrony-dnssrv@.service
|
|
|
-install -m 644 -p %{SOURCE8} %{buildroot}%{_unitdir}/chrony-dnssrv@.timer
|
|
|
mkdir -p %{buildroot}%{_libexecdir}
|
|
|
-install -m 755 -p %{SOURCE6} %{buildroot}%{_libexecdir}/chrony-helper
|
|
|
echo 'chronyd.service' > \
|
|
|
%{buildroot}/lib/systemd/ntp-units.d/50-chronyd.list
|
|
|
%else
|
|
@@ -147,6 +139,16 @@ getent passwd chrony > /dev/null || /usr/sbin/useradd -r -g chrony \
|
|
|
%if %{with systemd}
|
|
|
# workaround for late reload of unit file (#1614751)
|
|
|
%{_bindir}/systemctl daemon-reload
|
|
|
+# migrate from chrony-helper to sourcedir directive
|
|
|
+if test -a %{_libexecdir}/chrony-helper; then
|
|
|
+ grep -qi 'sourcedir /run/chrony-dhcp$' %{_sysconfdir}/chrony.conf 2> /dev/null || \
|
|
|
+ echo -e '\n# Use NTP servers from DHCP.\nsourcedir /run/chrony-dhcp' >> \
|
|
|
+ %{_sysconfdir}/chrony.conf
|
|
|
+ mkdir -p /run/chrony-dhcp
|
|
|
+ for f in %{_localstatedir}/lib/dhclient/chrony.servers.*; do
|
|
|
+ sed 's|.*|server &|' < $f > /run/chrony-dhcp/"${f##*servers.}.sources"
|
|
|
+ done 2> /dev/null
|
|
|
+fi
|
|
|
%systemd_post chronyd.service chrony-wait.service
|
|
|
%else
|
|
|
/sbin/chkconfig --add chronyd
|
|
@@ -184,16 +186,14 @@ fi
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/chronyd
|
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/chrony
|
|
|
%if %{with systemd}
|
|
|
-%{_libexecdir}/chrony-helper
|
|
|
/lib/systemd/ntp-units.d/*.list
|
|
|
%{_unitdir}/chrony*.service
|
|
|
-%{_unitdir}/chrony*.timer
|
|
|
%else
|
|
|
%{_initrddir}/chronyd
|
|
|
%endif
|
|
|
-%dir %{_sysconfdir}/NetworkManager
|
|
|
-%dir %{_sysconfdir}/NetworkManager/dispatcher.d
|
|
|
-%{_sysconfdir}/NetworkManager/dispatcher.d/20-chrony
|
|
|
+%dir %{_prefix}/lib/NetworkManager
|
|
|
+%dir %{_prefix}/lib/NetworkManager/dispatcher.d
|
|
|
+%{_prefix}/lib/NetworkManager/dispatcher.d/20-chrony*
|
|
|
%dir %{_sysconfdir}/dhcp
|
|
|
%dir %{_sysconfdir}/dhcp/dhclient.d
|
|
|
%{_sysconfdir}/dhcp/dhclient.d/chrony.sh
|
|
@@ -207,6 +207,9 @@ fi
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Wed Nov 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.1-1
|
|
|
+- new upstream release.
|
|
|
+
|
|
|
* Tue Sep 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5.1-2
|
|
|
- rebuilt with nettle-3.6.
|
|
|
|