From 27d3cf5490ab951de43ede0ff719b015bfba0dec Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: Wed, 25 May 2022 09:25:06 +0200 Subject: [PATCH] Update to 5.0.0. --- lxcfs-5.0.0-man.patch | 85 +++++++++++++++++++++++++++++++++++++++ lxcfs-5.0.0-unitdir.patch | 22 ++++++++++ lxcfs.spec | 18 ++++++--- sources | 2 +- 4 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 lxcfs-5.0.0-man.patch create mode 100644 lxcfs-5.0.0-unitdir.patch diff --git a/lxcfs-5.0.0-man.patch b/lxcfs-5.0.0-man.patch new file mode 100644 index 0000000..d21c8b4 --- /dev/null +++ b/lxcfs-5.0.0-man.patch @@ -0,0 +1,85 @@ +commit 112f0b9ca720b8f0da4d4a39153c16f55e3294e1 +Author: Morten Linderud +Date: Sat Mar 12 15:53:51 2022 + + meson: Include documentation + + Documentation was removed from the build system with the migration to + meson. This implements the help2man generation which existed in the + autoconf setup. + + Signed-off-by: Morten Linderud + +diff --git a/meson.build b/meson.build +index 517dbf6..72c5a73 100644 +--- a/meson.build ++++ b/meson.build +@@ -52,6 +52,7 @@ datadir = join_paths(prefixdir, get_option('datadir')) + + lxcfssharedir = join_paths(datadir, 'lxcfs') + lxcconfdir = join_paths(datadir, 'lxc/config/common.conf.d') ++lxcmandir = join_paths(datadir, 'man') + + conf.set_quoted('BINDIR', bindir) + conf.set_quoted('LIBDIR', libdir) +@@ -68,6 +69,7 @@ conf.set_quoted('LXCFSTARGETDIR', join_paths(localstatedir, 'lib/lxcfs')) + # Custom configuration. + init_script = get_option('init-script') + want_tests = get_option('tests') ++want_docs= get_option('docs') + + + # Build flags. +@@ -167,8 +169,7 @@ add_project_arguments('-include', 'config.h', language: 'c') + + # Binary. + lxcfs_sources = files('src/lxcfs.c') +-public_programs = [] +-public_programs += executable( ++lxcfs = executable( + 'lxcfs', + lxcfs_sources, + dependencies: [ +@@ -251,6 +252,24 @@ lxcfs_spec = custom_target( + '@OUTPUT@', + ]) + ++# Man pages ++if want_docs == true ++ help2man = find_program('help2man') ++ help2man_opts = [ ++ '--name="System virtualization filesystem for containers"', ++ '--no-discard-stderr', ++ '--section=1', ++ '--opt-include=docs/lxcfs.man.add', ++ '--no-info', ++ ] ++ custom_target('lxcfs.1', ++ output: 'lxcfs.1', ++ command: [help2man, help2man_opts, '--output=@OUTPUT@', lxcfs], ++ install: true, ++ install_dir: join_paths(lxcmandir, 'man1')) ++endif ++ ++ + # Include sub-directories. + subdir('config/init') + subdir('share') +@@ -275,5 +294,6 @@ status = [ + 'lxcfs source root directory: @0@'.format(project_source_root), + 'init system: @0@'.format(init_script), + 'tests: @0@'.format(want_tests), ++ 'documentation: @0@'.format(want_docs), + ] + message('\n '.join(status)) +diff --git a/meson_options.txt b/meson_options.txt +index 8529aef..6718c45 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -12,3 +12,6 @@ option('with-init-script', type : 'string', value : 'systemd', + option('init-script', type : 'combo', + choices : ['systemd', 'sysvinit', 'openrc', 'upstart'], value : 'systemd', + description : 'init script') ++ ++option('docs', type : 'boolean', value: 'true', ++ description : 'build documentation') diff --git a/lxcfs-5.0.0-unitdir.patch b/lxcfs-5.0.0-unitdir.patch new file mode 100644 index 0000000..67a1901 --- /dev/null +++ b/lxcfs-5.0.0-unitdir.patch @@ -0,0 +1,22 @@ +diff --git a/config/init/meson.build b/config/init/meson.build +index 5061973..e39c2ab 100644 +--- a/config/init/meson.build ++++ b/config/init/meson.build +@@ -1,6 +1,8 @@ + # SPDX-License-Identifier: LGPL-2.1-or-later + + if init_script == 'systemd' ++ systemd = dependency('systemd') ++ systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir') + systemd_service = custom_target( + 'lxcfs.service', + input: 'systemd/lxcfs.service.in', +@@ -12,7 +14,7 @@ if init_script == 'systemd' + '@OUTPUT@', + ], + install: true, +- install_dir: '/lib/systemd/system') ++ install_dir: systemd_system_unit_dir) + + elif init_script == 'upstart' + install_data('upstart/lxcfs.conf', install_dir: join_paths(sysconfdir, 'init')) diff --git a/lxcfs.spec b/lxcfs.spec index a1a7a1b..01c74e8 100644 --- a/lxcfs.spec +++ b/lxcfs.spec @@ -1,11 +1,15 @@ Name: lxcfs -Version: 4.0.12 +Version: 5.0.0 Release: 1%{?dist} Summary: FUSE based filesystem for LXC License: ASL 2.0 URL: https://linuxcontainers.org/lxcfs Source0: https://linuxcontainers.org/downloads/%{name}/%{name}-%{version}.tar.gz +Patch0: lxcfs-5.0.0-unitdir.patch +Patch1: lxcfs-5.0.0-man.patch +BuildRequires: meson BuildRequires: gcc + BuildRequires: gawk BuildRequires: make BuildRequires: fuse-devel @@ -30,16 +34,16 @@ how long the host is running. %prep -%autosetup +%autosetup -p1 %build -%configure --with-init-script=systemd -make %{?_smp_mflags} +%meson +%meson_build %install -%make_install SYSTEMD_UNIT_DIR=%{_unitdir} +%meson_install mkdir -p %{buildroot}%{_sharedstatedir}/%{name} @@ -63,7 +67,6 @@ mkdir -p %{buildroot}%{_sharedstatedir}/%{name} %{_bindir}/lxcfs %dir %{_libdir}/%{name} %{_libdir}/%{name}/lib%{name}.so -%exclude %{_libdir}/%{name}/lib%{name}.la %dir %{_datadir}/%{name} %{_datadir}/%{name}/lxc.mount.hook %{_datadir}/%{name}/lxc.reboot.hook @@ -74,6 +77,9 @@ mkdir -p %{buildroot}%{_sharedstatedir}/%{name} %changelog +* Wed May 25 2022 Thomas Moschny - 5.0.0-1 +- Update to 5.0.0. + * Sat Mar 5 2022 Thomas Moschny - 4.0.12-1 - Update to 4.0.12. diff --git a/sources b/sources index 15b9bae..3594d9f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (lxcfs-4.0.12.tar.gz) = da8415599bb08e4e15a7e4044edbcad217e4034d96366d508e06cceb2a75d459e24aeb7efd5716e2f41449ec653ecd9916f0d934f738e1df8e9576738cc1ac18 +SHA512 (lxcfs-5.0.0.tar.gz) = f6ab0feea862812dde08dd828cb7843820a27f56ec88ef1bf264e3fe585037b9327849e4a31c629f2712c861cdc80d59ea15c190d875d48b2d446fe15d9e57b8