dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone
63054e
%global _hardened_build 1
c547f6
%global testsuite_ver c66922
c547f6
%global clknetsim_ver ce3c4a
63054e
63054e
Name:		linuxptp
c547f6
Version:	3.1.1
ac0718
Release:	3%{?dist}
63054e
Summary:	PTP implementation for Linux
63054e
63054e
Group:		System Environment/Base
63054e
License:	GPLv2+
63054e
URL:		http://linuxptp.sourceforge.net/
63054e
63054e
Source0:	https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
63054e
Source1:	phc2sys.service
63054e
Source2:	ptp4l.service
63054e
Source3:	timemaster.service
63054e
Source4:	timemaster.conf
63054e
# external test suite
63054e
Source10:	https://github.com/mlichvar/linuxptp-testsuite/archive/%{testsuite_ver}/linuxptp-testsuite-%{testsuite_ver}.tar.gz
63054e
# simulator for test suite
63054e
Source11:	https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz
63054e
c547f6
# don't repeat some log messages in multi-port configuration
c547f6
Patch1:		linuxptp-logmsgs.patch
c547f6
# add option to set clockClass threshold
c547f6
Patch2:		linuxptp-classthreshold.patch
c547f6
# increase default TX timestamp timeout to 10 ms
c547f6
Patch3:		linuxptp-deftxtout.patch
63054e
# limit unicast message rate per address and grant duration
63054e
Patch4:		linuxptp-ucastrate.patch
c547f6
# add read-only UDS port
c547f6
Patch5:		linuxptp-udsro.patch
c547f6
# fix quoting in ptp4l man page
c547f6
Patch7:		linuxptp-manfix.patch
c547f6
# close lstab file after use
c547f6
Patch8:		linuxptp-fclose.patch
0c2424
# fix handling of zero-length messages
0c2424
Patch9:		linuxptp-zerolength.patch
df976e
# make sanity clock check more reliable
df976e
Patch10:	linuxptp-clockcheck.patch
ac0718
# handle PHC read failing with EBUSY in phc2sys
ac0718
Patch11:	linuxptp-phcerr.patch
63054e
63054e
BuildRequires:	kernel-headers > 4.18.0-87
63054e
BuildRequires:	systemd
63054e
63054e
%{?systemd_requires}
63054e
63054e
%description
63054e
This software is an implementation of the Precision Time Protocol (PTP)
63054e
according to IEEE standard 1588 for Linux. The dual design goals are to provide
63054e
a robust implementation of the standard and to use the most relevant and modern
63054e
Application Programming Interfaces (API) offered by the Linux kernel.
63054e
Supporting legacy APIs and other platforms is not a goal.
63054e
63054e
%prep
63054e
%setup -q -a 10 -a 11 -n %{name}-%{!?gitfullver:%{version}}%{?gitfullver}
c547f6
%patch1 -p1 -b .logmsgs
c547f6
%patch2 -p1 -b .classthreshold
c547f6
%patch3 -p1 -b .deftxtout
63054e
%patch4 -p1 -b .ucastrate
c547f6
%patch5 -p1 -b .udsro
c547f6
%patch7 -p1 -b .manfix
c547f6
%patch8 -p1 -b .fclose
0c2424
%patch9 -p1 -b .zerolength
df976e
%patch10 -p1 -b .clockcheck
ac0718
%patch11 -p1 -b .phcerr
63054e
mv linuxptp-testsuite-%{testsuite_ver}* testsuite
63054e
mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim
63054e
63054e
%build
63054e
make %{?_smp_mflags} \
63054e
	EXTRA_CFLAGS="$RPM_OPT_FLAGS" \
63054e
	EXTRA_LDFLAGS="$RPM_LD_FLAGS"
63054e
63054e
%install
63054e
%makeinstall
63054e
63054e
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir},%{_mandir}/man5}
63054e
install -m 644 -p configs/default.cfg $RPM_BUILD_ROOT%{_sysconfdir}/ptp4l.conf
63054e
install -m 644 -p %{SOURCE1} %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}
63054e
install -m 644 -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}
63054e
63054e
echo 'OPTIONS="-f /etc/ptp4l.conf -i eth0"' > \
63054e
	$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l
