diff --git a/README.rst b/README.rst index 39f0e2f..8951b7f 100644 --- a/README.rst +++ b/README.rst @@ -778,6 +778,7 @@ All available options: Udev-Rules file with rules to install to udev Python2-Depends-Name override Python 2 Debian package name in ${python:Depends} + Dh-python3-params parameters passed to dh_python3 ====================================== ========================================= The option names in stdeb.cfg files are not case sensitive. diff --git a/stdeb/util.py b/stdeb/util.py index 549436e..d9e1cb3 100644 --- a/stdeb/util.py +++ b/stdeb/util.py @@ -199,6 +199,7 @@ def check_call(*popenargs, **kwargs): ('udev-rules=', None, 'file with rules to install to udev'), ('python2-depends-name=', None, 'Python 2 Debian package name used in ${python:Depends}'), + ('dh-python3-params=', None, 'parameters passed to dh_python3'), ] stdeb_cmd_bool_opts = [ @@ -1011,6 +1012,8 @@ def __init__(self, self.dh_binary_arch_lines = '\tdh binary-arch' self.dh_binary_indep_lines = '\tdh binary-indep' + dh_python3_params = parse_val(cfg, module_name, 'dh-python3-params') + conflicts = parse_vals(cfg, module_name, 'Conflicts') conflicts3 = parse_vals(cfg, module_name, 'Conflicts3') breaks = parse_vals(cfg, module_name, 'Breaks') @@ -1198,6 +1201,7 @@ def __init__(self, 'scripts': scripts } + scripts = '' if force_x_python3_version and with_python3 and x_python3_version and \ x_python3_version[0]: # override dh_python3 target to modify the dependencies @@ -1205,11 +1209,14 @@ def __init__(self, version = x_python3_version[0] if not version.endswith('~'): version += '~' - self.override_dh_python3 = RULES_OVERRIDE_PYTHON3 % { - 'scripts': ( + scripts = ( ' sed -i ' + r'"s/\([ =]python3:any (\)>= [^)]*\()\)/\\1%s\\2/g" ' + 'debian/%s.substvars') % (version, self.package3) + if len(scripts) or len(dh_python3_params): + self.override_dh_python3 = RULES_OVERRIDE_PYTHON3 % { + 'scripts': scripts, + 'dh_python3_params': dh_python3_params, } else: self.override_dh_python3 = '' @@ -1673,7 +1680,7 @@ def build_dsc(debinfo, """ RULES_OVERRIDE_PYTHON3 = """ override_dh_python3: - dh_python3 + dh_python3 %(dh_python3_params)s %(scripts)s """