mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-05-12 03:29:49 +00:00
Cleanup packaging after editions unification and "runtime packaging" (install)
* Requires "Add runtime packaging parameter for package.py" in hscommon
This commit is contained in:
parent
bdd404ce0e
commit
5d4bf175ac
33
package.py
33
package.py
@ -6,6 +6,7 @@
|
||||
|
||||
import os
|
||||
import os.path as op
|
||||
import stat
|
||||
import compileall
|
||||
import shutil
|
||||
import json
|
||||
@ -59,7 +60,7 @@ def package_debian_distribution(distribution):
|
||||
debdest = op.join(destpath, 'debian')
|
||||
debskel = op.join('pkg', 'debian')
|
||||
os.makedirs(debdest)
|
||||
debopts = json.load(open(op.join(debskel, 'se.json')))
|
||||
debopts = json.load(open(op.join(debskel, 'dupeguru.json')))
|
||||
for fn in ['compat', 'copyright', 'dirs', 'rules']:
|
||||
copy(op.join(debskel, fn), op.join(debdest, fn))
|
||||
filereplace(op.join(debskel, 'control'), op.join(debdest, 'control'), **debopts)
|
||||
@ -95,7 +96,7 @@ def package_arch():
|
||||
]
|
||||
copy_files_to_package(srcpath, packages, with_so=True)
|
||||
shutil.copy(op.join('images', 'dgse_logo_128.png'), srcpath)
|
||||
debopts = json.load(open(op.join('pkg', 'arch', 'se.json')))
|
||||
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():
|
||||
@ -111,6 +112,28 @@ def package_source_tgz():
|
||||
print_and_do('tar -rf {} deps'.format(dest))
|
||||
print_and_do('gzip {}'.format(dest))
|
||||
|
||||
def package_runtime():
|
||||
app_version = get_module_version('core')
|
||||
version = '{}'.format(app_version)
|
||||
destpath = op.join('build', 'dupeguru-{}'.format(version))
|
||||
sharepath = op.join(destpath, 'usr/share/dupeguru')
|
||||
apppath = op.join(destpath, 'usr/share/applications')
|
||||
binpath = op.join(destpath, 'usr/bin')
|
||||
packages = [
|
||||
'hscommon', 'core', 'qtlib', 'qt', 'send2trash', 'hsaudiotag'
|
||||
]
|
||||
copy_files_to_package(sharepath, packages, with_so=True)
|
||||
st = os.stat(op.join(sharepath, 'run.py'))
|
||||
os.chmod(op.join(sharepath, 'run.py'), st.st_mode | stat.S_IEXEC)
|
||||
os.mkdir(binpath)
|
||||
os.symlink(op.join('/usr/share/dupeguru/run.py'), op.join(binpath, 'dupeguru'))
|
||||
shutil.copy(op.join('images', 'dgse_logo_128.png'), sharepath)
|
||||
|
||||
debskel = op.join('pkg', 'debian')
|
||||
debopts = json.load(open(op.join(debskel, 'dupeguru.json')))
|
||||
os.mkdir(apppath)
|
||||
filereplace(op.join(debskel, 'dupeguru.desktop'), op.join(apppath, 'dupeguru.desktop'), **debopts)
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
ui = 'cocoa' if ISOSX else 'qt'
|
||||
@ -118,6 +141,12 @@ def main():
|
||||
print("Creating source package for dupeGuru")
|
||||
package_source_tgz()
|
||||
return
|
||||
|
||||
if args.runtime_pkg:
|
||||
print("Creating runtime package for dupeGuru")
|
||||
package_runtime()
|
||||
return
|
||||
|
||||
print("Packaging dupeGuru with UI {}".format(ui))
|
||||
if ui == 'cocoa':
|
||||
package_cocoa(args)
|
||||
|
7
pkg/arch/dupe.json
Normal file
7
pkg/arch/dupe.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"pkgname": "dupeguru-",
|
||||
"longname": "dupeGuru",
|
||||
"execname": "dupeguru",
|
||||
"arch": "all",
|
||||
"iconpath": "/usr/share/dupeguru/dgse_logo_128.png"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pkgname": "dupeguru-me",
|
||||
"longname": "dupeGuru Music Edition",
|
||||
"execname": "dupeguru-me",
|
||||
"arch": "all",
|
||||
"iconpath": "/usr/share/dupeguru-me/dgme_logo_128.png"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pkgname": "dupeguru-pe",
|
||||
"longname": "dupeGuru Picture Edition",
|
||||
"execname": "dupeguru-pe",
|
||||
"arch": "any",
|
||||
"iconpath": "/usr/share/dupeguru-pe/dgpe_logo_128.png"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pkgname": "dupeguru-se",
|
||||
"longname": "dupeGuru",
|
||||
"execname": "dupeguru-se",
|
||||
"arch": "all",
|
||||
"iconpath": "/usr/share/dupeguru-se/dgse_logo_128.png"
|
||||
}
|
7
pkg/debian/dupeguru.json
Normal file
7
pkg/debian/dupeguru.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"pkgname": "dupeguru",
|
||||
"longname": "dupeGuru",
|
||||
"execname": "dupeguru",
|
||||
"arch": "all",
|
||||
"iconpath": "/usr/share/dupeguru/dgse_logo_128.png"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pkgname": "dupeguru-me",
|
||||
"longname": "dupeGuru Music Edition",
|
||||
"execname": "dupeguru_me",
|
||||
"arch": "all",
|
||||
"iconpath": "/usr/share/dupeguru_me/dgme_logo_128.png"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pkgname": "dupeguru-pe",
|
||||
"longname": "dupeGuru Picture Edition",
|
||||
"execname": "dupeguru_pe",
|
||||
"arch": "any",
|
||||
"iconpath": "/usr/share/dupeguru_pe/dgpe_logo_128.png"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"pkgname": "dupeguru-se",
|
||||
"longname": "dupeGuru",
|
||||
"execname": "dupeguru_se",
|
||||
"arch": "all",
|
||||
"iconpath": "/usr/share/dupeguru_se/dgse_logo_128.png"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user