--- /dev/null
+Name: libbpf
+Summary: Libbpf library
+Version: 0.2.0
+Release: 1
+Group: System/Network
+License: LGPL-2.1+ or BSD-2-Clause
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: pkgconfig(libelf)
+BuildRequires: cmake
+
+# This package supersedes libbpf from kernel-tools,
+# which has default Epoch: 0. By having Epoch: > 0
+# this libbpf will take over smoothly
+Epoch: 2
+
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
+%description
+A mirror of bpf-next linux tree bpf-next/tools/lib/bpf directory plus its
+supporting header files. The version of the package reflects the version of
+ABI.
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name} = 2:%{version}-%{release}
+Requires: kernel-headers >= 5.14.0
+Requires: zlib
+
+%description devel
+The %{name}-devel package contains libraries header files for
+developing applications that use %{name}
+
+%package static
+Summary: Static library for libbpf development
+Requires: %{name}-devel = 2:%{version}-%{release}
+
+%description static
+The %{name}-static package contains static library for
+developing applications that use %{name}
+
+%prep
+%setup -q
+
+%build
+%ifarch aarch64
+make -C ./src __aarch64__=1
+%else
+make -C ./src __arm__=1
+%endif
+
+%install
+make -C ./src install DESTDIR=%{buildroot} INSTALL_DIR=%{buildroot}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%license LICENSE LICENSE.BSD-2-Clause LICENSE.LGPL-2.1
+%{_libdir}/libbpf.so.%{version}
+%{_libdir}/libbpf.so.0
+
+%files devel
+%{_libdir}/libbpf.so
+%{_includedir}/bpf/
+%{_libdir}/pkgconfig/libbpf.pc
+
+%files static
+%{_libdir}/libbpf.a