63054e
echo 'OPTIONS="-a -r"' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/phc2sys
63054e
63054e
echo '.so man8/ptp4l.8' > $RPM_BUILD_ROOT%{_mandir}/man5/ptp4l.conf.5
63054e
echo '.so man8/timemaster.8' > $RPM_BUILD_ROOT%{_mandir}/man5/timemaster.conf.5
63054e
c547f6
# Remove patch backup files and non-linuxptp configuration
c547f6
find configs -type f ! -name '*.cfg' -delete
c547f6
63054e
%check
63054e
cd testsuite
63054e
# set random seed to get deterministic results
63054e
export CLKNETSIM_RANDOM_SEED=26743
63054e
make %{?_smp_mflags} -C clknetsim
63054e
PATH=..:$PATH ./run
63054e
63054e
%post
63054e
%systemd_post phc2sys.service ptp4l.service timemaster.service
63054e
63054e
%preun
63054e
%systemd_preun phc2sys.service ptp4l.service timemaster.service
63054e
63054e
%postun
63054e
%systemd_postun_with_restart phc2sys.service ptp4l.service timemaster.service
63054e
63054e
%files
63054e
%doc COPYING README.org configs
63054e
%config(noreplace) %{_sysconfdir}/ptp4l.conf
63054e
%config(noreplace) %{_sysconfdir}/sysconfig/phc2sys
63054e
%config(noreplace) %{_sysconfdir}/sysconfig/ptp4l
63054e
%config(noreplace) %{_sysconfdir}/timemaster.conf
63054e
%{_unitdir}/phc2sys.service
63054e
%{_unitdir}/ptp4l.service
63054e
%{_unitdir}/timemaster.service
63054e
%{_sbindir}/hwstamp_ctl
63054e
%{_sbindir}/nsm
63054e
%{_sbindir}/phc2sys
63054e
%{_sbindir}/phc_ctl
63054e
%{_sbindir}/pmc
63054e
%{_sbindir}/ptp4l
63054e
%{_sbindir}/timemaster
c547f6
%{_sbindir}/ts2phc
63054e
%{_mandir}/man5/*.5*
63054e
%{_mandir}/man8/*.8*
63054e
63054e
%changelog
ac0718
* Wed Jun 29 2022 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-3
ac0718
- handle PHC read failing with EBUSY in phc2sys (#2079129)
ac0718
df976e
* Mon Nov 01 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-2
df976e
- make sanity clock check more reliable (#2007281)
df976e
c547f6
* Mon Jul 26 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-1
c547f6
- update to 3.1.1 (#1895005 CVE-2021-3571)
c547f6
- add read-only UDS port (#1929797)
c547f6
- add option to set clockClass threshold (#1980386)
c547f6
- don't repeat some log messages in multi-port configuration (#1980377)
c547f6
- increase default TX timestamp timeout to 10 ms (#1977136)
c547f6
c547f6
* Thu Jun 24 2021 Miroslav Lichvar <mlichvar@redhat.com> 2.0-5.el8_4.1
c547f6
- validate length of forwarded messages (CVE-2021-3570)
c547f6
0c2424
* Mon Apr 27 2020 Miroslav Lichvar <mlichvar@redhat.com> 2.0-5
0c2424
- fix sample timestamps when synchronizing PHC to system clock (#1787376)
0c2424
- fix handling of zero-length messages (#1827275)
0c2424
63054e
* Thu May 16 2019 Miroslav Lichvar <mlichvar@redhat.com> 2.0-4
63054e
- rebuild with enabled gating (#1680888)
63054e
63054e
* Wed May 15 2019 Miroslav Lichvar <mlichvar@redhat.com> 2.0-3
63054e
- add support for active-backup team interface (#1685467)
63054e
- add support for more accurate synchronization to phc2sys (#1677217)
63054e
- add hwts_filter option to ptp4l (#1708554)
63054e
- limit unicast message rate per address and grant duration (#1707395)
63054e
- fix comparing of unicast addresses (#1707395)
63054e
- fix building with new kernel headers (#1707395)
63054e
- update testsuite (#1707395)
63054e
- don't leak memory when allocation fails (#1707395)
63054e
63054e
* Tue Nov 13 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-2
63054e
- start ptp4l, timemaster and phc2sys after network-online target (#1632282)
63054e
63054e
* Mon Aug 13 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-1
63054e
- update to 2.0 (#1614300)
63054e
63054e
* Mon Apr 09 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.9.2-1
63054e
- update to 1.9.2
63054e
63054e
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-7.20180101git303b08
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
63054e
63054e
* Tue Jan 30 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-6.20180101git303b08
63054e
- use macro for systemd scriptlet dependencies
63054e
63054e
* Thu Jan 11 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-5.20180101git303b08
63054e
- update to 20180101git303b08
63054e
63054e
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-4
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
63054e
63054e
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
63054e
63054e
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-2
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
63054e
63054e
* Mon Nov 07 2016 Miroslav Lichvar <mlichvar@redhat.com> 1.8-1
63054e
- update to 1.8
63054e
63054e
* Fri Jul 22 2016 Miroslav Lichvar <mlichvar@redhat.com> 1.7-1
63054e
- update to 1.7
63054e
- add delay option to default timemaster.conf
63054e
63054e
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-2
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
63054e
63054e
* Tue Sep 22 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.6-1
63054e
- update to 1.6
63054e
- set random seed in testing to get deterministic results
63054e
- remove trailing whitespace in default timemaster.conf
63054e
63054e
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
63054e
63054e
* Mon Jan 05 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.5-1
63054e
- update to 1.5
63054e
63054e
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
63054e
63054e
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
63054e
63054e
* Fri Feb 21 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.4-1
63054e
- update to 1.4
63054e
- replace hardening build flags with _hardened_build
63054e
- include test suite
63054e
63054e
* Fri Aug 02 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3-1
63054e
- update to 1.3
63054e
63054e
* Tue Jul 30 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-3.20130730git7789f0
63054e
- update to 20130730git7789f0
63054e
63054e
* Fri Jul 19 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-2.20130719git46db40
63054e
- update to 20130719git46db40
63054e
- drop old systemd scriptlets
63054e
- add man page link for ptp4l.conf
63054e
63054e
* Mon Apr 22 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-1
63054e
- update to 1.2
63054e
63054e
* Mon Feb 18 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.1-1
63054e
- update to 1.1
63054e
- log phc2sys output
63054e
63054e
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
63054e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
63054e
63054e
* Thu Dec 13 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.0-1
63054e
- update to 1.0
63054e
63054e
* Fri Nov 09 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.3.20121109git4e8107
63054e
- update to 20121109git4e8107
63054e
- install unchanged default.cfg as ptp4l.conf
63054e
- drop conflicts from phc2sys service
63054e
63054e
* Fri Sep 21 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.2.20120920git6ce135
63054e
- fix issues found in package review (#859193)
63054e
63054e
* Thu Sep 20 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.1.20120920git6ce135
63054e
- initial release