Skip to content

Commit

Permalink
build-sys: add configure option to disable installation of Python module
Browse files Browse the repository at this point in the history
Distributions often have their own guidelines regarding installation of Python
modules (e.g. Arch Linux mandates using --optimize=1 for setup.py install,
which the Makefile in this project does not do). Add an option
"--disable-python-installation" (disabled by default) to allow skipping the
Python installation process entirely so that distributions can take care of
this process manually in their preferred way.

Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
  • Loading branch information
diabonas committed Sep 13, 2020
1 parent 0586d2f commit 03de14d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ AS_IF([ test $? = 0 ],
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([python setuptools is required])])

AC_ARG_ENABLE([python-installation],
AS_HELP_STRING([--disable-python-installation], [Disable running setup.py install for swtpm_setup]))
AM_CONDITIONAL([PYTHON_INSTALLATION], [test "x$enable_python_installation" != "xno"])

AC_ARG_ENABLE([hardening],
AS_HELP_STRING([--disable-hardening], [Disable hardening flags]))

Expand Down
2 changes: 2 additions & 0 deletions src/swtpm_setup/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ $(PY_PACKAGE): $(PY_SWTPM_SETUP_FILES)

all-local: $(PY_PACKAGE)

if PYTHON_INSTALLATION
install-exec-local: $(PY_PACKAGE)
@if ! test $(findstring /usr, "$(DESTDIR)$(bindir)"); then \
echo "Warning: Not installing python package to $(DESTDIR)$(bindir)"; \
Expand All @@ -35,6 +36,7 @@ uninstall-local:
echo "Local pip3 uninstall"; \
$(PIP3) uninstall -y $(PY_PACKAGE_NAME); \
fi
endif

# for out-of-tree builds we need to clean up
clean-local:
Expand Down

0 comments on commit 03de14d

Please sign in to comment.