From 903d2f918347591ce6ecb85200b29a8e22941981 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 19 Apr 2014 17:48:48 -0400 Subject: [PATCH] Improved arch packaging No need to bundle a .desktop file with arch source packages anymore. dupeGuru's source package takes care of that. --- README.md | 2 +- package.py | 16 +++++++++------- {debian => pkg/arch}/dupeguru.desktop | 0 pkg/arch/me.json | 7 +++++++ pkg/arch/pe.json | 7 +++++++ pkg/arch/se.json | 7 +++++++ {debian => pkg/debian}/Makefile | 0 {debian => pkg/debian}/build_pe_modules.py | 0 {debian => pkg/debian}/compat | 0 {debian => pkg/debian}/control | 0 {debian => pkg/debian}/copyright | 0 {debian => pkg/debian}/dirs | 0 pkg/debian/dupeguru.desktop | 8 ++++++++ {debian => pkg/debian}/me.json | 0 {debian => pkg/debian}/pe.json | 0 {debian => pkg/debian}/rules | 0 {debian => pkg/debian}/se.json | 0 17 files changed, 39 insertions(+), 8 deletions(-) rename {debian => pkg/arch}/dupeguru.desktop (100%) create mode 100644 pkg/arch/me.json create mode 100644 pkg/arch/pe.json create mode 100644 pkg/arch/se.json rename {debian => pkg/debian}/Makefile (100%) rename {debian => pkg/debian}/build_pe_modules.py (100%) rename {debian => pkg/debian}/compat (100%) rename {debian => pkg/debian}/control (100%) rename {debian => pkg/debian}/copyright (100%) rename {debian => pkg/debian}/dirs (100%) create mode 100644 pkg/debian/dupeguru.desktop rename {debian => pkg/debian}/me.json (100%) rename {debian => pkg/debian}/pe.json (100%) rename {debian => pkg/debian}/rules (100%) rename {debian => pkg/debian}/se.json (100%) diff --git a/README.md b/README.md index d7b4f181..a7ad9da3 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This folder contains the source for dupeGuru. Its documentation is in ``help``, * cocoa: UI code for the Cocoa toolkit. It's Objective-C code. * qt: UI code for the Qt toolkit. It's written in Python and uses PyQt. * images: Images used by the different UI codebases. -* debian: Skeleton files required to create a .deb package +* pkg: Skeleton files required to create different packages * help: Help document, written for Sphinx. * locale: .po files for localisation. diff --git a/package.py b/package.py index ae0b2363..bd5ed6eb 100644 --- a/package.py +++ b/package.py @@ -19,7 +19,6 @@ from hscommon.plat import ISWINDOWS, ISLINUX from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, build_debian_changelog, copy_qt_plugins, get_module_version, filereplace, copy, setup_package_argparser, package_cocoa_app_in_dmg, copy_all) -from hscommon.util import find_in_path def parse_args(): parser = ArgumentParser() @@ -135,15 +134,16 @@ def package_debian_distribution(edition, distribution): os.mkdir(op.join(destpath, 'modules')) copy_all(op.join('core_pe', 'modules', '*.*'), op.join(destpath, 'modules')) copy(op.join('qt', 'pe', 'modules', 'block.c'), op.join(destpath, 'modules', 'block_qt.c')) - copy(op.join('debian', 'build_pe_modules.py'), op.join(destpath, 'build_pe_modules.py')) + copy(op.join('pkg', 'debian', 'build_pe_modules.py'), op.join(destpath, 'build_pe_modules.py')) debdest = op.join(destpath, 'debian') + debskel = op.join('pkg', 'debian') os.makedirs(debdest) - debopts = json.load(open(op.join('debian', ed('{}.json')))) + debopts = json.load(open(op.join(debskel, ed('{}.json')))) for fn in ['compat', 'copyright', 'dirs', 'rules']: - copy(op.join('debian', fn), op.join(debdest, fn)) - filereplace(op.join('debian', 'control'), op.join(debdest, 'control'), **debopts) - filereplace(op.join('debian', 'Makefile'), op.join(destpath, 'Makefile'), **debopts) - filereplace(op.join('debian', 'dupeguru.desktop'), op.join(debdest, ed('dupeguru_{}.desktop')), **debopts) + 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) + filereplace(op.join(debskel, 'dupeguru.desktop'), op.join(debdest, ed('dupeguru_{}.desktop')), **debopts) changelogpath = op.join('help', ed('changelog_{}')) changelog_dest = op.join(debdest, 'changelog') project_name = debopts['pkgname'] @@ -173,6 +173,8 @@ def package_arch(edition): packages.append('hsaudiotag') copy_files_to_package(srcpath, packages, with_so=True) shutil.copy(op.join('images', ed('dg{}_logo_128.png')), srcpath) + debopts = json.load(open(op.join('pkg', 'arch', ed('{}.json')))) + filereplace(op.join('pkg', 'arch', 'dupeguru.desktop'), op.join(srcpath, ed('dupeguru-{}.desktop')), **debopts) def package_source_tgz(edition): if not op.exists('deps'): diff --git a/debian/dupeguru.desktop b/pkg/arch/dupeguru.desktop similarity index 100% rename from debian/dupeguru.desktop rename to pkg/arch/dupeguru.desktop diff --git a/pkg/arch/me.json b/pkg/arch/me.json new file mode 100644 index 00000000..c0c79a65 --- /dev/null +++ b/pkg/arch/me.json @@ -0,0 +1,7 @@ +{ + "pkgname": "dupeguru-me", + "longname": "dupeGuru Music Edition", + "execname": "dupeguru-me", + "arch": "all", + "iconpath": "/usr/share/dupeguru-me/dgme_logo_128.png" +} \ No newline at end of file diff --git a/pkg/arch/pe.json b/pkg/arch/pe.json new file mode 100644 index 00000000..dfef16a1 --- /dev/null +++ b/pkg/arch/pe.json @@ -0,0 +1,7 @@ +{ + "pkgname": "dupeguru-pe", + "longname": "dupeGuru Picture Edition", + "execname": "dupeguru-pe", + "arch": "any", + "iconpath": "/usr/share/dupeguru-pe/dgpe_logo_128.png" +} \ No newline at end of file diff --git a/pkg/arch/se.json b/pkg/arch/se.json new file mode 100644 index 00000000..13691917 --- /dev/null +++ b/pkg/arch/se.json @@ -0,0 +1,7 @@ +{ + "pkgname": "dupeguru-se", + "longname": "dupeGuru", + "execname": "dupeguru-se", + "arch": "all", + "iconpath": "/usr/share/dupeguru-se/dgse_logo_128.png" +} \ No newline at end of file diff --git a/debian/Makefile b/pkg/debian/Makefile similarity index 100% rename from debian/Makefile rename to pkg/debian/Makefile diff --git a/debian/build_pe_modules.py b/pkg/debian/build_pe_modules.py similarity index 100% rename from debian/build_pe_modules.py rename to pkg/debian/build_pe_modules.py diff --git a/debian/compat b/pkg/debian/compat similarity index 100% rename from debian/compat rename to pkg/debian/compat diff --git a/debian/control b/pkg/debian/control similarity index 100% rename from debian/control rename to pkg/debian/control diff --git a/debian/copyright b/pkg/debian/copyright similarity index 100% rename from debian/copyright rename to pkg/debian/copyright diff --git a/debian/dirs b/pkg/debian/dirs similarity index 100% rename from debian/dirs rename to pkg/debian/dirs diff --git a/pkg/debian/dupeguru.desktop b/pkg/debian/dupeguru.desktop new file mode 100644 index 00000000..50f5f607 --- /dev/null +++ b/pkg/debian/dupeguru.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name={longname} +Comment=Find duplicate files. +Exec={execname} +Icon={iconpath} +Terminal=false +Type=Application +Categories=Utility; diff --git a/debian/me.json b/pkg/debian/me.json similarity index 100% rename from debian/me.json rename to pkg/debian/me.json diff --git a/debian/pe.json b/pkg/debian/pe.json similarity index 100% rename from debian/pe.json rename to pkg/debian/pe.json diff --git a/debian/rules b/pkg/debian/rules similarity index 100% rename from debian/rules rename to pkg/debian/rules diff --git a/debian/se.json b/pkg/debian/se.json similarity index 100% rename from debian/se.json rename to pkg/debian/se.json