2019-09-30 11:10:18 -04:00
|
|
|
%global _hardened_build 1
|
|
|
|
|
|
|
|
|
|
Name: ntp
|
|
|
|
|
Version: 4.2.8p13
|
2020-04-17 19:31:57 +08:00
|
|
|
Release: 6
|
2019-09-30 11:10:18 -04:00
|
|
|
Summary: A protocol designed to synchronize the clocks of computers over a network
|
2019-11-06 19:44:27 +08:00
|
|
|
License: MIT and BSD and BSD with advertising
|
|
|
|
|
URL: https://www.ntp.org/
|
2019-09-30 11:10:18 -04:00
|
|
|
Source0: https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-%{version}.tar.gz
|
|
|
|
|
Source1: ntp.conf
|
|
|
|
|
Source2: ntp.keys
|
|
|
|
|
Source4: ntpd.sysconfig
|
|
|
|
|
Source6: ntp.step-tickers
|
|
|
|
|
Source7: ntpdate.wrapper
|
|
|
|
|
Source8: ntp.cryptopw
|
|
|
|
|
Source9: ntpdate.sysconfig
|
|
|
|
|
Source10: ntp.dhclient
|
|
|
|
|
Source12: ntpd.service
|
|
|
|
|
Source13: ntpdate.service
|
|
|
|
|
Source14: ntp-wait.service
|
|
|
|
|
Source15: sntp.service
|
|
|
|
|
Source16: sntp.sysconfig
|
|
|
|
|
Patch1: ntp-sntp-sysexits.patch
|
|
|
|
|
Patch2: ntp-ssl-libs.patch
|
|
|
|
|
|
|
|
|
|
Patch9000: bugfix-fix-bind-port-in-debug-mode.patch
|
|
|
|
|
Patch9001: bugfix-fix-autokey-condition-error.patch
|
|
|
|
|
Patch9002: bugfix-fix-ifindex-length.patch
|
|
|
|
|
Patch9003: revert-ntpd-fix-autokey-condition-error.patch
|
|
|
|
|
|
2020-04-17 19:31:57 +08:00
|
|
|
Patch6001: backport-Use-of-uninitialized-value-in-receive-function.patch
|
|
|
|
|
Patch6002: backport-process_control-should-bail-earlier-on-short-packets.patch
|
|
|
|
|
|
2019-09-30 11:10:18 -04:00
|
|
|
BuildRequires: libcap-devel openssl-devel libedit-devel libevent-devel pps-tools-devel
|
|
|
|
|
BuildRequires: autogen autogen-libopts-devel systemd gcc perl-generators perl-HTML-Parser
|
|
|
|
|
Requires(pre): shadow-utils
|
|
|
|
|
%{?systemd_requires}
|
|
|
|
|
Recommends: ntpstat timedatex
|
2019-11-06 19:44:27 +08:00
|
|
|
Provides: ntpdate sntp
|
2019-09-30 11:10:18 -04:00
|
|
|
Obsoletes: ntpdate sntp
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
NTP is a protocol designed to synchronize the clocks of computers over a network, \
|
|
|
|
|
NTP version 4, a significant revision of the previous NTP standard, is the current \
|
|
|
|
|
development version. It is formalized by RFCs released by the IETF.
|
|
|
|
|
|
|
|
|
|
%package perl
|
|
|
|
|
Summary: NTP utilities present with Perl
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
%{?systemd_requires}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
%description perl
|
|
|
|
|
Provides Perl scripts calc_tickadj, ntp-wait and ntptrace.
|
|
|
|
|
|
|
|
|
|
%package_help
|
|
|
|
|
|
|
|
|
|
%global ntpdocdir %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}
|
|
|
|
|
|
|
|
|
|
%if 0%{!?vendorzone:1}
|
|
|
|
|
%global vendorzone %(source /etc/os-release && echo ${ID}.)
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -n %{name}-%{version} -p1
|
|
|
|
|
|
|
|
|
|
sed -i 's|\r||g' html/scripts/{footer.txt,style.css}
|
|
|
|
|
for f in COPYRIGHT; do
|
|
|
|
|
iconv -f iso8859-1 -t utf8 -o ${f}{_,} && touch -r ${f}{,_} && mv -f ${f}{_,}
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
sed -i 's|$CFLAGS -Wstrict-overflow|$CFLAGS|' configure sntp/configure
|
|
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -fno-strict-overflow"
|
|
|
|
|
%configure \
|
|
|
|
|
--sysconfdir=%{_sysconfdir}/ntp/crypto --with-locfile=redhat \
|
|
|
|
|
--without-ntpsnmpd --enable-all-clocks --enable-parse-clocks \
|
|
|
|
|
--enable-ntp-signd=%{_localstatedir}/run/ntp_signd --disable-local-libopts
|
|
|
|
|
|
|
|
|
|
sed -i 's|/var/db/ntp-kod|%{_localstatedir}/lib/sntp/kod|' sntp/sntp{-opts.c,.1*}
|
|
|
|
|
sed -i 's|/etc/ntp/drift|%{_localstatedir}/lib/ntp/drift|' \
|
|
|
|
|
scripts/calc_tickadj/calc_tickadj{,.m*.in}
|
|
|
|
|
echo '#define KEYFILE "%{_sysconfdir}/ntp/keys"' >> ntpdate/ntpdate.h
|
|
|
|
|
echo '#define NTP_VAR "%{_localstatedir}/log/ntpstats/"' >> config.h
|
|
|
|
|
|
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
|
|
sed -e 's|@PATH_PERL@|%{_bindir}/perl|' -e 's|@[^@]*_MS@|8|g' \
|
|
|
|
|
< scripts/deprecated/html2man.in \
|
|
|
|
|
> scripts/deprecated/html2man
|
|
|
|
|
pushd html
|
|
|
|
|
perl ../scripts/deprecated/html2man
|
|
|
|
|
sed -i 's/^[\t\ ]*$//;/./,/^$/!d' man/man*/*.[58]
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%make_install
|
|
|
|
|
|
|
|
|
|
cp -r html/man/man8/{ntpdate,ntptime,tickadj}* $RPM_BUILD_ROOT%{_mandir}/man8
|
|
|
|
|
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_docdir}
|
|
|
|
|
install -d $RPM_BUILD_ROOT%{ntpdocdir}
|
2019-11-06 19:44:27 +08:00
|
|
|
cp -p ChangeLog NEWS $RPM_BUILD_ROOT%{ntpdocdir}
|
2019-09-30 11:10:18 -04:00
|
|
|
|
|
|
|
|
find html | grep -E '\.(html|css|txt|jpg|gif)$' | grep -v '/build/\|sntp' | \
|
|
|
|
|
cpio -pmd $RPM_BUILD_ROOT%{ntpdocdir}
|
|
|
|
|
find $RPM_BUILD_ROOT%{ntpdocdir} -type f | xargs chmod 644
|
|
|
|
|
find $RPM_BUILD_ROOT%{ntpdocdir} -type d | xargs chmod 755
|
|
|
|
|
|
|
|
|
|
pushd $RPM_BUILD_ROOT
|
|
|
|
|
install -d .%{_sysconfdir}/{ntp/crypto,sysconfig,dhcp/dhclient.d} .%{_libexecdir}
|
|
|
|
|
install -d .%{_localstatedir}/{lib/{s,}ntp,log/ntpstats} .%{_unitdir}
|
|
|
|
|
touch .%{_localstatedir}/lib/{ntp/drift,sntp/kod}
|
|
|
|
|
sed -e 's|VENDORZONE\.|%{vendorzone}|' \
|
|
|
|
|
-e 's|ETCNTP|%{_sysconfdir}/ntp|' \
|
|
|
|
|
-e 's|VARNTP|%{_localstatedir}/lib/ntp|' \
|
|
|
|
|
< %{SOURCE1} > .%{_sysconfdir}/ntp.conf
|
|
|
|
|
touch -r %{SOURCE1} .%{_sysconfdir}/ntp.conf
|
|
|
|
|
install -p -m600 %{SOURCE2} .%{_sysconfdir}/ntp/keys
|
|
|
|
|
install -p -m755 %{SOURCE7} .%{_libexecdir}/ntpdate-wrapper
|
|
|
|
|
install -p -m644 %{SOURCE4} .%{_sysconfdir}/sysconfig/ntpd
|
|
|
|
|
install -p -m644 %{SOURCE9} .%{_sysconfdir}/sysconfig/ntpdate
|
|
|
|
|
sed -e 's|VENDORZONE\.|%{vendorzone}|' \
|
|
|
|
|
< %{SOURCE6} > .%{_sysconfdir}/ntp/step-tickers
|
|
|
|
|
touch -r %{SOURCE6} .%{_sysconfdir}/ntp/step-tickers
|
|
|
|
|
sed -e 's|VENDORZONE\.|%{vendorzone}|' \
|
|
|
|
|
< %{SOURCE16} > .%{_sysconfdir}/sysconfig/sntp
|
|
|
|
|
touch -r %{SOURCE16} .%{_sysconfdir}/sysconfig/sntp
|
|
|
|
|
install -p -m600 %{SOURCE8} .%{_sysconfdir}/ntp/crypto/pw
|
|
|
|
|
install -p -m755 %{SOURCE10} .%{_sysconfdir}/dhcp/dhclient.d/ntp.sh
|
|
|
|
|
install -p -m644 %{SOURCE12} .%{_unitdir}/ntpd.service
|
|
|
|
|
install -p -m644 %{SOURCE13} .%{_unitdir}/ntpdate.service
|
|
|
|
|
install -p -m644 %{SOURCE14} .%{_unitdir}/ntp-wait.service
|
|
|
|
|
install -p -m644 %{SOURCE15} .%{_unitdir}/sntp.service
|
|
|
|
|
|
|
|
|
|
mkdir .%{_prefix}/lib/systemd/ntp-units.d
|
|
|
|
|
echo 'ntpd.service' > .%{_prefix}/lib/systemd/ntp-units.d/60-ntpd.list
|
|
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
2020-03-12 11:16:36 +08:00
|
|
|
%check
|
|
|
|
|
make check
|
|
|
|
|
|
2019-09-30 11:10:18 -04:00
|
|
|
%pre
|
|
|
|
|
/usr/sbin/groupadd -g 38 ntp 2> /dev/null || :
|
|
|
|
|
/usr/sbin/useradd -u 38 -g 38 -s /sbin/nologin -M -r -d %{_sysconfdir}/ntp ntp 2>/dev/null || :
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%systemd_post ntpd.service ntpdate.service sntp.service
|
|
|
|
|
|
|
|
|
|
%post perl
|
|
|
|
|
%systemd_post ntp-wait.service
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun ntpd.service ntpdate.service sntp.service
|
|
|
|
|
|
|
|
|
|
%preun perl
|
|
|
|
|
%systemd_preun ntp-wait.service
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%systemd_postun_with_restart ntpd.service ntpdate.service sntp.service
|
|
|
|
|
|
|
|
|
|
%postun perl
|
|
|
|
|
%systemd_postun ntp-wait.service
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%doc COPYRIGHT ChangeLog NEWS
|
2019-11-06 19:44:27 +08:00
|
|
|
%license COPYRIGHT
|
2019-09-30 11:10:18 -04:00
|
|
|
%dir %attr(-,ntp,ntp) %{_localstatedir}/lib/ntp
|
|
|
|
|
%dir %attr(-,ntp,ntp) %{_localstatedir}/log/ntpstats
|
|
|
|
|
%dir %{_localstatedir}/lib/sntp
|
|
|
|
|
%dir %{_sysconfdir}/ntp
|
|
|
|
|
%dir %attr(750,root,ntp) %{_sysconfdir}/ntp/crypto
|
|
|
|
|
%dir %{_sysconfdir}/dhcp/dhclient.d
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/ntpd
|
|
|
|
|
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/ntp.conf
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/ntpdate
|
|
|
|
|
%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/ntp/step-tickers
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/ntp/keys
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/ntp/crypto/pw
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/sntp
|
|
|
|
|
%{_sysconfdir}/dhcp/dhclient.d/ntp.sh
|
|
|
|
|
%{_sbindir}/ntp-keygen
|
|
|
|
|
%{_sbindir}/ntpd
|
|
|
|
|
%{_sbindir}/ntpdc
|
|
|
|
|
%{_sbindir}/ntpq
|
|
|
|
|
%{_sbindir}/ntptime
|
|
|
|
|
%{_sbindir}/tickadj
|
|
|
|
|
%{_sbindir}/ntpdate
|
|
|
|
|
%{_sbindir}/sntp
|
|
|
|
|
%ghost %attr(644,ntp,ntp) %{_localstatedir}/lib/ntp/drift
|
|
|
|
|
%ghost %{_localstatedir}/lib/sntp/kod
|
|
|
|
|
|
|
|
|
|
%{_unitdir}/*.service
|
|
|
|
|
%{_prefix}/lib/systemd/ntp-units.d/*.list
|
|
|
|
|
%{_libexecdir}/ntpdate-wrapper
|
|
|
|
|
|
|
|
|
|
%files perl
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%{_sbindir}/calc_tickadj
|
|
|
|
|
%{_sbindir}/ntp-wait
|
|
|
|
|
%{_sbindir}/ntptrace
|
|
|
|
|
%{_unitdir}/ntp-wait.service
|
|
|
|
|
%{_datadir}/ntp
|
|
|
|
|
|
|
|
|
|
%files help
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%dir %{ntpdocdir}
|
|
|
|
|
%{ntpdocdir}/html
|
|
|
|
|
%{_mandir}/man5/*.5*
|
|
|
|
|
%{_mandir}/man8/*.8*
|
|
|
|
|
|
|
|
|
|
%changelog
|
2020-04-17 19:31:57 +08:00
|
|
|
* Tue Apr 14 2020 wangli<wangli221@huawei.com> - 4.2.8p13-6
|
|
|
|
|
- Type:security
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: solve fuzz test problem
|
|
|
|
|
|
2020-03-12 11:16:36 +08:00
|
|
|
* Thu Mar 12 2020 openEuler Buildteam <buildteam@openeuler.org> - 4.2.8p13-5
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:enable developer use cases
|
|
|
|
|
|
2020-01-18 15:57:56 +08:00
|
|
|
* Sat Jan 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 4.2.8p13-4
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify the ntp.conf
|
|
|
|
|
|
2019-11-06 19:44:27 +08:00
|
|
|
* Mon Oct 21 2019 openEuler Buildteam <buildteam@openeuler.org> - 4.2.8p13-3
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:modify the location of COPYRIGHT
|
|
|
|
|
|
|
|
|
|
* Mon Oct 14 2019 openEuler Buildteam <buildteam@openeuler.org> - 4.2.8p13-2
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Modify error changelog information
|
|
|
|
|
|
|
|
|
|
* Mon Sep 16 2019 openEuler Buildteam <buildteam@openeuler.org> - 4.2.8p13-1
|
2019-09-30 11:10:18 -04:00
|
|
|
- Type:enhancement
|
|
|
|
|
- Id:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Fix building without zlib-devel
|
|
|
|
|
|
|
|
|
|
* Tue Sep 3 2019 liyongqiang<liyongqiang10@huawei.com> - 4.2.8p12-2
|
2019-11-06 19:44:27 +08:00
|
|
|
- Package init
|