File odp.spec of Package odp

# spec file for package odp
# Copyright (c) 2018 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

Name:           odp
Release:        0
Summary:        OpenDataPlane Reference implementation
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
Patch0:         0001-increase_ODP_CPUMASK_SIZE.patch
%if %{suse_version} >= 1330
Patch1:         0002-fix_libopenssl.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  doxygen
%if %{suse_version} >= 1330
BuildRequires:  gcc
BuildRequires:  gcc6
BuildRequires:  graphviz
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(openssl)
Conflicts:      otherproviders(odp-any)
Provides:       odp-any = %{version}
ExclusiveArch:  aarch64 x86_64 ppc64 ppc64le

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:       libopenssl-devel
Conflicts:      otherproviders(odp-any-devel)
Provides:       odp-any-devel = %{version}

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

%setup -q -n odp-
# 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}], [])|"
%if %{suse_version} >= 1330

%if %{suse_version} >= 1330
export CFLAGS="%{optflags} -Wformat-overflow=0 -Wimplicit-fallthrough=0 -Wformat-truncation=0 -latomic"
export CFLAGS="%{optflags}"
%configure --disable-static

%if %{suse_version} >= 1330
make V=1 DESTDIR=%{buildroot} %{?_smp_mflags} 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_*

%files libs

%files devel

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

openSUSE Build Service is sponsored by