From a1cc7df23d88a0ad92d83967da024f1f52950462 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 4 Sep 2014 22:05:08 -0700 Subject: [PATCH] remove obsolete debian-package building tools setup.py: stop sometimes-depending upon 'stdeb' setup.cfg: don't try to alias 'sdist_dsc' misc/build_helpers/build-deb.py: delete this, it was really old anyways Closes ticket:2282 (trac). --- misc/build_helpers/build-deb.py | 110 -------------------------------- setup.cfg | 1 - setup.py | 4 -- 3 files changed, 115 deletions(-) delete mode 100644 misc/build_helpers/build-deb.py diff --git a/misc/build_helpers/build-deb.py b/misc/build_helpers/build-deb.py deleted file mode 100644 index 8b87159d..00000000 --- a/misc/build_helpers/build-deb.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/false # invoke this with a specific python - -import sys, shutil, os.path -from subprocess import Popen, PIPE - -PYTHON = sys.executable -ARCH = sys.argv[1] - -class SubprocessError(Exception): - pass - -def get_output(*cmd, **kwargs): - tolerate_stderr = kwargs.get("tolerate_stderr", False) - print " " + " ".join(cmd) - p = Popen(cmd, stdout=PIPE) - (out,err) = p.communicate() - rc = p.returncode - if rc != 0: - print >>sys.stderr, err - raise SubprocessError("command %s exited with rc=%s", (cmd, rc)) - if err and not tolerate_stderr: - print >>sys.stderr, "stderr:", err - raise SubprocessError("command emitted unexpected stderr") - print " =>", out, - return out - -def run(*cmd, **kwargs): - print " " + " ".join(cmd) -# if "stdin" in kwargs: -# stdin = kwargs.pop("stdin") -# p = Popen(cmd, stdin=PIPE, **kwargs) -# p.stdin.write(stdin) -# p.stdin.close() -# else: -# p = Popen(cmd, **kwargs) - p = Popen(cmd, **kwargs) - rc = p.wait() - if rc != 0: - raise SubprocessError("command %s exited with rc=%s", (cmd, rc)) - -# the very first time you run setup.py, it will download+build darcsver and -# whatnot, emitting noise to stdout. Run it once (and throw away that junk) -# to avoid treating that noise as the package name. -run(PYTHON, "setup.py", "darcsver") - -NAME = get_output(PYTHON, "setup.py", "--name").strip() -VERSION = get_output(PYTHON, "setup.py", "--version").strip() - -TARBALL = "%s-%s.tar.gz" % (NAME, VERSION) -DEBIAN_TARBALL = "%s_%s.orig.tar.gz" % (NAME, VERSION) -BUILDDIR = "build/debian/%s-%s" % (NAME, VERSION) - -run(PYTHON, "setup.py", "sdist", "--formats=gztar") -if os.path.exists("build/debian"): - shutil.rmtree("build/debian") -os.makedirs("build/debian") -shutil.copyfile("dist/%s" % TARBALL, "build/debian/%s" % DEBIAN_TARBALL) -run("tar", "xf", DEBIAN_TARBALL, cwd="build/debian") - -# now modify the tree for debian packaging. This is an algorithmic way of -# applying the debian .diff, which factors out some of the similarities -# between various debian/ubuntu releases. Everything we do after this point -# will show up in the generated .diff, and thus form the debian-specific part -# of the source package. -DEBDIR = os.path.join(BUILDDIR, "debian") -os.makedirs(DEBDIR) - -# The 'aliases' section in setup.cfg causes problems, so get rid of it. We -# could get rid of the whole file, but 1: find_links is still sort of useful, -# and 2: dpkg-buildpackage prefers to ignore file removal (as opposed to -# file-modification) - -#os.unlink(os.path.join(BUILDDIR, "setup.cfg")) -SETUPCFG = os.path.join(BUILDDIR, "setup.cfg") -lines = open(SETUPCFG, "r").readlines() -f = open(SETUPCFG, "w") -for l in lines: - if l.startswith("[aliases]"): - break - f.write(l) -f.close() - -for n in ["compat", "control", "copyright", "pycompat", "rules"]: - fn = "misc/debian/%s.%s" % (n, ARCH) - if not os.path.exists(fn): - fn = "misc/debian/%s" % n - assert os.path.exists(fn) - - shutil.copyfile(fn, os.path.join(DEBDIR, n)) - if n == "rules": - os.chmod(os.path.join(DEBDIR, n), 0755) # +x - -# We put "local package" on the first line of the changelog entry to suppress -# the lintian NMU warnings (since debchange's new entry's "author" will -# probably be different than the what the debian/control Maintainer: field -# says) - -DISTRIBUTION_MAP = {"sid": "unstable"} - -run("debchange", "--create", - "--package", NAME, - "--newversion", VERSION+"-1", - "--distribution", DISTRIBUTION_MAP.get(ARCH, ARCH), - "local package: 'make deb' build", cwd=BUILDDIR) - -# the package is ready to build. 'debuild' will produce the source package -# (.dsc+.diff.gz), then build the .deb and produce a .changes file ready for -# upload to an APT archive. The build log will go into a .build file. - -run("debuild", "-uc", "-us", cwd=BUILDDIR) diff --git a/setup.cfg b/setup.cfg index 93eb9222..ac312c9d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -39,4 +39,3 @@ sdist = update_version sdist install = update_version install bdist_egg = update_version bdist_egg trial = update_version trial -sdist_dsc = update_version sdist_dsc diff --git a/setup.py b/setup.py index 9a3321f9..d5b4b4e2 100644 --- a/setup.py +++ b/setup.py @@ -140,10 +140,6 @@ setup_requires += [req for req in install_requires if req.startswith('Twisted') if "--reporter=bwverbose-coverage" in sys.argv: setup_requires.append('trialcoverage >= 0.3.3') -# stdeb is required to produce Debian files with the "sdist_dsc" command. -if "sdist_dsc" in sys.argv: - setup_requires.append('stdeb >= 0.3') - # We no longer have any requirements specific to tests. tests_require=[] -- 2.37.2