]> git.pld-linux.org Git - packages/lxc.git/commitdiff
- updated to 5.0.2, now uses meson master auto/th/lxc-5.0.2-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 5 Feb 2023 19:05:29 +0000 (20:05 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Sun, 5 Feb 2023 19:05:29 +0000 (20:05 +0100)
- removed outdated no-Werror,glibc2_36 patches

glibc2_36.patch [deleted file]
lxc-pld.patch [new file with mode: 0644]
lxc.spec
no-Werror.patch [deleted file]

diff --git a/glibc2_36.patch b/glibc2_36.patch
deleted file mode 100644 (file)
index e18a3c2..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-From c1115e1503bf955c97f4cf3b925a6a9f619764c3 Mon Sep 17 00:00:00 2001
-From: Christian Brauner <brauner@kernel.org>
-Date: Tue, 9 Aug 2022 16:14:25 +0200
-Subject: [PATCH] build: detect where struct mount_attr is declared
-
-Fixes: #4176
-Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
-[Retrieved from:
-https://github.com/lxc/lxc/commit/c1115e1503bf955c97f4cf3b925a6a9f619764c3]
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- src/lxc/conf.c             |  6 +++---
- src/lxc/conf.h             |  2 +-
- src/lxc/mount_utils.c      |  6 +++---
- src/lxc/syscall_wrappers.h | 12 ++++++++++--
- 5 files changed, 45 insertions(+), 11 deletions(-)
-
-diff --git a/src/lxc/conf.c b/src/lxc/conf.c
-index ffbe74c2f6..4193cd07f5 100644
---- a/src/lxc/conf.c
-+++ b/src/lxc/conf.c
-@@ -2885,7 +2885,7 @@ static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f)
-               struct lxc_mount_options opts = {};
-               int dfd_from;
-               const char *source_relative, *target_relative;
--              struct lxc_mount_attr attr = {};
-+              struct mount_attr attr = {};
-               ret = parse_lxc_mount_attrs(&opts, mntent.mnt_opts);
-               if (ret < 0)
-@@ -3005,7 +3005,7 @@ static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f)
-               /* Set propagation mount options. */
-               if (opts.attr.propagation) {
--                      attr = (struct lxc_mount_attr) {
-+                      attr = (struct mount_attr) {
-                               .propagation = opts.attr.propagation,
-                       };
-@@ -4109,7 +4109,7 @@ int lxc_idmapped_mounts_parent(struct lxc_handler *handler)
-       for (;;) {
-               __do_close int fd_from = -EBADF, fd_userns = -EBADF;
--              struct lxc_mount_attr attr = {};
-+              struct mount_attr attr = {};
-               struct lxc_mount_options opts = {};
-               ssize_t ret;
-diff --git a/src/lxc/conf.h b/src/lxc/conf.h
-index 7dc2f15b60..772479f9e1 100644
---- a/src/lxc/conf.h
-+++ b/src/lxc/conf.h
-@@ -223,7 +223,7 @@ struct lxc_mount_options {
-       unsigned long mnt_flags;
-       unsigned long prop_flags;
-       char *data;
--      struct lxc_mount_attr attr;
-+      struct mount_attr attr;
-       char *raw_options;
- };
-diff --git a/src/lxc/mount_utils.c b/src/lxc/mount_utils.c
-index bba75f933c..88dd73ee36 100644
---- a/src/lxc/mount_utils.c
-+++ b/src/lxc/mount_utils.c
-@@ -31,7 +31,7 @@ lxc_log_define(mount_utils, lxc);
-  * setting in @attr_set, but must also specify MOUNT_ATTR__ATIME in the
-  * @attr_clr field.
-  */
--static inline void set_atime(struct lxc_mount_attr *attr)
-+static inline void set_atime(struct mount_attr *attr)
- {
-       switch (attr->attr_set & MOUNT_ATTR__ATIME) {
-       case MOUNT_ATTR_RELATIME:
-@@ -272,7 +272,7 @@ int create_detached_idmapped_mount(const char *path, int userns_fd,
- {
-       __do_close int fd_tree_from = -EBADF;
-       unsigned int open_tree_flags = OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC;
--      struct lxc_mount_attr attr = {
-+      struct mount_attr attr = {
-               .attr_set       = MOUNT_ATTR_IDMAP | attr_set,
-               .attr_clr       = attr_clr,
-               .userns_fd      = userns_fd,
-@@ -335,7 +335,7 @@ int __fd_bind_mount(int dfd_from, const char *path_from, __u64 o_flags_from,
-                   __u64 attr_clr, __u64 propagation, int userns_fd,
-                   bool recursive)
- {
--      struct lxc_mount_attr attr = {
-+      struct mount_attr attr = {
-               .attr_set       = attr_set,
-               .attr_clr       = attr_clr,
-               .propagation    = propagation,
-diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h
-index a5e98b565c..c8a7d0c7b7 100644
---- a/src/lxc/syscall_wrappers.h
-+++ b/src/lxc/syscall_wrappers.h
-@@ -18,6 +18,12 @@
- #include "macro.h"
- #include "syscall_numbers.h"
-+#if HAVE_STRUCT_MOUNT_ATTR
-+#include <sys/mount.h>
-+#elif HAVE_UAPI_STRUCT_MOUNT_ATTR
-+#include <linux/mount.h>
-+#endif
-+
- #ifdef HAVE_LINUX_MEMFD_H
- #include <linux/memfd.h>
- #endif
-@@ -210,16 +216,18 @@ extern int fsmount(int fs_fd, unsigned int flags, unsigned int attr_flags);
- /*
-  * mount_setattr()
-  */
--struct lxc_mount_attr {
-+#if !HAVE_STRUCT_MOUNT_ATTR && !HAVE_UAPI_STRUCT_MOUNT_ATTR
-+struct mount_attr {
-       __u64 attr_set;
-       __u64 attr_clr;
-       __u64 propagation;
-       __u64 userns_fd;
- };
-+#endif
- #if !HAVE_MOUNT_SETATTR
- static inline int mount_setattr(int dfd, const char *path, unsigned int flags,
--                              struct lxc_mount_attr *attr, size_t size)
-+                              struct mount_attr *attr, size_t size)
- {
-       return syscall(__NR_mount_setattr, dfd, path, flags, attr, size);
- }
---- a/configure.ac     2022-11-21 22:26:58.649999866 +0100
-+++ b/configure.ac     2022-11-21 23:13:32.826666552 +0100
-@@ -701,7 +701,8 @@
- # Check for some syscalls functions
- AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create move_mount open_tree execveat clone3 fsopen fspick fsconfig fsmount openat2 close_range statvfs mount_setattr sigdescr_np])
- AC_CHECK_TYPES([__aligned_u64], [], [], [[#include <linux/types.h>]])
--AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <linux/mount.h>]])
-+AC_CHECK_TYPES([struct mount_attr], [], [], [[#include <sys/mount.h>]])
-+AC_CHECK_TYPES([struct mount_attr], AC_DEFINE(HAVE_UAPI_STRUCT_MOUNT_ATTR,1,[mount_attr from <linux/mount.h>]), [], [[#include <linux/mount.h>]])
- AC_CHECK_TYPES([struct open_how], [], [], [[#include <linux/openat2.h>]])
- AC_CHECK_TYPES([struct clone_args], [], [], [[#include <linux/sched.h>]])
- AC_CHECK_MEMBERS([struct clone_args.set_tid],[],[],[[#include <linux/sched.h>]])
diff --git a/lxc-pld.patch b/lxc-pld.patch
new file mode 100644 (file)
index 0000000..7fd7a96
--- /dev/null
@@ -0,0 +1,30 @@
+--- lxc-5.0.2/config/init/sysvinit/meson.build.orig    2023-01-16 22:08:50.000000000 +0100
++++ lxc-5.0.2/config/init/sysvinit/meson.build 2023-02-03 21:59:16.701939506 +0100
+@@ -6,12 +6,12 @@ if 'sysvinit' in init_script
+         input: 'lxc-containers.in',
+         output: 'lxc-containers',
+         install: true,
+-        install_dir: join_paths(sysconfdir, 'init.d'))
++        install_dir: join_paths(sysconfdir, 'rc.d', 'init.d'))
+     configure_file(
+         configuration: conf,
+         input: 'lxc-net.in',
+         output: 'lxc-net',
+         install: true,
+-        install_dir: join_paths(sysconfdir, 'init.d'))
++        install_dir: join_paths(sysconfdir, 'rc.d', 'init.d'))
+ endif
+--- lxc-5.0.2/templates/meson.build.orig       2023-01-16 22:08:50.000000000 +0100
++++ lxc-5.0.2/templates/meson.build    2023-02-03 22:00:05.935006121 +0100
+@@ -27,3 +27,10 @@ template_scripts = configure_file(
+     output: 'lxc-oci',
+     install: true,
+     install_dir: lxctemplatedir)
++
++template_scripts = configure_file(
++    configuration: conf,
++    input: 'lxc-pld.in',
++    output: 'lxc-pld',
++    install: true,
++    install_dir: lxctemplatedir)
index fa58d9598c879677be240836b3156b3f423b9648..70f1eb870e6f7ed5aea0f3f423e6527b0d91d333 100644 (file)
--- a/lxc.spec
+++ b/lxc.spec
@@ -7,28 +7,26 @@
 %bcond_without seccomp         # SecComp syscall filter
 %bcond_without static          # static init.lxc variant
 %bcond_with    selinux         # SELinux support
+%bcond_with    uring           # io-uring based event loop
 %bcond_without pam             # cgfs PAM module
 
 Summary:       Linux Containers userspace tools
 Summary(pl.UTF-8):     Narzędzia do kontenerów linuksowych (LXC)
 Name:          lxc
-Version:       4.0.12
+Version:       5.0.2
 Release:       1
 License:       LGPL v2.1+
 Group:         Applications/System
 Source0:       https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz
-# Source0-md5: 4818cb60b1418ca97a8d7c159f9f872b
+# Source0-md5: e4e4aada334fb282f9af9b3bd2aa3ad7
 Source1:       %{name}-pld.in.sh
 # lxc-net based on bridge, macvlan is an alternative/supported lxc network
 Source2:       %{name}_macvlan.sysconfig
 Source3:       %{name}_macvlan
+Patch0:                %{name}-pld.patch
 Patch1:                %{name}-net.patch
 Patch2:                x32.patch
-Patch3:                no-Werror.patch
-Patch4:                glibc2_36.patch
 URL:           https://www.linuxcontainers.org/
-BuildRequires: autoconf >= 2.50
-BuildRequires: automake
 BuildRequires: docbook-dtd45-xml
 BuildRequires: docbook2X >= 0.8
 BuildRequires: doxygen
@@ -38,12 +36,14 @@ BuildRequires:      gnutls-devel
 %{?with_apparmor:BuildRequires:        libapparmor-devel}
 BuildRequires: libcap-devel
 %{?with_static:BuildRequires:  libcap-static}
-%{?with_seccomp:BuildRequires: libseccomp-devel}
-BuildRequires: libtool >= 2:2
+%{?with_seccomp:BuildRequires: libseccomp-devel >= 2.5.0}
+%{?with_uring:BuildRequires:   liburing-devel}
 BuildRequires: libxslt-progs
+BuildRequires: meson >= 0.61
+BuildRequires: ninja >= 1.5
 %{?with_pam:BuildRequires:     pam-devel}
 BuildRequires: pkgconfig
-BuildRequires: rpmbuild(macros) >= 1.671
+BuildRequires: rpmbuild(macros) >= 1.736
 BuildRequires: sed >= 4.0
 Requires(post):        /sbin/ldconfig
 Requires(post,preun):  /sbin/chkconfig
@@ -105,6 +105,7 @@ użytkownik może administrować.
 Summary:       liblxc library
 Summary(pl.UTF-8):     Biblioteka liblxc
 Group:         Libraries
+%{?with_seccomp:Requires:      libseccomp >= 2.5.0}
 Conflicts:     lxc < 2.0.4-2
 
 %description libs
@@ -153,52 +154,37 @@ bashowe uzupełnianie nazw dla LXC.
 
 %prep
 %setup -q
+%patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
-%patch4 -p1
 
 cp -p %{SOURCE1} templates/lxc-pld.in
 
+%{__sed} -i -e "/^pam_security =/ s!libdir,!'/', '%{_lib}',!" meson.build
+
 %build
-%{__libtoolize}
-%{__aclocal} -I config
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure \
-       bashcompdir=%{bash_compdir} \
-       db2xman=docbook2X2man \
-       --disable-rpath \
-       %{__enable_disable apparmor} \
-       --enable-bash \
-       --enable-doc \
-       --enable-examples \
-       %{?with_pam:--enable-pam} \
-       %{__enable_disable seccomp} \
-       %{__enable_disable selinux} \
-       --with-config-path=%{configpath} \
-       --with-distro=pld \
-       --with-init-script=sysvinit,systemd \
-       --with-runtime-path=/var/run
-
-%{__make}
-%{__make} -C doc
+%meson build \
+       %{!?with_apparmor:-Dapparmor=false} \
+       -Ddata-path=%{configpath} \
+       -Ddistrosysconfdir=/etc/sysconfig \
+       -Dinit-script=sysvinit,systemd \
+       %{?with_uring:-Dio-uring-event-loop} \
+       %{?with_pam:-Dpam-cgroup=true} \
+       -Druntime-path=/var/run \
+       %{!?with_seccomp:-Dseccomp=false} \
+       %{!?with_selinux:-Dselinux=false} \
+       -Dsystemd-unitdir=%{systemdunitdir}
+
+%ninja_build -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \
-        -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
-
-%{__make} install \
-       SYSTEMD_UNIT_DIR=%{systemdunitdir} \
-       pcdatadir=%{_pkgconfigdir} \
-       DESTDIR=$RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/log/lxc}
 
-%{__make} -C doc install \
-       DESTDIR=$RPM_BUILD_ROOT
+%ninja_install -C build
 
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/liblxc.la
+# keep compatible name
+%{__mv} $RPM_BUILD_ROOT/etc/rc.d/init.d/{lxc-containers,lxc}
 
 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
 
@@ -236,7 +222,7 @@ fi
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS CONTRIBUTING MAINTAINERS README  doc/FAQ.txt doc/examples/*.conf
+%doc AUTHORS COPYING MAINTAINERS README.md  doc/FAQ.txt build/doc/examples/*.conf
 %attr(755,root,root) %{_bindir}/lxc-attach
 %attr(755,root,root) %{_bindir}/lxc-autostart
 %attr(755,root,root) %{_bindir}/lxc-cgroup
@@ -271,6 +257,7 @@ fi
 
 %{systemdunitdir}/lxc.service
 %{systemdunitdir}/lxc@.service
+%{systemdunitdir}/lxc-monitord.service
 %{systemdunitdir}/lxc-net.service
 %dir %{_libdir}/%{name}
 %dir %{_libdir}/%{name}/rootfs
@@ -301,8 +288,11 @@ fi
 %{_datadir}/%{name}/config/oci.common.conf
 %{_datadir}/%{name}/config/userns.conf
 %dir %{_datadir}/%{name}/hooks
+%if %{with selinux}
 %dir %{_datadir}/%{name}/selinux
-%{_datadir}/%{name}/selinux/*
+%{_datadir}/%{name}/selinux/lxc.if
+%{_datadir}/%{name}/selinux/lxc.te
+%endif
 %dir %{_datadir}/%{name}/templates
 %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname
 %attr(755,root,root) %{_datadir}/%{name}/hooks/dhclient
@@ -386,5 +376,5 @@ fi
 
 %files -n bash-completion-%{name}
 %defattr(644,root,root,755)
-%{bash_compdir}/lxc
+%{bash_compdir}/_lxc
 %{bash_compdir}/lxc-*
diff --git a/no-Werror.patch b/no-Werror.patch
deleted file mode 100644 (file)
index dddf1b7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- lxc-4.0.8/configure.ac~    2021-04-30 20:16:25.000000000 +0200
-+++ lxc-4.0.8/configure.ac     2021-10-05 23:12:29.650523023 +0200
-@@ -39,7 +39,7 @@
- AC_CONFIG_SRCDIR([configure.ac])
- AC_CONFIG_AUX_DIR([config])
- AC_CONFIG_HEADERS([src/config.h])
--AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability subdir-objects])
-+AM_INIT_AUTOMAKE([-Wall -Wno-portability subdir-objects])
- AC_CANONICAL_HOST
- AM_PROG_CC_C_O
- AC_USE_SYSTEM_EXTENSIONS
-@@ -838,7 +838,7 @@
- CFLAGS="$CFLAGS -Wvla -std=gnu11 -fms-extensions"
- if test "x$enable_werror" = "xyes"; then
--      CFLAGS="$CFLAGS -Werror"
-+      CFLAGS="$CFLAGS"
- fi
- AC_ARG_ENABLE([thread-safety],
This page took 0.089261 seconds and 4 git commands to generate.