mirror of
https://github.com/projectatomic/bubblewrap.git
synced 2026-02-06 09:46:09 +01:00
This allows bwrap to be built as a subproject in larger Meson projects. When built as a subproject, we install into the --libexecdir and require a program prefix to be specified: for example, Flatpak would use program_prefix=flatpak- to get /usr/libexec/flatpak-bwrap. Verified to be backwards-compatible as far as Meson 0.49.0 (Debian 9 backports). Loosely based on previous work by Jussi Pakkanen (see #133). Differences between the Autotools and Meson builds: The Meson build requires a version of libcap that has pkg-config metadata (introduced in libcap 2.23, in 2013). The Meson build has no equivalent of --with-priv-mode=setuid. On distributions like Debian <= 10 and RHEL <= 7 that require a setuid bwrap executable, the sysadmin or distribution packaging will need to set the correct permissions on the bwrap executable; Debian already did this via packaging rather than the upstream build system. The Meson build supports being used as a subproject, and there is CI for this. It automatically disables shell completions and man pages, moves the bubblewrap executable to ${libexecdir}, and renames the bubblewrap executable according to a program_prefix option that the caller must specify (for example, Flatpak would use -Dprogram_prefix=flatpak- to get /usr/libexec/flatpak-bwrap). See the tests/use-as-subproject/ directory for an example. Signed-off-by: Simon McVittie <smcv@collabora.com>
103 lines
2.3 KiB
Makefile
103 lines
2.3 KiB
Makefile
AM_CFLAGS = $(WARN_CFLAGS)
|
|
CLEANFILES =
|
|
EXTRA_DIST = \
|
|
.dir-locals.el \
|
|
.editorconfig \
|
|
README.md \
|
|
autogen.sh \
|
|
completions/bash/meson.build \
|
|
completions/meson.build \
|
|
completions/zsh/meson.build \
|
|
demos/bubblewrap-shell.sh \
|
|
demos/flatpak-run.sh \
|
|
demos/flatpak.bpf \
|
|
demos/userns-block-fd.py \
|
|
meson.build \
|
|
meson_options.txt \
|
|
packaging/bubblewrap.spec \
|
|
tests/meson.build \
|
|
tests/use-as-subproject/README \
|
|
tests/use-as-subproject/config.h \
|
|
tests/use-as-subproject/dummy-config.h.in \
|
|
tests/use-as-subproject/meson.build \
|
|
uncrustify.cfg \
|
|
uncrustify.sh \
|
|
$(NULL)
|
|
|
|
GITIGNOREFILES = build-aux/ gtk-doc.make config.h.in aclocal.m4
|
|
|
|
bin_PROGRAMS = bwrap
|
|
|
|
bwrap_srcpath := $(srcdir)
|
|
include Makefile-bwrap.am
|
|
|
|
install-exec-hook:
|
|
if PRIV_MODE_SETUID
|
|
$(SUDO_BIN) chown root $(DESTDIR)$(bindir)/bwrap
|
|
$(SUDO_BIN) chmod u+s $(DESTDIR)$(bindir)/bwrap
|
|
endif
|
|
|
|
test_programs = \
|
|
tests/test-utils \
|
|
$(NULL)
|
|
test_scripts = \
|
|
tests/test-run.sh \
|
|
tests/test-seccomp.py \
|
|
tests/test-specifying-userns.sh \
|
|
tests/test-specifying-pidns.sh \
|
|
$(NULL)
|
|
test_extra_programs = \
|
|
test-bwrap \
|
|
tests/try-syscall \
|
|
$(NULL)
|
|
|
|
test-bwrap: bwrap
|
|
rm -rf test-bwrap
|
|
cp bwrap test-bwrap
|
|
chmod 0755 test-bwrap
|
|
if PRIV_MODE_SETUID
|
|
$(SUDO_BIN) chown root test-bwrap
|
|
$(SUDO_BIN) chmod u+s test-bwrap
|
|
endif
|
|
|
|
tests_test_utils_SOURCES = \
|
|
tests/test-utils.c \
|
|
utils.h \
|
|
utils.c \
|
|
$(NULL)
|
|
tests_test_utils_LDADD = $(SELINUX_LIBS)
|
|
|
|
test_bwrap_SOURCES=
|
|
|
|
include Makefile-docs.am
|
|
|
|
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
|
|
LOG_COMPILER =
|
|
TESTS_ENVIRONMENT = \
|
|
BWRAP=$(abs_top_builddir)/test-bwrap \
|
|
G_TEST_BUILDDIR=$(abs_top_builddir) \
|
|
G_TEST_SRCDIR=$(abs_top_srcdir) \
|
|
$(NULL)
|
|
check_PROGRAMS = $(test_programs) $(test_extra_programs)
|
|
TESTS = $(test_programs) $(test_scripts)
|
|
|
|
EXTRA_DIST += $(test_scripts)
|
|
EXTRA_DIST += tests/libtest-core.sh
|
|
EXTRA_DIST += tests/libtest.sh
|
|
|
|
if ENABLE_BASH_COMPLETION
|
|
bashcompletiondir = $(BASH_COMPLETION_DIR)
|
|
dist_bashcompletion_DATA = completions/bash/bwrap
|
|
endif
|
|
|
|
if ENABLE_ZSH_COMPLETION
|
|
zshcompletiondir = $(ZSH_COMPLETION_DIR)
|
|
dist_zshcompletion_DATA = completions/zsh/_bwrap
|
|
endif
|
|
|
|
-include $(top_srcdir)/git.mk
|
|
|
|
AM_DISTCHECK_CONFIGURE_FLAGS = \
|
|
--with-bash-completion-dir="\$(datadir)"/bash-completion/ \
|
|
$(NULL)
|