From 080bb8935c84ca74c1e04dbbf9c32a7cb14a0aef Mon Sep 17 00:00:00 2001 From: "Eugene San (eugenesan)" Date: Thu, 29 Aug 2019 12:01:04 -0700 Subject: [PATCH] Update packaging for 4.0.4 * Fix main version (Don't use spaces and capitals in versions!) * Change debian changelog format in hscommon * Fix build cleanup * Switch to XZ compression * Update build instructions * Build single package for both Debian/Ubuntu * Update packaging --- README.md | 4 ++-- build.py | 3 +++ core/__init__.py | 2 +- package.py | 14 +++++++------- pkg/debian/compat | 2 +- pkg/debian/control | 6 ++++-- pkg/debian/source/format | 1 + pkg/debian/source/options | 1 + 8 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 pkg/debian/source/format create mode 100644 pkg/debian/source/options diff --git a/README.md b/README.md index 814838df..a3c557cd 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ dupeGuru is built with "make": $ make $ make run -### Generate Ubuntu packages +### Generate Debian/Ubuntu package - $ bash -c "pyvenv --system-site-packages env && source env/bin/activate && pip install -r requirements.txt && python3 build.py --clean && python3 package.py" + $ bash -c "python3 -m venv --system-site-packages env && source env/bin/activate && pip install -r requirements.txt && python3 build.py --clean && python3 package.py" ### Running tests diff --git a/build.py b/build.py index f538626d..70c17b77 100644 --- a/build.py +++ b/build.py @@ -131,6 +131,9 @@ def build_normal(): def main(): options = parse_args() + if options.clean: + if op.exists('build'): + shutil.rmtree('build') if not op.exists('build'): os.mkdir('build') if options.doc: diff --git a/core/__init__.py b/core/__init__.py index 5d789634..aff26f61 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,3 +1,3 @@ -__version__ = '4.0.4 RC' +__version__ = '4.0.4' __appname__ = 'dupeGuru' diff --git a/package.py b/package.py index 5f79945c..f5093137 100644 --- a/package.py +++ b/package.py @@ -56,7 +56,7 @@ def package_debian_distribution(distribution): debskel = op.join('pkg', 'debian') os.makedirs(debdest) debopts = json.load(open(op.join(debskel, 'dupeguru.json'))) - for fn in ['compat', 'copyright', 'dirs', 'rules']: + for fn in ['compat', 'copyright', 'dirs', 'rules', 'source']: copy(op.join(debskel, fn), op.join(debdest, fn)) filereplace(op.join(debskel, 'control'), op.join(debdest, 'control'), **debopts) filereplace(op.join(debskel, 'Makefile'), op.join(destpath, 'Makefile'), **debopts) @@ -71,13 +71,13 @@ def package_debian_distribution(distribution): ) shutil.copy(op.join('images', 'dgse_logo_128.png'), srcpath) os.chdir(destpath) - cmd = "dpkg-buildpackage -S" + cmd = "dpkg-buildpackage -S -us -uc" os.system(cmd) os.chdir('../..') def package_debian(): - print("Packaging for Ubuntu") - for distribution in ['trusty', 'xenial']: + print("Packaging for Debian/Ubuntu") + for distribution in ['unstable']: package_debian_distribution(distribution) def package_arch(): @@ -94,7 +94,7 @@ def package_arch(): debopts = json.load(open(op.join('pkg', 'arch', 'dupeguru.json'))) filereplace(op.join('pkg', 'arch', 'dupeguru.desktop'), op.join(srcpath, 'dupeguru.desktop'), **debopts) -def package_source_tgz(): +def package_source_txz(): print("Creating git archive") app_version = get_module_version('core') name = 'dupeguru-src-{}.tar'.format(app_version) @@ -111,7 +111,7 @@ def package_source_tgz(): print_and_do('git archive -o {} --prefix {}/ HEAD'.format(archive_path, submodule)) os.chdir(base_path) print_and_do('tar -A {} -f {}'.format(archive_path, dest)) - print_and_do('gzip {}'.format(dest)) + print_and_do('xz {}'.format(dest)) def package_windows(): app_version = get_module_version('core') @@ -156,7 +156,7 @@ def main(): args = parse_args() if args.src_pkg: print("Creating source package for dupeGuru") - package_source_tgz() + package_source_txz() return print("Packaging dupeGuru with UI qt") if sys.platform == 'win32': diff --git a/pkg/debian/compat b/pkg/debian/compat index 7f8f011e..ec635144 100644 --- a/pkg/debian/compat +++ b/pkg/debian/compat @@ -1 +1 @@ -7 +9 diff --git a/pkg/debian/control b/pkg/debian/control index 5240b450..d9f8a1f2 100644 --- a/pkg/debian/control +++ b/pkg/debian/control @@ -1,10 +1,12 @@ Source: {pkgname} Section: devel Priority: extra -Maintainer: Virgil Dupras +Maintainer: Virgil Dupras , Eugene San (eugenesan) Build-Depends: debhelper (>= 7), python3-dev, python3-setuptools Standards-Version: 3.9.2 -Homepage: http://www.hardcoded.net +Homepage: https://dupeguru.voltaicideas.net +Vcs-Browser: https://github.com/arsenetar/dupeguru +Vcs-Git: https://github.com/arsenetar/dupeguru.git Package: {pkgname} Architecture: {arch} diff --git a/pkg/debian/source/format b/pkg/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/pkg/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/pkg/debian/source/options b/pkg/debian/source/options new file mode 100644 index 00000000..b7bc1f2b --- /dev/null +++ b/pkg/debian/source/options @@ -0,0 +1 @@ +compression = "xz"