Build for Tizen platform
authorNiraj Kumar Goit <niraj.g@samsung.com>
Wed, 22 Dec 2021 06:34:46 +0000 (12:04 +0530)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Fri, 28 Apr 2023 17:59:45 +0000 (19:59 +0200)
Change-Id: Ie240fa38ebcd8b2f9ece7d91f5d3202bb821247e
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
libbpf.manifest [new file with mode: 0644]
packaging/libbpf.spec [new file with mode: 0644]

diff --git a/libbpf.manifest b/libbpf.manifest
new file mode 100644 (file)
index 0000000..97e8c31
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
diff --git a/packaging/libbpf.spec b/packaging/libbpf.spec
new file mode 100644 (file)
index 0000000..9f0013a
--- /dev/null
@@ -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