dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone
996523
%global _hardened_build 1
7b5541
%global testsuite_ver a7f6e1
7b5541
%global clknetsim_ver 8b4842
84a7e2
Name:		linuxptp
7b5541
Version:	2.0
056dc8
Release:	2%{?dist}.1
84a7e2
Summary:	PTP implementation for Linux
84a7e2
84a7e2
Group:		System Environment/Base
84a7e2
License:	GPLv2+
84a7e2
URL:		http://linuxptp.sourceforge.net/
84a7e2
63489c
Source0:	https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
84a7e2
Source1:	phc2sys.service
84a7e2
Source2:	ptp4l.service
996523
Source3:	timemaster.service
996523
Source4:	timemaster.conf
63489c
# external test suite
63489c
Source10:	https://github.com/mlichvar/linuxptp-testsuite/archive/%{testsuite_ver}/linuxptp-testsuite-%{testsuite_ver}.tar.gz
63489c
# simulator for test suite
63489c
Source11:	https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz
63489c
7b5541
# fix building with new kernel headers
7b5541
Patch1:		linuxptp-headers.patch
7b5541
# fix timeout handling to work with simulated clock
7b5541
Patch2:		linuxptp-timeout.patch
7b5541
# add support for more accurate synchronization to phc2sys
7b5541
Patch3:		linuxptp-sysoff.patch
7b5541
# limit unicast message rate per address and grant duration
7b5541
Patch4:		linuxptp-ucastrate.patch
7b5541
# add support for active-backup team interface
7b5541
Patch5:		linuxptp-team.patch
7b5541
# fix comparing of unicast addresses
7b5541
Patch6:		linuxptp-addreq.patch
7b5541
# don't leak memory when allocation fails
7b5541
Patch7:		linuxptp-msgput.patch
056dc8
# validate length of forwarded messages
056dc8
Patch8:		linuxptp-cve-2021-3570.patch
7b5541
7b5541
BuildRequires:	kernel-headers > 3.10.0-1002
84a7e2
BuildRequires:	systemd-units
84a7e2
84a7e2
Requires(post):	systemd-units
84a7e2
Requires(preun):	systemd-units
84a7e2
Requires(postun):	systemd-units
84a7e2
84a7e2
%description
84a7e2
This software is an implementation of the Precision Time Protocol (PTP)
84a7e2
according to IEEE standard 1588 for Linux. The dual design goals are to provide
84a7e2
a robust implementation of the standard and to use the most relevant and modern
84a7e2
Application Programming Interfaces (API) offered by the Linux kernel.
84a7e2
Supporting legacy APIs and other platforms is not a goal.
84a7e2
84a7e2
%prep
996523
%setup -q -a 10 -a 11
7b5541
%patch1 -p1 -b .headers
7b5541
%patch2 -p1 -b .timeout
7b5541
%patch3 -p1 -b .sysoff
7b5541
%patch4 -p1 -b .ucastrate
7b5541
%patch5 -p1 -b .team
7b5541
%patch6 -p1 -b .addreq
7b5541
%patch7 -p1 -b .msgput
056dc8
%patch8 -p1 -b .cve-2021-3570
63489c
mv linuxptp-testsuite-%{testsuite_ver}* testsuite
63489c
mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim
84a7e2
84a7e2
%build
84a7e2
make %{?_smp_mflags} \
996523
	EXTRA_CFLAGS="$RPM_OPT_FLAGS" \
996523
	EXTRA_LDFLAGS="$RPM_LD_FLAGS"
84a7e2
84a7e2
%install
84a7e2
%makeinstall
84a7e2
84a7e2
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir},%{_mandir}/man5}
7b5541
install -m 644 -p configs/default.cfg $RPM_BUILD_ROOT%{_sysconfdir}/ptp4l.conf
996523
install -m 644 -p %{SOURCE1} %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}
996523
install -m 644 -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}
84a7e2
84a7e2
echo 'OPTIONS="-f /etc/ptp4l.conf -i eth0"' > \
84a7e2
	$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l
