dpdk.spec: Package the dpdk tools into the -tools package

Currently, dpdk ships with cpu_layout.py and dpdk_bind_tools.py to
assist with common workflow. Create a tools package which can encompass
these items.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Acked-by: Neil Horman <nhorman@redhat.com>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
Aaron Conole 2015-09-29 14:37:03 -04:00
parent f8c235c907
commit a199da43d0

View File

@ -2,6 +2,8 @@
%bcond_with combined %bcond_with combined
# Add option to build as static libraries (--without shared) # Add option to build as static libraries (--without shared)
%bcond_without shared %bcond_without shared
# Add option to build without tools
%bcond_without tools
Name: dpdk Name: dpdk
Version: 2.1.0 Version: 2.1.0
@ -65,6 +67,16 @@ BuildArch: noarch
%description doc %description doc
API programming documentation for the Data Plane Development Kit. API programming documentation for the Data Plane Development Kit.
%if %{with tools}
%package tools
Summary: Tools for setting up Data Plane Development Kit environment
Requires: %{name} = %{version}-%{release}
Requires: kmod pciutils findutils iproute
%description tools
%{summary}
%endif
%define sdkdir %{_libdir}/%{name}-%{version}-sdk %define sdkdir %{_libdir}/%{name}-%{version}-sdk
%define docdir %{_docdir}/%{name}-%{version} %define docdir %{_docdir}/%{name}-%{version}
@ -114,6 +126,10 @@ ln -s ../../../%{_lib}/%{name}-%{version} %{buildroot}%{sdkdir}/%{target}/lib
ln -s ../../../include/%{name}-%{version} %{buildroot}%{sdkdir}/%{target}/include ln -s ../../../include/%{name}-%{version} %{buildroot}%{sdkdir}/%{target}/include
cp -a mk/ %{buildroot}%{sdkdir} cp -a mk/ %{buildroot}%{sdkdir}
%if %{with tools}
cp -p tools/*.py %{buildroot}%{_bindir}
%endif
# Setup RTE_SDK environment as expected by apps etc # Setup RTE_SDK environment as expected by apps etc
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.sh cat << EOF > %{buildroot}/%{_sysconfdir}/profile.d/dpdk-sdk-%{_arch}.sh
@ -185,6 +201,11 @@ install -m 644 ${comblib} %{buildroot}/%{_libdir}/%{name}-%{version}/${comblib}
%{_libdir}/%{name}-%{version}/*.so %{_libdir}/%{name}-%{version}/*.so
%endif %endif
%if %{with tools}
%files tools
%{_bindir}/*.py
%endif
%changelog %changelog
* Wed Aug 26 2015 Neil Horman <nhorman@redhat.com> - 2.1.0-1 * Wed Aug 26 2015 Neil Horman <nhorman@redhat.com> - 2.1.0-1
- Update to latest version - Update to latest version