--- newt-0.52.23/Makefile.in
+++ newt-0.52.23/Makefile.in
@@ -13,8 +13,10 @@
 SONAME = @SONAME@
 SOEXT = so
 
+ifneq ($(PYTHONVERS),)
 PYTHONVERS = $(shell py3versions --supported)
 PYTHONDBG := $(addsuffix -dbg, $(PYTHONVERS))
+endif
 WHIPTCLLIB = @WHIPTCLLIB@
 ifneq ($(WHIPTCLLIB),)
 WHIPTCLSO = $(WHIPTCLLIB).$(SOEXT)
--- newt-0.52.23/debian/rules
+++ newt-0.52.23/debian/rules
@@ -16,7 +16,11 @@
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
 DEB_HOST_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
 PY3VERS:=$(shell py3versions --supported)
+else
+PYTHONSUPPORT= --without-python
+endif
 
 AM_VERS:=$(strip $(shell dpkg-query -f '$${source:Upstream-Version}' -W automake | egrep -o '^[0-9]+\.[0-9]+'))
 
@@ -32,6 +36,7 @@
 NOSTRIP=--with-nostrip=yes
 endif
 
+
 COLORSFILE = --with-colorsfile=/etc/newt/palette
 
 override_dh_auto_clean:
@@ -45,6 +50,7 @@
 	# Nasty hack. why is it necessary?
 	cp /usr/share/automake-$(AM_VERS)/install-sh ./install-sh
 	dh_auto_configure  -- $(GPMSUPPORT) $(NOSTRIP) $(COLORSFILE) CFLAGS='-I/usr/include/tcl8.6 $(CFLAGS) -DMARCH=\"$(DEB_HOST_MULTIARCH)\" '  \
+		$(PYTHONSUPPORT) \
 		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" FFLAGS="$(FFLAGS)"  WHIPTCLLIB=whiptcl
 
 override_dh_auto_build:
