dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone
3b72dd
%global _hardened_build 1
3b72dd
%global testsuite_ver c66922
d25bfe
%global clknetsim_ver c63e22
3b72dd
3b72dd
Name:		linuxptp
3b72dd
Version:	3.1.1
d25bfe
Release:	5%{?dist}
3b72dd
Summary:	PTP implementation for Linux
3b72dd
3b72dd
License:	GPLv2+
3b72dd
URL:		http://linuxptp.sourceforge.net/
3b72dd
3b72dd
Source0:	https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
3b72dd
Source1:	phc2sys.service
3b72dd
Source2:	ptp4l.service
3b72dd
Source3:	timemaster.service
3b72dd
Source4:	timemaster.conf
3b72dd
Source5:	ptp4l.conf
3b72dd
# external test suite
3b72dd
Source10:	https://github.com/mlichvar/linuxptp-testsuite/archive/%{testsuite_ver}/linuxptp-testsuite-%{testsuite_ver}.tar.gz
3b72dd
# simulator for test suite
3b72dd
Source11:	https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz
3b72dd
3b72dd
# don't repeat some log messages in multi-port configuration
3b72dd
Patch1:		linuxptp-logmsgs.patch
3b72dd
# add option to set clockClass threshold
3b72dd
Patch2:		linuxptp-classthreshold.patch
3b72dd
# increase default TX timestamp timeout to 10 ms
3b72dd
Patch3:		linuxptp-deftxtout.patch
3b72dd
# limit unicast message rate per address and grant duration
3b72dd
Patch4:		linuxptp-ucastrate.patch
3b72dd
# add read-only UDS port
3b72dd
Patch5:		linuxptp-udsro.patch
3b72dd
# fix quoting in ptp4l man page
3b72dd
Patch7:		linuxptp-manfix.patch
3b72dd
# close lstab file after use
3b72dd
Patch8:		linuxptp-fclose.patch
3b72dd
# fix handling of zero-length messages
3b72dd
Patch9:		linuxptp-zerolength.patch
3b72dd
# avoid unaligned pointers to packed members
3b72dd
Patch10:	linuxptp-packalign.patch
d25bfe
# make sanity clock check more reliable
d25bfe
Patch11:	linuxptp-clockcheck.patch
d25bfe
# add support for virtual clocks
d25bfe
Patch12:	linuxptp-vclock.patch
d25bfe
# handle PHC read failing with EBUSY in phc2sys
d25bfe
Patch13:	linuxptp-phcerr.patch
3b72dd
3b72dd
BuildRequires:	gcc gcc-c++ make systemd
3b72dd
3b72dd
%{?systemd_requires}
3b72dd
3b72dd
%description
3b72dd
This software is an implementation of the Precision Time Protocol (PTP)
3b72dd
according to IEEE standard 1588 for Linux. The dual design goals are to provide
3b72dd
a robust implementation of the standard and to use the most relevant and modern
3b72dd
Application Programming Interfaces (API) offered by the Linux kernel.
3b72dd
Supporting legacy APIs and other platforms is not a goal.
3b72dd
3b72dd
%prep
3b72dd
%setup -q -a 10 -a 11 -n %{name}-%{!?gitfullver:%{version}}%{?gitfullver}
3b72dd
%patch1 -p1 -b .logmsgs
3b72dd
%patch2 -p1 -b .classthreshold
3b72dd
%patch3 -p1 -b .deftxtout
3b72dd
%patch4 -p1 -b .ucastrate
3b72dd
%patch5 -p1 -b .udsro
3b72dd
%patch7 -p1 -b .manfix
3b72dd
%patch8 -p1 -b .fclose
3b72dd
%patch9 -p1 -b .zerolength
3b72dd
%patch10 -p1 -b .packalign
d25bfe
%patch11 -p1 -b .clockcheck
d25bfe
%patch12 -p1 -b .vclock
d25bfe
%patch13 -p1 -b .phcerr
3b72dd
mv linuxptp-testsuite-%{testsuite_ver}* testsuite
3b72dd
mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim
3b72dd
3b72dd
%build
3b72dd
%{make_build} \
3b72dd
	EXTRA_CFLAGS="$RPM_OPT_FLAGS" \
3b72dd
	EXTRA_LDFLAGS="$RPM_LD_FLAGS"