996523
echo 'OPTIONS="-a -r"' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/phc2sys
84a7e2
84a7e2
echo '.so man8/ptp4l.8' > $RPM_BUILD_ROOT%{_mandir}/man5/ptp4l.conf.5
996523
echo '.so man8/timemaster.8' > $RPM_BUILD_ROOT%{_mandir}/man5/timemaster.conf.5
996523
996523
%check
996523
cd testsuite
63489c
# set random seed to get deterministic results
63489c
export CLKNETSIM_RANDOM_SEED=26743
996523
make %{?_smp_mflags} -C clknetsim
996523
PATH=..:$PATH ./run
84a7e2
84a7e2
%post
996523
%systemd_post phc2sys.service ptp4l.service timemaster.service
84a7e2
84a7e2
%preun
996523
%systemd_preun phc2sys.service ptp4l.service timemaster.service
84a7e2
84a7e2
%postun
996523
%systemd_postun_with_restart phc2sys.service ptp4l.service timemaster.service
84a7e2
84a7e2
%files
7b5541
%doc COPYING README.org configs
84a7e2
%config(noreplace) %{_sysconfdir}/ptp4l.conf
84a7e2
%config(noreplace) %{_sysconfdir}/sysconfig/phc2sys
84a7e2
%config(noreplace) %{_sysconfdir}/sysconfig/ptp4l
996523
%config(noreplace) %{_sysconfdir}/timemaster.conf
84a7e2
%{_unitdir}/phc2sys.service
84a7e2
%{_unitdir}/ptp4l.service
996523
%{_unitdir}/timemaster.service
84a7e2
%{_sbindir}/hwstamp_ctl
7b5541
%{_sbindir}/nsm
84a7e2
%{_sbindir}/phc2sys
996523
%{_sbindir}/phc_ctl
84a7e2
%{_sbindir}/pmc
84a7e2
%{_sbindir}/ptp4l
996523
%{_sbindir}/timemaster
84a7e2
%{_mandir}/man5/*.5*
84a7e2
%{_mandir}/man8/*.8*
84a7e2
84a7e2
%changelog
056dc8
* Thu Jun 24 2021 Miroslav Lichvar <mlichvar@redhat.com> 2.0-2.el7_9.1
056dc8
- validate length of forwarded messages (CVE-2021-3570)
056dc8
7b5541
* Tue Mar 26 2019 Miroslav Lichvar <mlichvar@redhat.com> 2.0-2
7b5541
- fix comparing of unicast addresses
7b5541
- don't leak memory when allocation fails
7b5541
7b5541
* Thu Mar 21 2019 Miroslav Lichvar <mlichvar@redhat.com> 2.0-1
7b5541
- update to 2.0 (#1623919)
7b5541
- add support for more accurate synchronization to phc2sys (#1643977)
7b5541
- add support for active-backup team interface (#1650672)
7b5541
- limit unicast message rate per address and grant duration
7b5541
df78dc
* Wed May 30 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-6
df78dc
- add support for bonding to timemaster (#1549015)
df78dc
- improve timemaster to restart terminated processes (#1527170)
df78dc
- start ptp4l, timemaster and phc2sys after network-online target (#1541991)
df78dc
- don't forward management requests to UDS port (#1520366)
df78dc
43ff50
* Tue Oct 24 2017 Miroslav Lichvar <mlichvar@redhat.com> 1.8-5
43ff50
- add support for active-backup bonding (#1002657)
43ff50
- add support for IP over InfiniBand (#1472880)
43ff50
- fix handling of unknown/invalid management TLVs in pmc (#1459446 #1459449)
43ff50
43ff50
* Thu Sep 07 2017 Michal Ruprich <mruprich@redhat.com> - 1.8-4
43ff50
- Resolves: #1487522 - Race condition in phc2sys
49158d
63489c
* Wed Mar 15 2017 Miroslav Lichvar <mlichvar@redhat.com> 1.8-3
63489c
- fix backport of linkdown patch
63489c
63489c
* Tue Mar 14 2017 Miroslav Lichvar <mlichvar@redhat.com> 1.8-2
63489c
- force BMC election when link goes down
63489c
63489c
* Tue Feb 07 2017 Miroslav Lichvar <mlichvar@redhat.com> 1.8-1
63489c
- update to 1.8 (#1359311 #1353336)
63489c
996523
* Tue Nov 25 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.4-3.20140718gitbdb6a3
996523
- fix resetting of linreg servo (#1165045)
996523
- fix phc2sys automatic mode with multiple interfaces (#1108795)
996523
996523
* Tue Oct 14 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.4-2.20140718gitbdb6a3
996523
- add timemaster (#1085580)
996523
- send peer messages to correct address
996523
- make NTP SHM segment number configurable
996523
- update UDS handling to allow running multiple ptp4l/phc2sys instances
996523
- fix warnings from static analysis
996523
996523
* Wed Sep 03 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.4-1.20140718gitbdb6a3
996523
- update to 20140718gitbdb6a3 (#1108795, #1059039)
996523
- fix PIE linking (#1092537)
996523
- replace hardening build flags with _hardened_build
996523
- include simulation test suite
996523
5b5807
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.3-3
5b5807
- Mass rebuild 2014-01-24
5b5807
5b5807
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.3-2
5b5807
- Mass rebuild 2013-12-27
5b5807
84a7e2
* Fri Aug 02 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3-1
84a7e2
- update to 1.3
84a7e2
84a7e2
* Tue Jul 30 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-3.20130730git7789f0
84a7e2
- update to 20130730git7789f0
84a7e2
84a7e2
* Fri Jul 19 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-2.20130719git46db40
84a7e2
- update to 20130719git46db40
84a7e2
- drop old systemd scriptlets
84a7e2
- add man page link for ptp4l.conf
84a7e2
84a7e2
* Mon Apr 22 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-1
84a7e2
- update to 1.2
84a7e2
84a7e2
* Mon Feb 18 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.1-1
84a7e2
- update to 1.1
84a7e2
- log phc2sys output
84a7e2
84a7e2
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
84a7e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
84a7e2
84a7e2
* Thu Dec 13 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.0-1
84a7e2
- update to 1.0
84a7e2
84a7e2
* Fri Nov 09 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.3.20121109git4e8107
84a7e2
- update to 20121109git4e8107
84a7e2
- install unchanged default.cfg as ptp4l.conf
84a7e2
- drop conflicts from phc2sys service
84a7e2
84a7e2
* Fri Sep 21 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.2.20120920git6ce135
84a7e2
- fix issues found in package review (#859193)
84a7e2
84a7e2
* Thu Sep 20 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.1.20120920git6ce135
84a7e2
- initial release