Sophie

Sophie

distrib > Mageia > cauldron > x86_64 > by-pkgid > 75da87d7585ea8d93a810df4528c20c7 > files > 4

xdp-tools-1.4.2-1.mga10.src.rpm

%global major 1
%define libname %mklibname xdp %major
%define devname %mklibname -d xdp
%define staticname %mklibname -d -s xdpo

# gnu strip fails to recognize and strip some of current object files, use llvm-strip instead
%global __strip %_bindir/llvm-strip

Name:             xdp-tools
Version:          1.4.2
Release:          %mkrel 1
Summary:          Utilities and example programs for use with XDP
%global _soversion 1.4.0
Group:            System/Base
License:          GPL-2.0-only
URL:              https://github.com/xdp-project/%{name}
Source0:          https://github.com/xdp-project/%{name}/releases/download/v%{version}/xdp-tools-%{version}.tar.gz

# from git upstream
Patch0:           0001-make-remove-lib-testing-test-tool-on-clean.patch
Patch1:           0002-make-remove-.ll-when-clean-has-local-override.patch

BuildRequires:    pkgconfig(libbpf)
BuildRequires:    elfutils-devel
BuildRequires:    zlib-devel
BuildRequires:    libpcap-devel
BuildRequires:    clang >= 10.0.0
BuildRequires:    llvm >= 10.0.0
BuildRequires:    make
BuildRequires:    gcc
BuildRequires:    pkgconfig
BuildRequires:    m4
BuildRequires:    emacs-nox
BuildRequires:    wireshark

BuildRequires:    bpftool

# Always keep xdp-tools and libxdp packages in sync
Requires:         %libname = %{version}-%{release}

# find-debuginfo produces empty debugsourcefiles.list
# disable the debug package to avoid rpmbuild error'ing out because of this
%global debug_package %{nil}
%global _hardened_build 1

%description
Utilities and example programs for use with XDP

%package -n %libname
Summary:          XDP helper library
License:          LGPL-2.1-only OR BSD-2-Clause
Requires:         kernel-headers

%package -n %devname
Summary:          Development files for libxdp
License:          LGPL-2.1-only OR BSD-2-Clause
Requires:         kernel-headers
Requires:         %libname = %{version}-%{release}
Provides:	  libxdp-devel = %{version}-%{release}

%package -n %staticname
Summary:          Static library files for libxdp
License:          LGPL-2.1-only OR BSD-2-Clause
Requires:         kernel-headers
Requires:         %devname = %{version}-%{release}

%description -n %libname
The libxdp package contains the libxdp library for managing XDP programs,
used by the %{name} package

%description -n %devname
The %devname package contains headers used for building XDP programs using
libxdp.

%description -n %staticname
The %staticname package contains the static library version of libxdp.

%prep
%autosetup -p1 -n %{name}-%{version}


%build
export CFLAGS='%{build_cflags}'
export LDFLAGS='%{build_ldflags}'
export LIBDIR='%{_libdir}'
export RUNDIR='%{_rundir}'
export CLANG=%{_bindir}/clang
export LLC=%{_bindir}/llc
export PRODUCTION=1
export DYNAMIC_LIBXDP=1
export FORCE_SYSTEM_LIBBPF=1
export FORCE_EMACS=1
./configure
%make_build V=1

%install
export DESTDIR='%{buildroot}'
export SBINDIR='%{_sbindir}'
export LIBDIR='%{_libdir}'
export RUNDIR='%{_rundir}'
export MANDIR='%{_mandir}'
export DATADIR='%{_datadir}'
export HDRDIR='%{_includedir}/xdp'
make install V=1

%files
%{_sbindir}/xdp-filter
%{_sbindir}/xdp-loader
%{_sbindir}/xdpdump
%ifnarch i686
%{_sbindir}/xdp-bench
%{_sbindir}/xdp-monitor
%{_sbindir}/xdp-trafficgen
%endif
%{_mandir}/man8/*
%{_libdir}/bpf/xdpfilt_*.o
%{_libdir}/bpf/xdpdump_*.o
%{_datadir}/xdp-tools/
%license LICENSES/*

%files -n %libname
%{_libdir}/libxdp.so.%major
%{_libdir}/libxdp.so.%{_soversion}
%{_libdir}/bpf/xdp-dispatcher.o
%{_libdir}/bpf/xsk_def_xdp_prog*.o
%{_mandir}/man3/*
%license LICENSES/*

%files -n %staticname
%{_libdir}/libxdp.a

%files -n %devname
%{_includedir}/xdp/*.h
%{_libdir}/libxdp.so
%{_libdir}/pkgconfig/libxdp.pc



%changelog
* Tue Feb 20 2024 ghibo <ghibo> 1.4.2-1.mga10
+ Revision: 2042662
- Update to release 1.4.2.
- Use llvm-strip instead of GNU strip as it fails to recognize some of current object files.
- Merge two patches from git upstream.

* Sat Dec 09 2023 tv <tv> 1.4.1-1.mga10
+ Revision: 2016217
- imported package xdp-tools


* Sat Dec 09 2023 Thierry Vignaud <tv@mageia.org> 1.4.1-1.mga10
- Import from FC