File odp.spec of Package odp

#
# spec file for package odp
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           odp
Version:        1.11.0.0
Release:        0
Summary:        OpenDataPlane Reference implementation
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
Url:            https://www.opendataplane.org
Source0:        https://git.linaro.org/lng/odp.git/snapshot/odp-1.11.0.0_monarch.tar.gz
Patch1:         0001-increase_ODP_CPUMASK_SIZE.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  chrpath
BuildRequires:  doxygen
BuildRequires:  gcc6
BuildRequires:  graphviz
BuildRequires:  libopenssl-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig
Conflicts:      otherproviders(odp-any)
Provides:       odp-any = %{version}
ExclusiveArch:  aarch64 x86_64 ppc64 ppc64le

%description
The OpenDataPlane reference implementation library, development files
and examples for the ThunderX platform.

%package libs
Summary:        OpenDataPlane Reference implementation
Group:          System/Libraries
Conflicts:      otherproviders(odp-any-libs)
Provides:       odp-any-libs = %{version}

%description libs
Reference implementation for OpenDataPlane (ODP).
The ODP project is a set of APIs for the networking data plane.

%package devel
Summary:        Development files for the OpenDataPlane reference implementation
Group:          Development/Libraries/C and C++
Requires:       %{name}-libs = %{version}-%{release}
Requires:       openssl-devel
Conflicts:      otherproviders(odp-any-devel)
Provides:       odp-any-devel = %{version}

%description devel
This package contains the development files for the OpenDataPlane
reference implementation.

%package example
Summary:        OpenDataPlane Reference examples
Group:          Development/Libraries/C and C++
Requires:       %{name}-libs = %{version}-%{release}
Conflicts:      otherproviders(odp-any-example)
Provides:       odp-any-example = %{version}

%description example
Examples for the OpenDataPlane reference implementation (ODP).
The ODP project is a set of APIs for the networking data plane.

%prep
%setup -q -n odp-1.11.0.0_monarch
# The below command is used to replace the use of git-hash with the version of the source code
sed -i "s|^AC_INIT.*|AC_INIT([OpenDataPlane], [%{version}], [lng-odp@lists.linaro.org])|" configure.ac
%patch1

%build
export CFLAGS="%{optflags} -O3"
./bootstrap
%configure --disable-static

%install
make V=1 CC=gcc-6 DESTDIR=%{buildroot} %{?_smp_mflags} install
find %{buildroot} -type f -name 'libodp*.la' |xargs rm -f
rm -f %{buildroot}%{_bindir}/odp_ipsec_run*
chrpath -k -d %{buildroot}%{_bindir}/*

%files libs
%defattr(-,root,root)
%doc LICENSE README CHANGELOG
%{_libdir}/libodp*.so.*

%files example
%defattr(-,root,root)
%{_bindir}/*

%files devel
%defattr(-,root,root)
%{_includedir}/odp*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%changelog