update code

This commit is contained in:
zhuchunyi 2019-11-06 19:42:19 +08:00
parent 85d35cce63
commit e8cf0cc2cd

114
lxc.spec
View File

@ -4,11 +4,11 @@
Name: lxc Name: lxc
Version: 3.0.3 Version: 3.0.3
Release: %{_release}%{?dist} Release: %{_release}
Summary: Linux Containers userspace tools Summary: Linux Containers userspace tools
License: LGPLv2+ License: LGPLv2+
URL: http://linuxcontainers.org URL: http://linuxcontainers.org
Source0: http://linuxcontainers.org/downloads/%{name}-%{version}.tar.gz Source0: http://linuxcontainers.org/downloads/lxc-3.0.3.tar.gz
Patch6000: lxc-2.0.7-fix-init.patch Patch6000: lxc-2.0.7-fix-init.patch
Patch6001: lxc-2.0.6-fix-lxc-net.patch Patch6001: lxc-2.0.6-fix-lxc-net.patch
Patch6002: lxc-CVE-2019-5736-runC-rexec-callers-as-memfd.patch Patch6002: lxc-CVE-2019-5736-runC-rexec-callers-as-memfd.patch
@ -135,18 +135,12 @@ Patch9122: 0120-remove-unuse-unmount-namespace.patch
Patch9123: 0121-optimize-log-when-root-path-is-invalid.patch Patch9123: 0121-optimize-log-when-root-path-is-invalid.patch
Patch9124: 0122-lxc-fix-code-reivew-errors.patch Patch9124: 0122-lxc-fix-code-reivew-errors.patch
BuildRequires: systemd-units BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath
BuildRequires: git libtool
BuildRequires: docbook2X doxygen
BuildRequires: chrpath
%if 0%{?with_seccomp} %if 0%{?with_seccomp}
BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(libseccomp)
%endif %endif
BuildRequires: libcap libcap-devel BuildRequires: libcap libcap-devel libselinux-devel yajl yajl-devel
BuildRequires: libselinux-devel BuildRequires: libsecurec libsecurec-devel pkgconfig(bash-completion)
BuildRequires: yajl yajl-devel
BuildRequires: libsecurec libsecurec-devel
BuildRequires: pkgconfig(bash-completion)
Requires: rsync Requires: rsync
Requires(post): systemd Requires(post): systemd
@ -155,7 +149,7 @@ Requires(postun): systemd
Requires(post): /sbin/ldconfig Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig Requires(postun): /sbin/ldconfig
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/lxc-3.0.3}
%description %description
Containers are insulated areas inside a system, which have their own namespace Containers are insulated areas inside a system, which have their own namespace
@ -163,29 +157,29 @@ 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 created using the Control Group and Namespace features included in the Linux
kernel. kernel.
This package provides the lxc-* tools and libraries for running %{name} This package provides the lxc-* tools and libraries for running lxc
applications, which can be used to start a single daemon in a container, or to 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. boot an entire "containerized" system, and to manage and debug your containers.
%package devel %package devel
Summary: Development files for %{name} Summary: Development files for lxc
Requires: %{name} = %{version}-%{release} Requires: lxc = 3.0.3-%{release}
Requires: pkgconfig Requires: pkgconfig
%description devel %description devel
The %{name}-devel package contains header files ,library and templates needed for The lxc-devel package contains header files ,library and templates needed for
development of the Linux containers. development of the Linux containers.
%package help %package help
Summary: Documentation and templates for %{name} Summary: Documentation and templates for lxc
BuildArch: noarch BuildArch: noarch
%description help %description help
This package contains documentation for %{name} for creating containers. This package contains documentation for lxc for creating containers.
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n lxc-3.0.3
%patch6000 -p1 %patch6000 -p1
%patch6001 -p1 %patch6001 -p1
%patch6002 -p1 %patch6002 -p1
@ -325,7 +319,7 @@ This package contains documentation for %{name} for creating containers.
%install %install
%{make_install} %{make_install}
mkdir -p %{buildroot}%{_sharedstatedir}/%{name} mkdir -p %{buildroot}%{_sharedstatedir}/lxc
for file in $(find %{buildroot}/usr/bin/lxc-* -type f -exec file {} ';' | grep "\<ELF\>" | awk -F ':' '{print $1}') for file in $(find %{buildroot}/usr/bin/lxc-* -type f -exec file {} ';' | grep "\<ELF\>" | awk -F ':' '{print $1}')
do do
@ -354,7 +348,7 @@ cp -a AUTHORS README %{buildroot}%{_pkgdocdir}
cp -a doc/api/html/* %{buildroot}%{_pkgdocdir}/api/ cp -a doc/api/html/* %{buildroot}%{_pkgdocdir}/api/
# cache dir # cache dir
mkdir -p %{buildroot}%{_localstatedir}/cache/%{name} mkdir -p %{buildroot}%{_localstatedir}/cache/lxc
# remove libtool .la file # remove libtool .la file
rm -rf %{buildroot}%{_libdir}/liblxc.la rm -rf %{buildroot}%{_libdir}/liblxc.la
@ -364,65 +358,65 @@ make check
%post %post
%{?ldconfig} %{?ldconfig}
%systemd_post %{name}-net.service %systemd_post lxc-net.service
%systemd_post %{name}.service %systemd_post lxc.service
%systemd_post %{name}@.service %systemd_post lxc@.service
%preun %preun
%systemd_preun %{name}-net.service %systemd_preun lxc-net.service
%systemd_preun %{name}.service %systemd_preun lxc.service
%systemd_preun %{name}@.service %systemd_preun lxc@.service
%postun %postun
%{?ldconfig} %{?ldconfig}
%systemd_postun %{name}-net.service %systemd_postun lxc-net.service
%systemd_postun %{name}.service %systemd_postun lxc.service
%systemd_postun %{name}@.service %systemd_postun lxc@.service
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/%{name}-* %{_bindir}/lxc-*
%{_datadir}/%{name}/%{name}.functions %{_datadir}/lxc/lxc.functions
%dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions %dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name} %{_datadir}/bash-completion/completions/lxc
%{_libdir}/liblxc.so %{_libdir}/liblxc.so
%{_libdir}/liblxc.so.* %{_libdir}/liblxc.so.*
%{_libdir}/%{name} %{_libdir}/lxc
%{_libexecdir}/%{name} %{_libexecdir}/lxc
%{_sbindir}/init.%{name} %{_sbindir}/init.lxc
%{_sharedstatedir}/%{name} %{_sharedstatedir}/lxc
%dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/lxc
%config(noreplace) %{_sysconfdir}/%{name}/default.conf %config(noreplace) %{_sysconfdir}/lxc/default.conf
%config(noreplace) %{_sysconfdir}/sysconfig/%{name} %config(noreplace) %{_sysconfdir}/sysconfig/lxc
%license COPYING %license COPYING
%dir %{_pkgdocdir} %dir %{_pkgdocdir}
%{_pkgdocdir}/AUTHORS %{_pkgdocdir}/AUTHORS
%{_pkgdocdir}/README %{_pkgdocdir}/README
%{_unitdir}/%{name}.service %{_unitdir}/lxc.service
%{_unitdir}/%{name}@.service %{_unitdir}/lxc@.service
%{_unitdir}/%{name}-net.service %{_unitdir}/lxc-net.service
%dir %{_localstatedir}/cache/%{name} %dir %{_localstatedir}/cache/lxc
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)
%{_includedir}/%{name}/* %{_includedir}/lxc/*
%{_libdir}/pkgconfig/%{name}.pc %{_libdir}/pkgconfig/lxc.pc
%dir %{_datadir}/%{name} %dir %{_datadir}/lxc
%{_datadir}/%{name}/hooks %{_datadir}/lxc/hooks
%{_datadir}/%{name}/%{name}-patch.py* %{_datadir}/lxc/lxc-patch.py*
%{_datadir}/%{name}/selinux %{_datadir}/lxc/selinux
%dir %{_datadir}/%{name}/templates %dir %{_datadir}/lxc/templates
%{_datadir}/%{name}/templates/lxc-* %{_datadir}/lxc/templates/lxc-*
%dir %{_datadir}/%{name}/config %dir %{_datadir}/lxc/config
%{_datadir}/%{name}/config/* %{_datadir}/lxc/config/*
%files help %files help
%dir %{_pkgdocdir} %dir %{_pkgdocdir}
%{_pkgdocdir}/* %{_pkgdocdir}/*
%{_mandir}/man1/%{name}* %{_mandir}/man1/lxc*
%{_mandir}/*/man1/%{name}* %{_mandir}/*/man1/lxc*
%{_mandir}/man5/%{name}* %{_mandir}/man5/lxc*
%{_mandir}/man7/%{name}* %{_mandir}/man7/lxc*
%{_mandir}/*/man5/%{name}* %{_mandir}/*/man5/lxc*
%{_mandir}/*/man7/%{name}* %{_mandir}/*/man7/lxc*