1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
From 58721a31e344a9b0def4ff48625a1001a0281294 Mon Sep 17 00:00:00 2001
From: SVN-Git Migration <python-modules-team@lists.alioth.debian.org>
Date: Thu, 8 Oct 2015 14:09:59 -0700
Subject: use_pybuild_buildsystem
Patch-Name: use_pybuild_buildsystem.patch
---
stdeb/util.py | 96 +++++------------------------------------------------------
1 file changed, 8 insertions(+), 88 deletions(-)
--- a/stdeb/util.py
+++ b/stdeb/util.py
@@ -865,7 +865,7 @@
self.uploaders = parse_vals(cfg, module_name, 'Uploaders')
self.date822 = get_date_822()
- build_deps = []
+ build_deps = ['dh-python']
if use_setuptools:
if with_python2:
build_deps.append('python-setuptools (>= 0.6b3)')
@@ -1151,52 +1151,10 @@
else:
self.install_prefix = ''
- rules_override_clean_target_pythons = []
- rules_override_build_target_pythons = []
- rules_override_install_target_pythons = []
- if with_python2:
- rules_override_clean_target_pythons.append(
- RULES_OVERRIDE_CLEAN_TARGET_PY2 % self.__dict__
- )
- rules_override_build_target_pythons.append(
- RULES_OVERRIDE_BUILD_TARGET_PY2 % self.__dict__
- )
- rules_override_install_target_pythons.append(
- RULES_OVERRIDE_INSTALL_TARGET_PY2 % self.__dict__
- )
- if with_python3:
- rules_override_clean_target_pythons.append(
- RULES_OVERRIDE_CLEAN_TARGET_PY3 % self.__dict__
- )
- rules_override_build_target_pythons.append(
- RULES_OVERRIDE_BUILD_TARGET_PY3 % self.__dict__
- )
- rules_override_install_target_pythons.append(
- RULES_OVERRIDE_INSTALL_TARGET_PY3 % self.__dict__
- )
- self.rules_override_clean_target_pythons = \
- '\n'.join(rules_override_clean_target_pythons)
- self.rules_override_build_target_pythons = \
- '\n'.join(rules_override_build_target_pythons)
- self.rules_override_install_target_pythons = \
- '\n'.join(rules_override_install_target_pythons)
-
- self.override_dh_auto_clean = \
- RULES_OVERRIDE_CLEAN_TARGET % self.__dict__
- self.override_dh_auto_build = \
- RULES_OVERRIDE_BUILD_TARGET % self.__dict__
- self.override_dh_auto_install = \
- RULES_OVERRIDE_INSTALL_TARGET % self.__dict__
-
- scripts = ''
- if with_python2 and python2_depends_name:
- scripts = (
- ' sed -i ' +
- r'"s/\([ =]\)python[0-9]\?\(\(:any\)\? (\)/\\1%s\\2/g" ' +
- 'debian/%s.substvars') % (python2_depends_name, self.package)
- self.override_dh_python2 = RULES_OVERRIDE_PYTHON2 % {
- 'scripts': scripts
- }
+ if self.scripts_cleanup:
+ self.override_dh_auto_install = RULES_OVERRIDE_INSTALL_TARGET%self.__dict__
+ else:
+ self.override_dh_auto_install = ''
if force_x_python3_version and with_python3 and x_python3_version and \
x_python3_version[0]:
@@ -1205,15 +1163,6 @@
version = x_python3_version[0]
if not version.endswith('~'):
version += '~'
- self.override_dh_python3 = RULES_OVERRIDE_PYTHON3 % {
- 'scripts': (
- ' sed -i ' +
- r'"s/\([ =]python3:any (\)>= [^)]*\()\)/\\1%s\\2/g" ' +
- 'debian/%s.substvars') % (version, self.package3)
- }
- else:
- self.override_dh_python3 = ''
-
sequencer_options = ['--with '+','.join(sequencer_with)]
if with_dh_virtualenv:
@@ -1226,7 +1175,7 @@
sequencer_options.append('--with python-virtualenv')
else:
- sequencer_options.append('--buildsystem=python_distutils')
+ sequencer_options.append('--buildsystem=pybuild')
self.override_dh_virtualenv_py = ''
if with_dh_systemd:
@@ -1235,7 +1184,7 @@
self.sequencer_options = ' '.join(sequencer_options)
setup_env_vars = parse_vals(cfg, module_name, 'Setup-Env-Vars')
- self.exports = ""
+ self.exports = "export PYBUILD_NAME=%s" % self.source
if len(setup_env_vars):
self.exports += '\n'
self.exports += '#exports specified using stdeb Setup-Env-Vars:\n'
@@ -1477,10 +1426,6 @@
fd.write('3.0 (quilt)\n')
fd.close()
- fd = open(os.path.join(debian_dir, 'source', 'options'), mode='w')
- fd.write(r'extend-diff-ignore="\.egg-info$"')
- fd.close()
-
if debian_dir_only:
return
@@ -1626,75 +1571,16 @@
%(percent_symbol)s:
dh $@ %(sequencer_options)s
-%(override_dh_auto_clean)s
-
-%(override_dh_auto_build)s
-
-%(override_dh_auto_install)s
-
-%(override_dh_python2)s
-
-%(override_dh_python3)s
-
-%(override_dh_virtualenv_py)s
-
%(binary_target_lines)s
"""
-RULES_OVERRIDE_CLEAN_TARGET_PY2 = " python setup.py clean -a"
-RULES_OVERRIDE_CLEAN_TARGET_PY3 = " python3 setup.py clean -a"
-RULES_OVERRIDE_CLEAN_TARGET = r"""
-override_dh_auto_clean:
-%(rules_override_clean_target_pythons)s
- find . -name \*.pyc -exec rm {} \;
-"""
-
-RULES_OVERRIDE_BUILD_TARGET_PY2 = " python setup.py build --force"
-RULES_OVERRIDE_BUILD_TARGET_PY3 = " python3 setup.py build --force"
-RULES_OVERRIDE_BUILD_TARGET = """
-override_dh_auto_build:
-%(rules_override_build_target_pythons)s
-"""
-
-RULES_OVERRIDE_INSTALL_TARGET_PY2 = " python setup.py install --force --root=debian/%(package)s --no-compile -O0 --install-layout=deb %(install_prefix)s %(no_python2_scripts_cli_args)s" # noqa: E501
-
-RULES_OVERRIDE_INSTALL_TARGET_PY3 = " python3 setup.py install --force --root=debian/%(package3)s --no-compile -O0 --install-layout=deb %(install_prefix)s %(no_python3_scripts_cli_args)s" # noqa: E501
RULES_OVERRIDE_INSTALL_TARGET = """
override_dh_auto_install:
-%(rules_override_install_target_pythons)s
+ dh_auto_install
%(scripts_cleanup)s
"""
-RULES_OVERRIDE_PYTHON2 = """
-override_dh_python2:
- dh_python2 --no-guessing-versions
-%(scripts)s
-"""
-RULES_OVERRIDE_PYTHON3 = """
-override_dh_python3:
- dh_python3
-%(scripts)s
-"""
-
-RULES_OVERRIDE_DH_VIRTUALENV_PY2 = """
-override_dh_virtualenv:
- dh_virtualenv --python python2
-"""
-
-RULES_OVERRIDE_DH_VIRTUALENV_PY3 = """
-override_dh_virtualenv:
- dh_virtualenv --python python3
-"""
-
-RULES_BINARY_TARGET = """
-binary: binary-arch binary-indep
-"""
-
-RULES_BINARY_ALL_TARGET = """
-binary: binary-indep
-"""
-
RULES_BINARY_ARCH_TARGET = """
binary-arch: build
%(dh_binary_arch_lines)s
|