2024-11-25 06:52:57 +00:00
|
|
|
%global _release 17
|
2024-04-01 16:26:00 +08:00
|
|
|
%bcond isulad 1
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
Name: lxc
|
2023-07-21 02:43:10 +00:00
|
|
|
Version: 5.0.2
|
2019-11-06 19:42:19 +08:00
|
|
|
Release: %{_release}
|
2019-09-30 11:03:07 -04:00
|
|
|
Summary: Linux Containers userspace tools
|
2022-05-17 10:23:46 +08:00
|
|
|
License: LGPLv2+ and GPLv2 and GPLv3
|
2020-07-01 20:18:36 +08:00
|
|
|
URL: https://github.com/lxc/lxc
|
2023-07-21 02:43:10 +00:00
|
|
|
Source0: https://linuxcontainers.org/downloads/lxc/lxc-5.0.2.tar.gz
|
|
|
|
|
|
|
|
|
|
Patch0001: 0001-iSulad-add-json-files-and-adapt-to-meson.patch
|
2023-08-04 07:53:33 +00:00
|
|
|
Patch0002: 0002-iSulad-adapt-security-conf-attach-cgroup-and-start.patch
|
|
|
|
|
Patch0003: 0003-iSulad-adapt-conf-network-storage-and-termianl.patch
|
|
|
|
|
Patch0004: 0004-iSulad-adapt-confile-lxccontainer-and-start.patch
|
|
|
|
|
Patch0005: 0005-fix-compile-error.patch
|
2023-10-24 11:54:26 +00:00
|
|
|
Patch0006: 0006-remove-isulad_cgfsng.patch
|
|
|
|
|
Patch0007: 0007-fix-run-container-failed-when-enable-isulad.patch
|
2023-11-01 16:58:05 +08:00
|
|
|
Patch0008: 0008-bugfix-for-system-container-and-stream.patch
|
2023-12-19 12:38:54 +00:00
|
|
|
Patch0009: 0009-bugfix-about-cgroup-mount-propagation-and-capabiliti.patch
|
2024-01-02 01:13:42 +00:00
|
|
|
Patch0010: 0010-add-storage-block-code-for-embedded-image.patch
|
2024-01-10 06:12:01 +00:00
|
|
|
Patch0011: 0011-skip-setup-console-if-disable-pty-and-fix-syscontain.patch
|
2024-01-23 02:10:34 +00:00
|
|
|
Patch0012: 0012-fix-dev-mount-failed-and-skip-send-recv-devpts_fd-if.patch
|
2024-02-07 06:17:25 +00:00
|
|
|
Patch0013: 0013-ensure-cpuset-cgroup-built-while-writing-cgroup.proc.patch
|
2024-02-08 01:15:17 +00:00
|
|
|
Patch0014: 0014-fix-cpuset-cgroup-error.patch
|
2024-02-22 17:35:53 +08:00
|
|
|
Patch0015: 0015-append-mntopt-to-mntdata-if-not-found-in-mount_opt.patch
|
2024-02-26 11:02:06 +08:00
|
|
|
Patch0016: 0016-unfreeze-freezing-container-and-bugfix-for-files.lim.patch
|
2024-09-15 02:07:29 +08:00
|
|
|
Patch0017: 0017-fix-error-of-cc.compiles-on-aarch.patch
|
2024-11-25 06:52:57 +00:00
|
|
|
Patch0018: 0018-add-fPIC-compile-option.patch
|
2019-09-30 11:03:07 -04:00
|
|
|
|
2019-11-06 19:42:19 +08:00
|
|
|
BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
2019-09-30 11:03:07 -04:00
|
|
|
BuildRequires: pkgconfig(libseccomp)
|
2019-11-06 19:42:19 +08:00
|
|
|
BuildRequires: libcap libcap-devel libselinux-devel yajl yajl-devel
|
2023-07-21 02:43:10 +00:00
|
|
|
BuildRequires: pkgconfig(bash-completion) meson
|
2023-02-22 14:10:37 +08:00
|
|
|
%ifarch riscv64
|
|
|
|
|
BuildRequires: libatomic_ops
|
|
|
|
|
%endif
|
2019-09-30 11:03:07 -04:00
|
|
|
|
2023-07-21 02:43:10 +00:00
|
|
|
Requires: lxc-libs = 5.0.2-%{release}
|
2020-02-14 02:52:10 -05:00
|
|
|
|
|
|
|
|
%package libs
|
|
|
|
|
Summary: Runtime library files for %{name}
|
2021-09-26 07:37:13 -04:00
|
|
|
Requires: rsync libcap libseccomp libselinux
|
2019-09-30 11:03:07 -04:00
|
|
|
Requires(post): systemd
|
|
|
|
|
Requires(preun): systemd
|
|
|
|
|
Requires(postun): systemd
|
|
|
|
|
Requires(post): /sbin/ldconfig
|
|
|
|
|
Requires(postun): /sbin/ldconfig
|
|
|
|
|
|
2020-02-14 02:52:10 -05:00
|
|
|
%description libs
|
|
|
|
|
Linux Resource Containers provide process and resource isolation without the
|
|
|
|
|
overhead of full virtualization.
|
|
|
|
|
|
|
|
|
|
The %{name}-libs package contains libraries for running %{name} applications.
|
|
|
|
|
|
2019-12-25 15:57:42 +08:00
|
|
|
|
2023-08-08 01:24:35 +00:00
|
|
|
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/lxc-5.0.2}
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Containers are insulated areas inside a system, which have their own namespace
|
|
|
|
|
for filesystem, network, PID, IPC, CPU and memory allocation and which can be
|
|
|
|
|
created using the Control Group and Namespace features included in the Linux
|
|
|
|
|
kernel.
|
|
|
|
|
|
2019-11-06 19:42:19 +08:00
|
|
|
This package provides the lxc-* tools and libraries for running lxc
|
2019-09-30 11:03:07 -04:00
|
|
|
applications, which can be used to start a single daemon in a container, or to
|
|
|
|
|
boot an entire "containerized" system, and to manage and debug your containers.
|
|
|
|
|
|
|
|
|
|
%package devel
|
2019-11-06 19:42:19 +08:00
|
|
|
Summary: Development files for lxc
|
2023-07-21 02:43:10 +00:00
|
|
|
Requires: lxc = 5.0.2-%{release}
|
2019-09-30 11:03:07 -04:00
|
|
|
Requires: pkgconfig
|
|
|
|
|
|
|
|
|
|
%description devel
|
2019-11-06 19:42:19 +08:00
|
|
|
The lxc-devel package contains header files ,library and templates needed for
|
2019-09-30 11:03:07 -04:00
|
|
|
development of the Linux containers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package help
|
2019-11-06 19:42:19 +08:00
|
|
|
Summary: Documentation and templates for lxc
|
2019-09-30 11:03:07 -04:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
%description help
|
2019-11-06 19:42:19 +08:00
|
|
|
This package contains documentation for lxc for creating containers.
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%prep
|
2023-07-21 02:43:10 +00:00
|
|
|
%autosetup -n lxc-5.0.2 -Sgit -p1
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%build
|
2023-02-22 14:10:37 +08:00
|
|
|
%ifarch riscv64
|
|
|
|
|
export LDFLAGS="%{build_ldflags} -latomic -pthread"
|
|
|
|
|
%endif
|
2024-07-29 08:54:19 +00:00
|
|
|
meson setup \
|
2024-04-01 16:26:00 +08:00
|
|
|
%{?with_isulad:-Disulad=true} \
|
|
|
|
|
%{!?with_isulad:-Disulad=false} \
|
|
|
|
|
%if "%{?toolchain}" == "clang"
|
|
|
|
|
-Db_lto=false \
|
2023-08-07 01:12:22 +00:00
|
|
|
%endif
|
2024-04-01 16:26:00 +08:00
|
|
|
-Dprefix=/usr build
|
2023-07-21 02:43:10 +00:00
|
|
|
meson compile -C build
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%{make_install}
|
2019-11-20 19:19:07 +08:00
|
|
|
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
|
2020-03-01 22:54:01 -05:00
|
|
|
mkdir -p %{buildroot}%{_datadir}/%{name}/__pycache__
|
2020-03-03 22:52:36 -05:00
|
|
|
touch %{buildroot}%{_datadir}/%{name}/__pycache__/%{name}
|
2019-09-30 11:03:07 -04:00
|
|
|
|
2019-11-20 19:19:07 +08:00
|
|
|
for file in $(find %{buildroot}/usr/bin/lxc-* -type f -exec file {} ';' | grep "\<ELF\>" | grep -vE "*\.static" | awk -F ':' '{print $1}')
|
2019-09-30 11:03:07 -04:00
|
|
|
do
|
|
|
|
|
chrpath -d ${file}
|
|
|
|
|
done
|
|
|
|
|
|
2019-11-20 19:19:07 +08:00
|
|
|
for file in $(find %{buildroot}/usr/sbin/* -type f -exec file {} ';' | grep "\<ELF\>" | grep -vE "*\.static" | awk -F ':' '{print $1}')
|
2019-09-30 11:03:07 -04:00
|
|
|
do
|
|
|
|
|
chrpath -d ${file}
|
|
|
|
|
done
|
|
|
|
|
|
2019-11-20 19:19:07 +08:00
|
|
|
for file in $(find %{buildroot}/usr/libexec/lxc/lxc-* -type f -exec file {} ';' | grep "\<ELF\>" | grep -vE "*\.static" | awk -F ':' '{print $1}')
|
2019-09-30 11:03:07 -04:00
|
|
|
do
|
|
|
|
|
chrpath -d ${file}
|
|
|
|
|
done
|
|
|
|
|
|
2022-11-08 09:48:57 +08:00
|
|
|
%ifarch sw_64
|
|
|
|
|
chrpath -d %{buildroot}/usr/lib/liblxc.so
|
|
|
|
|
chmod +x %{buildroot}/usr/lib/liblxc.so
|
|
|
|
|
%else
|
2019-09-30 11:03:07 -04:00
|
|
|
chrpath -d %{buildroot}/usr/lib64/liblxc.so
|
2020-08-03 11:11:51 +08:00
|
|
|
chmod +x %{buildroot}/usr/lib64/liblxc.so
|
2022-11-08 09:48:57 +08:00
|
|
|
%endif
|
2019-09-30 11:03:07 -04:00
|
|
|
# docs
|
2022-11-08 09:48:57 +08:00
|
|
|
%ifarch sw_64
|
|
|
|
|
%else
|
2023-07-21 02:43:10 +00:00
|
|
|
cp -a AUTHORS %{buildroot}%{_pkgdocdir}
|
2022-11-08 09:48:57 +08:00
|
|
|
%endif
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
# cache dir
|
2019-11-20 19:19:07 +08:00
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
|
2019-09-30 11:03:07 -04:00
|
|
|
|
2020-03-10 09:36:11 -04:00
|
|
|
if [ ! -d %{buildroot}%{_sysconfdir}/sysconfig ]
|
|
|
|
|
then
|
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
|
|
touch %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
|
|
|
|
fi
|
|
|
|
|
|
2019-09-30 11:03:07 -04:00
|
|
|
# remove libtool .la file
|
|
|
|
|
rm -rf %{buildroot}%{_libdir}/liblxc.la
|
2019-12-13 15:46:36 +08:00
|
|
|
rm -rf %{buildroot}%{_sbindir}/init.%{name}.static
|
|
|
|
|
rm -rf %{buildroot}%{_sysconfdir}/default/%{name}
|
2019-09-30 11:03:07 -04:00
|
|
|
%check
|
2023-07-21 02:43:10 +00:00
|
|
|
meson test -C build
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root)
|
2019-11-20 19:19:07 +08:00
|
|
|
%{_bindir}/%{name}-*
|
|
|
|
|
%{_datadir}/%{name}/%{name}.functions
|
2019-09-30 11:03:07 -04:00
|
|
|
%dir %{_datadir}/bash-completion
|
|
|
|
|
%dir %{_datadir}/bash-completion/completions
|
2023-07-21 02:43:10 +00:00
|
|
|
%{_datadir}/bash-completion/completions/*
|
|
|
|
|
|
2020-02-14 02:52:10 -05:00
|
|
|
%files libs
|
|
|
|
|
%defattr(-,root,root)
|
2019-09-30 11:03:07 -04:00
|
|
|
%{_libdir}/liblxc.so
|
|
|
|
|
%{_libdir}/liblxc.so.*
|
2019-11-20 19:19:07 +08:00
|
|
|
%{_libdir}/%{name}
|
|
|
|
|
%{_libexecdir}/%{name}
|
|
|
|
|
%{_sbindir}/init.%{name}
|
|
|
|
|
%{_sharedstatedir}/%{name}
|
|
|
|
|
%dir %{_sysconfdir}/%{name}
|
2020-03-01 22:54:01 -05:00
|
|
|
%config(noreplace) %{_sysconfdir}/lxc/*
|
2020-03-10 09:36:11 -04:00
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/*
|
2019-11-20 19:19:07 +08:00
|
|
|
|
2019-09-30 11:03:07 -04:00
|
|
|
%dir %{_pkgdocdir}
|
2020-02-14 02:52:10 -05:00
|
|
|
%license COPYING
|
2019-11-20 19:19:07 +08:00
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
|
%{_unitdir}/%{name}@.service
|
|
|
|
|
%{_unitdir}/%{name}-net.service
|
2023-07-21 02:43:10 +00:00
|
|
|
%{_unitdir}/%{name}-monitord.service
|
2019-11-20 19:19:07 +08:00
|
|
|
%dir %{_localstatedir}/cache/%{name}
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%defattr(-,root,root)
|
2023-07-21 02:43:10 +00:00
|
|
|
%{_libdir}/liblxc.a
|
2019-11-20 19:19:07 +08:00
|
|
|
%{_includedir}/%{name}/*
|
|
|
|
|
%{_libdir}/pkgconfig/%{name}.pc
|
|
|
|
|
%dir %{_datadir}/%{name}
|
|
|
|
|
%{_datadir}/%{name}/lxc-patch.py*
|
|
|
|
|
%{_datadir}/%{name}/selinux
|
|
|
|
|
%dir %{_datadir}/%{name}/templates
|
|
|
|
|
%{_datadir}/%{name}/templates/lxc-*
|
|
|
|
|
%dir %{_datadir}/%{name}/config
|
|
|
|
|
%{_datadir}/%{name}/config/*
|
2020-03-03 22:52:36 -05:00
|
|
|
%dir %{_datadir}/%{name}/__pycache__
|
|
|
|
|
%{_datadir}/%{name}/__pycache__/*
|
2024-04-01 16:26:00 +08:00
|
|
|
%if %{without isulad}
|
2023-08-07 01:12:22 +00:00
|
|
|
%{_datadir}/%{name}/hooks
|
|
|
|
|
%endif
|
2020-03-03 22:52:36 -05:00
|
|
|
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
%files help
|
|
|
|
|
%dir %{_pkgdocdir}
|
|
|
|
|
%{_pkgdocdir}/*
|
2022-11-08 09:48:57 +08:00
|
|
|
%ifarch sw_64
|
|
|
|
|
%else
|
2019-11-20 19:19:07 +08:00
|
|
|
%{_mandir}/man1/%{name}*
|
|
|
|
|
%{_mandir}/*/man1/%{name}*
|
|
|
|
|
%{_mandir}/man5/%{name}*
|
|
|
|
|
%{_mandir}/man7/%{name}*
|
|
|
|
|
%{_mandir}/*/man5/%{name}*
|
|
|
|
|
%{_mandir}/*/man7/%{name}*
|
2022-11-08 09:48:57 +08:00
|
|
|
%endif
|
2019-12-25 15:57:42 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2024-11-25 06:52:57 +00:00
|
|
|
* Mon Nov 25 2024 jikai <jikai11@huawei.com> - 5.0.2-17
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: sync patch from master to add fPIC compile option
|
|
|
|
|
|
2024-09-15 02:07:29 +08:00
|
|
|
* Sun Sep 15 2024 yuanchao <1050706328@qq.com> - 5.0.2-16
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: fix error of cc.compiles in meson.build on aarch cased by '-fstack-clash-protection' and '-Werror'
|
|
|
|
|
|
2024-07-29 08:54:19 +00:00
|
|
|
* Mon Jul 29 2024 jikai <jikai11@huawei.com> - 5.0.2-15
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: disable tests while building lxc
|
|
|
|
|
|
2024-04-01 16:26:00 +08:00
|
|
|
* Mon Mar 11 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 5.0.2-14
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: update meson parameters for disabling LTO when building with clang & ld.bfd
|
|
|
|
|
|
2024-02-26 11:02:06 +08:00
|
|
|
* Mon Feb 26 2024 jikai<jikai11@huawei.com> - 5.0.2-13
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: unfreeze freezing container and bugfix for files.limit and syscontainer
|
|
|
|
|
|
2024-02-22 17:35:53 +08:00
|
|
|
* Thu Feb 22 2024 jikai<jikai11@huawei.com> - 5.0.2-12
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: append mntopt to mntdata if not found in mount_opt
|
|
|
|
|
|
2024-02-08 01:15:17 +00:00
|
|
|
* Wed Feb 07 2024 jikai<jikai11@huawei.com> - 5.0.2-11
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: fix cpuset cgroup set error
|
|
|
|
|
|
2024-02-07 06:17:25 +00:00
|
|
|
* Mon Feb 05 2024 jikai<jikai11@huawei.com> - 5.0.2-10
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: ensure cpuset cgroup built while writing cgroup.procs
|
|
|
|
|
|
2024-01-23 02:10:34 +00:00
|
|
|
* Fri Jan 12 2024 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-9
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: fix dev mount failed and skip send/recv devpts_fd if disable_pty
|
|
|
|
|
|
2024-01-10 06:12:01 +00:00
|
|
|
* Thu Jan 04 2024 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-8
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: skip setup console if disable pty and fix syscontainer-hooks write devices rule useless
|
|
|
|
|
|
2024-01-02 01:13:42 +00:00
|
|
|
* Fri Dec 29 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-7
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: add storage block code for embedded image
|
|
|
|
|
|
2023-12-19 12:38:54 +00:00
|
|
|
* Thu Dec 07 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-6
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: bugfix about cgroup, mount propagation and capabilities
|
|
|
|
|
|
2023-11-01 16:58:05 +08:00
|
|
|
* Wed Nov 01 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-5
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: bugfix for system container and stream
|
|
|
|
|
|
2023-10-24 11:54:26 +00:00
|
|
|
* Wed Oct 18 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-4
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: fix run container failed when enable isulad
|
|
|
|
|
|
2023-08-07 01:12:22 +00:00
|
|
|
* Fri Aug 04 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-3
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: disable isulad option
|
|
|
|
|
|
2023-08-04 07:53:33 +00:00
|
|
|
* Tue Aug 01 2023 zhangxiaoyu<zhangxiaoyu58@huawei.com> - 5.0.2-2
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC: add isulad code and fix compile error
|
|
|
|
|
|
2023-07-21 02:43:10 +00:00
|
|
|
* Thu Jul 13 2023 haozi007<liuhao27@huawei.com> - 5.0.2-1
|
2020-04-23 11:50:43 +08:00
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
2023-07-21 02:43:10 +00:00
|
|
|
- DESC: update to 5.0.2
|