From 4086bf45b0a829b6aee3f3ba66e859b935db9b53 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Wed, 5 Feb 2025 17:23:11 +0200 Subject: [PATCH] debian: Switch to quilt format Switch to quilt package format, and use `dpkg-buildpackage -b` to build the new Python package. Refs #1071 --- debian/source/format | 2 +- install/linux/build-deb.py | 43 +++++++------------------------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/debian/source/format b/debian/source/format index 9f67427..163aaf8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (native) \ No newline at end of file +3.0 (quilt) diff --git a/install/linux/build-deb.py b/install/linux/build-deb.py index 82d87a6..021d01c 100755 --- a/install/linux/build-deb.py +++ b/install/linux/build-deb.py @@ -21,22 +21,6 @@ def run(cmd): def main(): - parser = argparse.ArgumentParser( - prog=sys.argv[0], - description="Dev script for building Dangerzone debs", - ) - # FIXME: The name of the distro is important, as it can help users who are upgrading - # from a distro version to another. If we *do* need to provide a name at some point, - # here's a suggestion on how we should tackle naming: - # - # https://github.com/freedomofpress/dangerzone/pull/322#issuecomment-1428665162 - parser.add_argument( - "--distro", - required=False, - help="The name of the Debian-based distro", - ) - args = parser.parse_args() - dist_path = root / "dist" deb_dist_path = root / "deb_dist" @@ -46,28 +30,15 @@ def main(): if os.path.exists(deb_dist_path): shutil.rmtree(deb_dist_path) - print("* Building DEB package") - if args.distro is None: - deb_ver = "1" - else: - deb_ver = args.distro - - run( - [ - "dpkg-buildpackage", - ] - ) + print("* Building binary-only DEB package") + run(["dpkg-buildpackage", "-b"]) os.makedirs(deb_dist_path, exist_ok=True) - print("") - print("* To install run:") - - # dpkg-buildpackage produces a .deb file in the parent folder - # that needs to be copied to the `deb_dist` folder manually - src = root.parent / f"dangerzone_{version}_amd64.deb" - destination = root / "deb_dist" / f"dangerzone_{version}-{deb_ver}_amd64.deb" - shutil.move(src, destination) - print(f"sudo dpkg -i {destination}") + print("The following files have been created:") + for src in root.parent.glob(f"dangerzone_{version}*"): + dest = deb_dist_path / src.name + shutil.move(src, dest) + print(f"{dest}") if __name__ == "__main__":