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