From b3093f5dcf8a774488e7a78119bbcd678028d9aa Mon Sep 17 00:00:00 2001 From: Niraj Kumar Goit Date: Wed, 22 Dec 2021 12:04:46 +0530 Subject: [PATCH] Build for Tizen platform Change-Id: Ie240fa38ebcd8b2f9ece7d91f5d3202bb821247e Signed-off-by: Niraj Kumar Goit --- libbpf.manifest | 5 ++++ packaging/libbpf.spec | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100755 libbpf.manifest create mode 100755 packaging/libbpf.spec diff --git a/libbpf.manifest b/libbpf.manifest new file mode 100755 index 0000000..97e8c31 --- /dev/null +++ b/libbpf.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/libbpf.spec b/packaging/libbpf.spec new file mode 100755 index 0000000..9f0013a --- /dev/null +++ b/packaging/libbpf.spec @@ -0,0 +1,71 @@ +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 -- 2.7.4