dcavalca / rpms / linuxptp

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