From 5d3f635ae809b9cadcf1804a3a4f193beb5458bd Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 5 May 2020 17:21:36 -0600 Subject: [PATCH] Use the proper python version in the libpython dependency on Debian. The configure script already detects the python version, we just need to use it. --- Makefile.in | 4 ++++ etc/sudo-python.pp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index c1d3ff105..112f3c6c7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,9 @@ sudoers_gid = @SUDOERS_GID@ sudoers_mode = @SUDOERS_MODE@ shlib_mode = @SHLIB_MODE@ +# Version of python detected by configure (major.minor) +python_version = @PYTHON_VERSION@ + SUBDIRS = lib/util @ZLIB_SRC@ lib/iolog @LOGSRV@ @LOGSRVD@ \ plugins/audit_json plugins/group_file plugins/sample_approval \ plugins/sudoers plugins/system_group @PYTHON_PLUGIN_SRC@ src \ @@ -391,6 +394,7 @@ package: @PPFILES@ sudoers_gid=$(sudoers_gid) \ sudoers_mode=$(sudoers_mode) \ shlib_mode=$(shlib_mode) \ + python_version=$(python_version) \ version=$(VERSION) $(PPVARS); \ done diff --git a/etc/sudo-python.pp b/etc/sudo-python.pp index f25d95890..8435aef00 100644 --- a/etc/sudo-python.pp +++ b/etc/sudo-python.pp @@ -115,9 +115,12 @@ fi %depend [deb] - libc6, libpython3.6, sudo + libc6, libpython@PYTHON_VERSION@, sudo %fixup [deb] + cp -p %{pp_wrkdir}/%{name}/DEBIAN/control %{pp_wrkdir}/%{name}/DEBIAN/control.$$ + sed "s/@PYTHON_VERSION@/%{python_version}/g" %{pp_wrkdir}/%{name}/DEBIAN/control.$$ > %{pp_wrkdir}/%{name}/DEBIAN/control + rm -f %{pp_wrkdir}/%{name}/DEBIAN/control.$$ echo "Homepage: https://www.sudo.ws" >> %{pp_wrkdir}/%{name}/DEBIAN/control echo "Bugs: https://bugzilla.sudo.ws" >> %{pp_wrkdir}/%{name}/DEBIAN/control