lxc: set lxc-user-nic suid bit, docbook2x patch

Switch to meson had a small casualty.
Rebuild with patched meson.

Also simplify the docbook2x patch based on recommendations from Eli
Schwartz.

Closes #38682
This commit is contained in:
Cameron Nemo 2022-08-16 13:22:50 -07:00 committed by Michal Vasilek
parent 7d5f675e8a
commit 46cf275143
2 changed files with 33 additions and 37 deletions

View File

@ -1,49 +1,45 @@
commit d91b4a300017bdcfbea8d013f05369ebba9a3d1e
commit 06f99c2599db8140bd839532caa8f6ee0d1c3ff6
Author: Cameron Nemo <cam@nohom.org>
Date: Sun Aug 7 11:10:31 2022 -0700
Date: Tue Aug 16 20:30:39 2022 -0700
meson: add option to force docbook2x format
meson: fix docbook2x detection
Some distros ship docbook2x as docbook2man, which perplexes the logic in
the meson.build that chooses the "docdtd" value.
Add a build option to always use the newer docbook2x docdtd value.
docbook2man can sometimes be docbook2x and other times be docbook-utils.
Rather than compare paths, use version constraints to detect version.
Signed-off-by: Cameron Nemo <cam@nohom.org>
diff --git a/meson.build b/meson.build
index a145faf06..9c0e6e488 100644
index 666824c5a..2b160d4ac 100644
--- a/meson.build
+++ b/meson.build
@@ -135,6 +135,7 @@ cgrouppattern = get_option('cgroup-pattern')
coverity = get_option('coverity-build')
init_script = get_option('init-script')
sanitize = get_option('b_sanitize')
+docbook2x_only = get_option('docbook2x-only')
want_examples = get_option('examples')
want_io_uring = get_option('io-uring-event-loop')
want_pam_cgroup = get_option('pam-cgroup')
@@ -337,7 +338,7 @@ docconf.set('LXCTEMPLATEDIR', lxctemplatedir)
@@ -324,9 +324,6 @@ endif
generate_date = run_command(date, '--utc', '--date=@' + time_epoch, '+%Y-%m-%d', check: true).stdout().strip()
## Manpages.
-sgml2man = find_program('docbook2X2man', 'docbook2x-man', 'db2x_docbook2man', 'docbook2man', 'docbook-to-man', required: want_mans)
-docbook2man = find_program('docbook2man', required: false)
-
docconf = configuration_data()
docconf.set('builddir', '.')
docconf.set('BINDIR', bindir)
@@ -341,10 +338,15 @@ docconf.set('LXCTEMPLATEDIR', lxctemplatedir)
docconf.set('LXC_USERNIC_CONF', lxc_user_network_conf)
docconf.set('LXC_USERNIC_DB', lxc_user_network_db)
docconf.set('PACKAGE_VERSION', version_data.get('LXC_VERSION'))
-if sgml2man.found() and docbook2man.found() and sgml2man.full_path() == docbook2man.full_path()
+if sgml2man.found() and docbook2man.found() and sgml2man.full_path() == docbook2man.full_path() and not docbook2x_only
docconf.set('docdtd', '"-//Davenport//DTD DocBook V3.0//EN"')
else
docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
diff --git a/meson_options.txt b/meson_options.txt
index c14dacf27..ccc4dde5d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -9,6 +9,10 @@ option('cgroup-pattern', type: 'string', value: '',
option('coverity-build', type: 'boolean', value: 'true',
description: 'build for coverity')
- docconf.set('docdtd', '"-//Davenport//DTD DocBook V3.0//EN"')
-else
- docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
+docconf.set('docdtd', '"-//OASIS//DTD DocBook XML" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"')
+sgml2man = find_program('docbook2X2man', 'docbook2x-man', 'db2x_docbook2man', 'docbook2man', 'docbook-to-man', required: false, version: '>=0.8')
+if not sgml2man.found()
+ sgml2man = find_program('docbook2man', required: false, version: '<0.8')
+ if sgml2man.found()
+ docconf.set('docdtd', '"-//Davenport//DTD DocBook V3.0//EN"')
+ elif want_mans
+ error('missing required docbook2x or docbook-utils dependency')
+ endif
endif
+# no configure equivalent
+option('docbook2x-only', type: 'boolean', value: 'false',
+ description: 'always use DocBook 2x format')
+
# was --{disable,enable}-examples in autotools
option('examples', type: 'boolean', value: 'true',
description: 'build and install examples')
## Threads.

View File

@ -1,11 +1,11 @@
# Template file for 'lxc'
pkgname=lxc
version=5.0.1
revision=1
revision=2
build_style=meson
configure_args="-Dpam-cgroup=true -Drootfs-mount-path=/var/lxc/containers
-Ddistrosysconfdir=default
-Dlog-path=/var/lxc/log -Dinit-script=[] -Ddocbook2x-only=true"
-Dlog-path=/var/lxc/log -Dinit-script=[]"
hostmakedepends="pkg-config docbook2x"
makedepends="libcap-devel libseccomp-devel openssl-devel libapparmor-devel
pam-devel"