2023-07-31 19:42:40 +08:00
|
|
|
Name: Kmesh
|
|
|
|
|
Version: 0.3.0
|
2023-08-17 22:10:20 +08:00
|
|
|
Release: 3
|
2023-07-31 19:42:40 +08:00
|
|
|
Summary: %{name} is a eBPF-based service mesh kernel solution
|
2023-08-17 22:10:20 +08:00
|
|
|
License: ASL 2.0 and GPL-2.0
|
2023-07-31 19:42:40 +08:00
|
|
|
URL: https://gitee.com/openeuler/%{name}
|
2023-08-17 22:10:20 +08:00
|
|
|
Source0: https://gitee.com/openeuler/%{name}/archive/refs/tags/%{version}.tar.gz
|
2023-07-31 19:42:40 +08:00
|
|
|
|
2023-08-17 16:24:46 +08:00
|
|
|
BuildRequires: cmake make pkgconf dracut
|
2023-07-31 19:42:40 +08:00
|
|
|
BuildRequires: protobuf protobuf-c protobuf-c-devel
|
|
|
|
|
BuildRequires: golang >= 1.16
|
|
|
|
|
BuildRequires: clang >= 10.0.1 llvm >= 10.0.1
|
|
|
|
|
BuildRequires: libbpf-devel kernel-devel >= 5.10
|
|
|
|
|
BuildRequires: libboundscheck
|
|
|
|
|
BuildRequires: uname-build-checks
|
|
|
|
|
|
|
|
|
|
Requires: bpftool
|
|
|
|
|
Requires: libbpf
|
|
|
|
|
Requires: libboundscheck
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
%{name} is a eBPF-based service mesh kernel solution.
|
|
|
|
|
|
|
|
|
|
ExclusiveArch: x86_64
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -n %{name}-%{version} -p1
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
cd %{_builddir}/%{name}-%{version}
|
|
|
|
|
./build.sh -b
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/kmesh-daemon %{buildroot}%{_bindir}
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/kmesh-cmd %{buildroot}%{_bindir}
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/build/kmesh-start-pre.sh %{buildroot}%{_bindir}
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/build/kmesh-stop-post.sh %{buildroot}%{_bindir}
|
2023-08-17 22:10:20 +08:00
|
|
|
install %{_builddir}/%{name}-%{version}/oncn-mda/deploy/mdacore %{buildroot}%{_bindir}
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_datarootdir}/oncn-mda
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/oncn-mda/build/ebpf_src/CMakeFiles/sock_ops.dir/sock_ops.c.o %{buildroot}%{_datarootdir}/oncn-mda
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/oncn-mda/build/ebpf_src/CMakeFiles/sock_redirect.dir/sock_redirect.c.o %{buildroot}%{_datarootdir}/oncn-mda
|
2023-07-31 19:42:40 +08:00
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/usr/lib64
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/bpf/deserialization_to_bpf_map/libkmesh_deserial.so %{buildroot}/usr/lib64
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/api/v2-c/libkmesh_api_v2_c.so %{buildroot}/usr/lib64
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/lib/modules/kmesh
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/kernel/ko/kmesh.ko %{buildroot}/lib/modules/kmesh
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/%{_sysconfdir}/kmesh
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/config/kmesh.json %{buildroot}/%{_sysconfdir}/kmesh
|
2023-08-17 22:10:20 +08:00
|
|
|
mkdir -p %{buildroot}/%{_sysconfdir}/oncn-mda
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/oncn-mda/etc/oncn-mda.conf %{buildroot}/%{_sysconfdir}/oncn-mda/
|
2023-07-31 19:42:40 +08:00
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/usr/lib/systemd/system
|
|
|
|
|
install %{_builddir}/%{name}-%{version}/build/kmesh.service %{buildroot}/usr/lib/systemd/system
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
cd %{_builddir}/%{name}-%{version}
|
|
|
|
|
#make
|
|
|
|
|
#make test
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
echo "installing ..."
|
|
|
|
|
ln -sf /lib/modules/kmesh/kmesh.ko /lib/modules/`uname -r`
|
|
|
|
|
depmod -a
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
if [ "$1" == "1" ]; then
|
|
|
|
|
systemctl status kmesh | grep "active (running)"
|
|
|
|
|
if [ "$?" == "0" ]; then
|
|
|
|
|
systemctl restart kmesh.service
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
systemctl stop kmesh.service
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
if [ "$1" -ne "1" ]; then
|
|
|
|
|
rm -rf /lib/modules/`uname -r`/kmesh.ko
|
|
|
|
|
fi
|
|
|
|
|
depmod -a
|
|
|
|
|
|
|
|
|
|
%clean
|
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root)
|
2023-08-17 22:10:20 +08:00
|
|
|
%attr(0500,root,root) %{_bindir}/kmesh-daemon
|
|
|
|
|
%attr(0500,root,root) %{_bindir}/kmesh-cmd
|
|
|
|
|
%attr(0500,root,root) %{_bindir}/mdacore
|
2023-07-31 19:42:40 +08:00
|
|
|
|
|
|
|
|
%attr(0500,root,root) /usr/lib64/libkmesh_deserial.so
|
|
|
|
|
%attr(0500,root,root) /usr/lib64/libkmesh_api_v2_c.so
|
|
|
|
|
|
2023-08-17 22:10:20 +08:00
|
|
|
%attr(0500,root,root) %dir /usr/share/oncn-mda
|
|
|
|
|
%attr(0500,root,root) /usr/share/oncn-mda/sock_ops.c.o
|
|
|
|
|
%attr(0500,root,root) /usr/share/oncn-mda/sock_redirect.c.o
|
2023-07-31 19:42:40 +08:00
|
|
|
|
2023-08-17 22:10:20 +08:00
|
|
|
%attr(0500,root,root) %dir /lib/modules/kmesh
|
|
|
|
|
%attr(0400,root,root) /lib/modules/kmesh/kmesh.ko
|
|
|
|
|
|
|
|
|
|
%attr(0700,root,root) %dir %{_sysconfdir}/kmesh
|
|
|
|
|
%attr(0700,root,root) %dir %{_sysconfdir}/oncn-mda
|
|
|
|
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/kmesh/kmesh.json
|
|
|
|
|
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/oncn-mda/oncn-mda.conf
|
|
|
|
|
%config(noreplace) %attr(0600,root,root) /usr/lib/systemd/system/kmesh.service
|
|
|
|
|
%attr(0500,root,root) /usr/bin/kmesh-start-pre.sh
|
|
|
|
|
%attr(0500,root,root) /usr/bin/kmesh-stop-post.sh
|
2023-07-31 19:42:40 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2023-08-17 22:10:20 +08:00
|
|
|
* Fri Aug 18 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-3
|
|
|
|
|
- update spec
|
|
|
|
|
|
2023-08-17 16:24:46 +08:00
|
|
|
* Thu Aug 17 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-2
|
|
|
|
|
- update package
|
|
|
|
|
|
2023-07-31 19:42:40 +08:00
|
|
|
* Mon Jul 31 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-1
|
|
|
|
|
- init package
|