linuxptp/linuxptp.spec

302 lines
9.9 KiB
RPMSpec
Raw Normal View History

%global _hardened_build 1
2020-09-29 09:02:00 +00:00
%global testsuite_ver ff37e2
%global clknetsim_ver c4ccc2
%global selinuxtype targeted
%bcond_without selinux
2012-09-21 13:54:54 +00:00
Name: linuxptp
Version: 3.1.1
2021-07-22 10:51:12 +00:00
Release: 2%{?dist}
2012-09-21 13:54:54 +00:00
Summary: PTP implementation for Linux
License: GPLv2+
URL: http://linuxptp.sourceforge.net/
2020-07-27 14:12:19 +00:00
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
2012-09-21 13:54:54 +00:00
Source1: phc2sys.service
Source2: ptp4l.service
2015-01-05 10:13:44 +00:00
Source3: timemaster.service
Source4: timemaster.conf
Source5: ptp4l.conf
2015-01-05 10:13:44 +00:00
# external test suite
Source10: https://github.com/mlichvar/linuxptp-testsuite/archive/%{testsuite_ver}/linuxptp-testsuite-%{testsuite_ver}.tar.gz
# simulator for test suite
Source11: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz
# selinux policy
Source20: linuxptp.fc
Source21: linuxptp.if
Source22: linuxptp.te
2012-09-21 13:54:54 +00:00
2021-02-25 12:19:52 +00:00
# fix handling of zero-length messages
Patch1: linuxptp-zerolength.patch
2021-02-25 12:22:37 +00:00
BuildRequires: gcc gcc-c++ make systemd
2012-09-21 13:54:54 +00:00
%{?systemd_requires}
2012-09-21 13:54:54 +00:00
%if 0%{?with_selinux}
Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
%endif
2012-09-21 13:54:54 +00:00
%description
This software is an implementation of the Precision Time Protocol (PTP)
according to IEEE standard 1588 for Linux. The dual design goals are to provide
a robust implementation of the standard and to use the most relevant and modern
Application Programming Interfaces (API) offered by the Linux kernel.
Supporting legacy APIs and other platforms is not a goal.
%if 0%{?with_selinux}
%package selinux
Summary: linuxptp SELinux policy
BuildArch: noarch
Requires: selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-%{selinuxtype}
BuildRequires: selinux-policy-devel
%{?selinux_requires}
%description selinux
linuxptp SELinux policy module
%endif
2012-09-21 13:54:54 +00:00
%prep
2018-01-11 13:54:39 +00:00
%setup -q -a 10 -a 11 -n %{name}-%{!?gitfullver:%{version}}%{?gitfullver}
2021-02-25 12:19:52 +00:00
%patch1 -p1 -b .zerolength
2015-01-05 10:13:44 +00:00
mv linuxptp-testsuite-%{testsuite_ver}* testsuite
mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim
mkdir selinux
cp -p %{SOURCE20} %{SOURCE21} %{SOURCE22} selinux
2012-09-21 13:54:54 +00:00
%build
%{make_build} \
EXTRA_CFLAGS="$RPM_OPT_FLAGS" \
EXTRA_LDFLAGS="$RPM_LD_FLAGS"
2012-09-21 13:54:54 +00:00
%if 0%{?with_selinux}
make -C selinux -f %{_datadir}/selinux/devel/Makefile linuxptp.pp
bzip2 -9 selinux/linuxptp.pp
%endif
2012-09-21 13:54:54 +00:00
%install
2012-11-09 13:37:46 +00:00
%makeinstall
2013-07-19 15:19:15 +00:00
2013-07-19 09:53:47 +00:00
mkdir -p $RPM_BUILD_ROOT{%{_sysconfdir}/sysconfig,%{_unitdir},%{_mandir}/man5}
2015-01-05 10:13:44 +00:00
install -m 644 -p %{SOURCE1} %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}
install -m 644 -p %{SOURCE4} %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}
2012-09-21 13:54:54 +00:00
echo 'OPTIONS="-f /etc/ptp4l.conf"' > \
2012-09-21 13:54:54 +00:00
$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ptp4l
2015-01-05 10:13:44 +00:00
echo 'OPTIONS="-a -r"' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/phc2sys
2012-09-21 13:54:54 +00:00
2013-07-19 09:53:47 +00:00
echo '.so man8/ptp4l.8' > $RPM_BUILD_ROOT%{_mandir}/man5/ptp4l.conf.5
2015-01-05 10:13:44 +00:00
echo '.so man8/timemaster.8' > $RPM_BUILD_ROOT%{_mandir}/man5/timemaster.conf.5
2013-07-19 09:53:47 +00:00
%if 0%{?with_selinux}
install -D -m 0644 selinux/linuxptp.pp.bz2 \
$RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{selinuxtype}/linuxptp.pp.bz2
install -D -p -m 0644 selinux/linuxptp.if \
$RPM_BUILD_ROOT%{_datadir}/selinux/devel/include/distributed/linuxptp.if
%endif
2014-02-21 13:20:50 +00:00
%check
cd testsuite
# set random seed to get deterministic results
export CLKNETSIM_RANDOM_SEED=26743
%{make_build} -C clknetsim
2014-02-21 13:20:50 +00:00
PATH=..:$PATH ./run
2012-09-21 13:54:54 +00:00
%post
2015-01-05 10:13:44 +00:00
%systemd_post phc2sys.service ptp4l.service timemaster.service
2012-09-21 13:54:54 +00:00
%preun
2015-01-05 10:13:44 +00:00
%systemd_preun phc2sys.service ptp4l.service timemaster.service
2012-09-21 13:54:54 +00:00
%postun
2015-01-05 10:13:44 +00:00
%systemd_postun_with_restart phc2sys.service ptp4l.service timemaster.service
2012-09-21 13:54:54 +00:00
%if 0%{?with_selinux}
%pre selinux
%selinux_relabel_pre -s %{selinuxtype}
%post selinux
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/linuxptp.pp.bz2
%selinux_relabel_post -s %{selinuxtype}
%postun selinux
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} linuxptp
%selinux_relabel_post -s %{selinuxtype}
fi
%files selinux
%{_datadir}/selinux/packages/%{selinuxtype}/linuxptp.pp.*
%{_datadir}/selinux/devel/include/distributed/linuxptp.if
%ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/linuxptp
%endif
2012-09-21 13:54:54 +00:00
%files
2018-08-09 14:46:49 +00:00
%doc COPYING README.org configs
2012-09-21 13:54:54 +00:00
%config(noreplace) %{_sysconfdir}/ptp4l.conf
%config(noreplace) %{_sysconfdir}/sysconfig/phc2sys
%config(noreplace) %{_sysconfdir}/sysconfig/ptp4l
2015-01-05 10:13:44 +00:00
%config(noreplace) %{_sysconfdir}/timemaster.conf
2012-09-21 13:54:54 +00:00
%{_unitdir}/phc2sys.service
%{_unitdir}/ptp4l.service
2015-01-05 10:13:44 +00:00
%{_unitdir}/timemaster.service
2012-09-21 13:54:54 +00:00
%{_sbindir}/hwstamp_ctl
2018-04-09 08:31:37 +00:00
%{_sbindir}/nsm
2012-09-21 13:54:54 +00:00
%{_sbindir}/phc2sys
2015-01-05 10:13:44 +00:00
%{_sbindir}/phc_ctl
2012-09-21 13:54:54 +00:00
%{_sbindir}/pmc
%{_sbindir}/ptp4l
2015-01-05 10:13:44 +00:00
%{_sbindir}/timemaster
2020-07-27 14:12:19 +00:00
%{_sbindir}/ts2phc
2013-07-19 09:53:47 +00:00
%{_mandir}/man5/*.5*
2012-11-09 13:37:46 +00:00
%{_mandir}/man8/*.8*
2012-09-21 13:54:54 +00:00
%changelog
2021-07-22 10:51:12 +00:00
* Thu Jul 22 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-2
- package selinux policy
2021-07-07 08:07:29 +00:00
* Wed Jul 07 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1.1-1
- update to 3.1.1 (CVE-2021-3570, CVE-2021-3571)
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.1-4
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
2021-02-25 13:33:00 +00:00
* Thu Feb 25 2021 Miroslav Lichvar <mlichvar@redhat.com> 3.1-3
- fix handling of zero-length messages
- minimize default configuration
- remove obsolete build requirement
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2020-09-29 09:02:57 +00:00
* Tue Sep 29 2020 Miroslav Lichvar <mlichvar@redhat.com> 3.1-1
- update to 3.1
2020-07-27 14:19:59 +00:00
* Mon Jul 27 2020 Miroslav Lichvar <mlichvar@redhat.com> 3.0-1
- update to 3.0
2020-02-03 10:01:18 +00:00
* Mon Feb 03 2020 Miroslav Lichvar <mlichvar@redhat.com> 2.0-7.20191225gite05809
- update to 20191225gite05809
- fix testing with new glibc
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-6.20190912git48e605
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2019-09-25 13:13:24 +00:00
* Wed Sep 25 2019 Miroslav Lichvar <mlichvar@redhat.com> 2.0-5.20190912git48e605
- update to 20190912git48e605
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
2018-11-13 11:25:08 +00:00
* Tue Nov 13 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-2
- start ptp4l, timemaster and phc2sys after network-online target
2018-11-13 12:02:28 +00:00
- fix building with new kernel headers
2018-11-13 11:25:08 +00:00
2018-08-13 08:54:02 +00:00
* Mon Aug 13 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-1
- update to 2.0
2018-08-09 14:49:32 +00:00
* Thu Aug 09 2018 Miroslav Lichvar <mlichvar@redhat.com> 2.0-0.1.20180805gita27407
- update to 20180805gita27407
2018-07-16 14:08:53 +00:00
* Mon Jul 16 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.9.2-3
- add gcc and gcc-c++ to build requirements
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2018-04-09 08:32:02 +00:00
* Mon Apr 09 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.9.2-1
- update to 1.9.2
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-7.20180101git303b08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2018-01-30 10:49:04 +00:00
* Tue Jan 30 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-6.20180101git303b08
- use macro for systemd scriptlet dependencies
2018-01-11 13:57:03 +00:00
* Thu Jan 11 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.8-5.20180101git303b08
- update to 20180101git303b08
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2016-11-07 11:36:46 +00:00
* Mon Nov 07 2016 Miroslav Lichvar <mlichvar@redhat.com> 1.8-1
- update to 1.8
2016-07-22 07:59:26 +00:00
* Fri Jul 22 2016 Miroslav Lichvar <mlichvar@redhat.com> 1.7-1
- update to 1.7
- add delay option to default timemaster.conf
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
2015-09-22 08:57:27 +00:00
* Tue Sep 22 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.6-1
- update to 1.6
- set random seed in testing to get deterministic results
- remove trailing whitespace in default timemaster.conf
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
2015-01-05 10:28:47 +00:00
* Mon Jan 05 2015 Miroslav Lichvar <mlichvar@redhat.com> 1.5-1
- update to 1.5
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2014-02-21 13:23:55 +00:00
* Fri Feb 21 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.4-1
- update to 1.4
- replace hardening build flags with _hardened_build
- include test suite
2013-08-02 12:12:21 +00:00
* Fri Aug 02 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3-1
- update to 1.3
2013-07-30 13:33:59 +00:00
* Tue Jul 30 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-3.20130730git7789f0
- update to 20130730git7789f0
2013-07-19 11:26:52 +00:00
* Fri Jul 19 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-2.20130719git46db40
- update to 20130719git46db40
- drop old systemd scriptlets
- add man page link for ptp4l.conf
2013-04-22 09:39:14 +00:00
* Mon Apr 22 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.2-1
- update to 1.2
2013-02-18 12:21:24 +00:00
* Mon Feb 18 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.1-1
- update to 1.1
- log phc2sys output
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2012-12-13 18:11:09 +00:00
* Thu Dec 13 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.0-1
- update to 1.0
2012-11-09 14:27:35 +00:00
* Fri Nov 09 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.3.20121109git4e8107
- update to 20121109git4e8107
- install unchanged default.cfg as ptp4l.conf
- drop conflicts from phc2sys service
2012-09-21 13:54:54 +00:00
* Fri Sep 21 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.2.20120920git6ce135
- fix issues found in package review (#859193)
* Thu Sep 20 2012 Miroslav Lichvar <mlichvar@redhat.com> 0-0.1.20120920git6ce135
- initial release