mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 10:56:49 +00:00
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).
This commit is contained in:
parent
3cfbe1cfc0
commit
a1cc7df23d
@ -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)
|
@ -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
|
||||
|
4
setup.py
4
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=[]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user