3b72dd
3b72dd
%install
3b72dd
%makeinstall
3b72dd
3b72dd
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir},%{_mandir}/man5}
3b72dd
install -m 644 -p %{SOURCE1} %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}
3b72dd
install -m 644 -p %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}
3b72dd
3b72dd
echo 'OPTIONS="-f /etc/ptp4l.conf"' > \
3b72dd
	$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l
3b72dd
echo 'OPTIONS="-a -r"' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/phc2sys
3b72dd
3b72dd
echo '.so man8/ptp4l.8' > $RPM_BUILD_ROOT%{_mandir}/man5/ptp4l.conf.5
3b72dd
echo '.so man8/timemaster.8' > $RPM_BUILD_ROOT%{_mandir}/man5/timemaster.conf.5
3b72dd
3b72dd
# Remove patch backup files and non-linuxptp configuration
3b72dd
find configs -type f ! -name '*.cfg' -delete
3b72dd
3b72dd
%check
3b72dd
cd testsuite
3b72dd
# set random seed to get deterministic results
3b72dd
export CLKNETSIM_RANDOM_SEED=26743
3b72dd
%{make_build} -C clknetsim
3b72dd
PATH=..:$PATH ./run
3b72dd
3b72dd
%post
3b72dd
%systemd_post phc2sys.service ptp4l.service timemaster.service
3b72dd
3b72dd
%preun
3b72dd
%systemd_preun phc2sys.service ptp4l.service timemaster.service
3b72dd
3b72dd
%postun
3b72dd
%systemd_postun_with_restart phc2sys.service ptp4l.service timemaster.service
3b72dd
3b72dd
%files
3b72dd
%doc COPYING README.org configs
3b72dd
%config(noreplace) %{_sysconfdir}/ptp4l.conf
3b72dd
%config(noreplace) %{_sysconfdir}/sysconfig/phc2sys
3b72dd
%config(noreplace) %{_sysconfdir}/sysconfig/ptp4l
3b72dd
%config(noreplace) %{_sysconfdir}/timemaster.conf
3b72dd
%{_unitdir}/phc2sys.service
3b72dd
%{_unitdir}/ptp4l.service
3b72dd
%{_unitdir}/timemaster.service
3b72dd
%{_sbindir}/hwstamp_ctl
3b72dd
%{_sbindir}/nsm
3b72dd
%{_sbindir}/phc2sys
3b72dd
%{_sbindir}/phc_ctl
3b72dd
%{_sbindir}/pmc
3b72dd
%{_sbindir}/ptp4l
3b72dd
%{_sbindir}/timemaster
3b72dd
%{_sbindir}/ts2phc
3b72dd
%{_mandir}/man5/*.5*
3b72dd
%{_mandir}/man8/*.8*
3b72dd
3b72dd
%changelog
d25bfe
* Thu Jul 28 2022 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-5
d25bfe
- disable PHC switch with vclocks (#2066452)
d25bfe
d25bfe
* Thu Jun 30 2022 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-4
d25bfe
- handle PHC read failing with EBUSY in phc2sys (#2102568)
d25bfe
d25bfe
* Thu Jun 09 2022 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-3
d25bfe
- add support for virtual clocks (#2067310)
d25bfe
- make sanity clock check more reliable (#2079893)
d25bfe
3b72dd
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.1.1-2
3b72dd
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
3b72dd
  Related: rhbz#1991688
3b72dd
3b72dd
* Mon Aug 02 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-1
3b72dd
- update to 3.1.1 (#1979954 CVE-2021-3570 CVE-2021-3571)
3b72dd
- add read-only UDS port
3b72dd
- add option to set clockClass threshold
3b72dd
- don't repeat some log messages in multi-port configuration
3b72dd
- increase default TX timestamp timeout to 10 ms
3b72dd
- limit unicast message rate per address and grant duration
3b72dd
3b72dd
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 3.1-5
3b72dd
- Rebuilt for RHEL 9 BETA for openssl 3.0
3b72dd
  Related: rhbz#1971065
3b72dd
3b72dd
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.1-4
3b72dd
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
3b72dd
3b72dd
* Thu Feb 25 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1-3
3b72dd
- fix handling of zero-length messages
3b72dd
- minimize default configuration
3b72dd
- remove obsolete build requirement
3b72dd
3b72dd
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
3b72dd
3b72dd
* Tue Sep 29 2020 Miroslav Lichvar <mlichvar@redhat.com> 3.1-1
3b72dd
- update to 3.1
3b72dd
3b72dd
* Mon Jul 27 2020 Miroslav Lichvar <mlichvar@redhat.com> 3.0-1
3b72dd
- update to 3.0
3b72dd
3b72dd
* Mon Feb 03 2020 Miroslav Lichvar <mlichvar@redhat.com> 2.0-7.20191225gite05809
3b72dd
- update to 20191225gite05809
3b72dd
- fix testing with new glibc
3b72dd
3b72dd
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-6.20190912git48e605
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
3b72dd
3b72dd
* Wed Sep 25 2019 Miroslav Lichvar <mlichvar@redhat.com> 2.0-5.20190912git48e605
3b72dd
- update to 20190912git48e605
3b72dd
3b72dd
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-4
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
3b72dd
3b72dd
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-3
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
3b72dd
3b72dd
* Tue Nov 13 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-2
3b72dd
- start ptp4l, timemaster and phc2sys after network-online target
3b72dd
- fix building with new kernel headers
3b72dd
3b72dd
* Mon Aug 13 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-1
3b72dd
- update to 2.0
3b72dd
3b72dd
* Thu Aug 09 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-0.1.20180805gita27407
3b72dd
- update to 20180805gita27407
3b72dd
3b72dd
* Mon Jul 16 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.9.2-3
3b72dd
- add gcc and gcc-c++ to build requirements
3b72dd
3b72dd
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.2-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3b72dd
3b72dd
* Mon Apr 09 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.9.2-1
3b72dd
- update to 1.9.2
3b72dd
3b72dd
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-7.20180101git303b08
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3b72dd
3b72dd
* Tue Jan 30 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-6.20180101git303b08
3b72dd
- use macro for systemd scriptlet dependencies
3b72dd
3b72dd
* Thu Jan 11 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-5.20180101git303b08
3b72dd
- update to 20180101git303b08
3b72dd
3b72dd
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-4
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
3b72dd
3b72dd
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3b72dd
3b72dd
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
3b72dd
3b72dd
* Mon Nov 07 2016 Miroslav Lichvar <mlichvar@redhat.com> 1.8-1
3b72dd
- update to 1.8
3b72dd
3b72dd
* Fri Jul 22 2016 Miroslav Lichvar <mlichvar@redhat.com> 1.7-1
3b72dd
- update to 1.7
3b72dd
- add delay option to default timemaster.conf
3b72dd
3b72dd
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3b72dd
3b72dd
* Tue Sep 22 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.6-1
3b72dd
- update to 1.6
3b72dd
- set random seed in testing to get deterministic results
3b72dd
- remove trailing whitespace in default timemaster.conf
3b72dd
3b72dd
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
3b72dd
3b72dd
* Mon Jan 05 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.5-1
3b72dd
- update to 1.5
3b72dd
3b72dd
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
3b72dd
3b72dd
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
3b72dd
3b72dd
* Fri Feb 21 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.4-1
3b72dd
- update to 1.4
3b72dd
- replace hardening build flags with _hardened_build
3b72dd
- include test suite
3b72dd
3b72dd
* Fri Aug 02 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3-1
3b72dd
- update to 1.3
3b72dd
3b72dd
* Tue Jul 30 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-3.20130730git7789f0
3b72dd
- update to 20130730git7789f0
3b72dd
3b72dd
* Fri Jul 19 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-2.20130719git46db40
3b72dd
- update to 20130719git46db40
3b72dd
- drop old systemd scriptlets
3b72dd
- add man page link for ptp4l.conf
3b72dd
3b72dd
* Mon Apr 22 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-1
3b72dd
- update to 1.2
3b72dd
3b72dd
* Mon Feb 18 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.1-1
3b72dd
- update to 1.1
3b72dd
- log phc2sys output
3b72dd
3b72dd
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
3b72dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
3b72dd
3b72dd
* Thu Dec 13 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.0-1
3b72dd
- update to 1.0
3b72dd
3b72dd
* Fri Nov 09 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.3.20121109git4e8107
3b72dd
- update to 20121109git4e8107
3b72dd
- install unchanged default.cfg as ptp4l.conf
3b72dd
- drop conflicts from phc2sys service
3b72dd
3b72dd
* Fri Sep 21 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.2.20120920git6ce135
3b72dd
- fix issues found in package review (#859193)
3b72dd
3b72dd
* Thu Sep 20 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.1.20120920git6ce135
3b72dd
- initial release