dcavalca / rpms / linuxptp

Forked from rpms/linuxptp 2 years ago
Clone
63054e
%global _hardened_build 1
63054e
%global testsuite_ver a7f6e1
63054e
%global clknetsim_ver 8b4842
63054e
63054e
Name:		linuxptp
63054e
Version:	2.0
63054e
Release:	4%{?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
63054e
# fix building with new kernel headers
63054e
Patch1:		linuxptp-headers.patch
63054e
# fix timeout handling to work with simulated clock
63054e
Patch2:		linuxptp-timeout.patch
63054e
# add support for more accurate synchronization to phc2sys
63054e
Patch3:		linuxptp-sysoff.patch
63054e
# limit unicast message rate per address and grant duration
63054e
Patch4:		linuxptp-ucastrate.patch
63054e
# add support for active-backup team interface
63054e
Patch5:		linuxptp-team.patch
63054e
# fix comparing of unicast addresses
63054e
Patch6:		linuxptp-addreq.patch
63054e
# don't leak memory when allocation fails
63054e
Patch7:		linuxptp-msgput.patch
63054e
# add hwts_filter option to ptp4l
63054e
Patch8:		linuxptp-hwtsfilter.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}
63054e
%patch1 -p1 -b .headers
63054e
%patch2 -p1 -b .timeout
63054e
%patch3 -p1 -b .sysoff
63054e
%patch4 -p1 -b .ucastrate
63054e
%patch5 -p1 -b .team
63054e
%patch6 -p1 -b .addreq
63054e
%patch7 -p1 -b .msgput
63054e
%patch8 -p1 -b .hwtsfilter
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
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
63054e
%{_mandir}/man5/*.5*
63054e
%{_mandir}/man8/*.8*
63054e
63054e
%changelog
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