代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/Kmesh 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
%global codepath kmesh
Name: Kmesh
Version: 0.4.0
Release: 1
Summary: %{name} is a eBPF-based service mesh kernel solution
License: ASL 2.0 and GPL-2.0
URL: https://github.com/kmesh-net
Source0: https://github.com/kmesh-net/kmesh/releases/tag/v%{version}.tar.gz
BuildRequires: cmake make pkgconf dracut
BuildRequires: protobuf protobuf-c protobuf-c-devel
BuildRequires: golang >= 1.21.4
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
Patch0001: Downgrade-go-version-to-v1.21.4.patch
Patch0002: Remove-useless-tag-in-Makefile.patch
Patch0003: Fix-pod-management-cannot-be-canceled.patch
Patch0004: Support-uid-gid.patch
Patch0005: fix-oncn-mda-don-t-support-use-ipv6-family-in-sockop.patch
Patch0006: remove-libboundscheck-dependency.patch
%description
%{name} is a eBPF-based service mesh kernel solution.
ExclusiveArch: x86_64 aarch64
%prep
%autosetup -n %{codepath}-%{version} -p1
%build
cd %{_builddir}/%{codepath}-%{version}
export GOPROXY=https://repo.huaweicloud.com/repository/goproxy/
export GONOSUMDB=*
export GO111MODULE=on
go mod tidy
./build.sh -b
%install
mkdir -p %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/kmesh-daemon %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/kmesh-cni %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/build/kmesh-start-pre.sh %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/build/kmesh-stop-post.sh %{buildroot}%{_bindir}
install %{_builddir}/%{codepath}-%{version}/oncn-mda/deploy/mdacore %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datarootdir}/oncn-mda
install %{_builddir}/%{codepath}-%{version}/oncn-mda/build/ebpf_src/CMakeFiles/sock_ops.dir/sock_ops.c.o %{buildroot}%{_datarootdir}/oncn-mda
install %{_builddir}/%{codepath}-%{version}/oncn-mda/build/ebpf_src/CMakeFiles/sock_redirect.dir/sock_redirect.c.o %{buildroot}%{_datarootdir}/oncn-mda
mkdir -p %{buildroot}/kmesh
install %{_builddir}/%{codepath}-%{version}/build/docker/start_kmesh.sh %{buildroot}/kmesh
mkdir -p %{buildroot}/usr/lib64
install %{_builddir}/%{codepath}-%{version}/bpf/deserialization_to_bpf_map/libkmesh_deserial.so %{buildroot}/usr/lib64
install %{_builddir}/%{codepath}-%{version}/api/v2-c/libkmesh_api_v2_c.so %{buildroot}/usr/lib64
mkdir -p %{buildroot}/lib/modules/kmesh
if [ -f "%{_builddir}/%{codepath}-%{version}/kernel/ko/kmesh.ko" ]; then
install %{_builddir}/%{codepath}-%{version}/kernel/ko/kmesh.ko %{buildroot}/lib/modules/kmesh
fi
mkdir -p %{buildroot}/%{_sysconfdir}/oncn-mda
install %{_builddir}/%{codepath}-%{version}/oncn-mda/etc/oncn-mda.conf %{buildroot}/%{_sysconfdir}/oncn-mda/
mkdir -p %{buildroot}/usr/lib/systemd/system
install %{_builddir}/%{codepath}-%{version}/build/kmesh.service %{buildroot}/usr/lib/systemd/system
%check
cd %{_builddir}/%{codepath}-%{version}
#make
#make test
%post
echo "installing ..."
if [ -f "/lib/modules/kmesh/kmesh.ko" ]; then
ln -sf /lib/modules/kmesh/kmesh.ko /lib/modules/`uname -r`
depmod -a
fi
%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)
%attr(0500,root,root) %{_bindir}/kmesh-daemon
%attr(0500,root,root) %{_bindir}/kmesh-cni
%attr(0500,root,root) %{_bindir}/mdacore
%attr(0500,root,root) /usr/lib64/libkmesh_deserial.so
%attr(0500,root,root) /usr/lib64/libkmesh_api_v2_c.so
%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
%attr(0700,root,root) %dir %{_sysconfdir}/oncn-mda
%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
%attr(0500,root,root) /kmesh/start_kmesh.sh
%changelog
* Mon Jul 29 2024 weli-l<1289113577@qq.com> - 0.4.0-1
- init Kmesh 0.4.0
* Fri Aug 18 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-3
- update spec
* Thu Aug 17 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-2
- update package
* Mon Jul 31 2023 JofDiamonds <kwb0523@163.com> - 0.3.0-1
- init package
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。