[kupfer] Update mime database when installing, allow --no-update-mime option
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] Update mime database when installing, allow --no-update-mime option
- Date: Thu, 11 Feb 2010 19:45:07 +0000 (UTC)
commit daf0a16722ef856c50167c9a9dd71b411f7327b4
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Thu Feb 11 20:43:20 2010 +0100
Update mime database when installing, allow --no-update-mime option
auxdata/wscript | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
auxdata/wscript_build | 27 --------------------------
wscript | 9 +++++--
3 files changed, 56 insertions(+), 30 deletions(-)
---
diff --git a/auxdata/wscript b/auxdata/wscript
new file mode 100644
index 0000000..916b0d1
--- /dev/null
+++ b/auxdata/wscript
@@ -0,0 +1,50 @@
+#! /usr/bin/env python
+
+import Options
+import Utils
+
+def set_options(opt):
+ opt.add_option('--no-update-mime',
+ action='store_true',
+ default=False,
+ help='Do not update mime and desktop databases [Default:Update]')
+
+def configure(conf):
+ if not Options.options.no_update_mime:
+ conf.env["AUXDATA_MIME"] = 1
+
+
+def build(bld):
+ # merge translations into the .desktop file
+ # and set it up to be installed
+ def install_desktop_file(desktop_subst_file):
+ bld.new_task_gen(
+ "intltool_in",
+ podir="../po",
+ flags = ("-d", "-q", "-u", "-c"),
+ source = desktop_subst_file + ".in",
+ target = desktop_subst_file,
+ install_path = "${DATADIR}/applications",
+ chmod = 0755,
+ )
+
+ install_desktop_file("kupfer.desktop")
+ install_desktop_file("kupfer-exec.desktop")
+
+ # install mimetype descriptions
+
+ mimetypes_file = "kupfer-mimetypes.xml"
+ bld.new_task_gen(
+ "intltool_in",
+ podir="../po",
+ flags = ("-x", "-q", "-u", "-c"),
+ source = mimetypes_file + ".in",
+ target = mimetypes_file,
+ install_path = "${DATADIR}/mime/packages/",
+ )
+
+ if bld.is_install and bld.env["AUXDATA_MIME"]:
+ bld.exec_command(["update-mime-database",
+ Utils.subst_vars("${DATADIR}/mime", bld.env)])
+ bld.exec_command(["update-desktop-database",
+ Utils.subst_vars("${DATADIR}/applications", bld.env)])
diff --git a/wscript b/wscript
index aad4194..e165318 100644
--- a/wscript
+++ b/wscript
@@ -51,6 +51,9 @@ _read_git_version()
srcdir = '.'
blddir = 'build'
+config_subdirs = "auxdata extras"
+build_subdirs = "auxdata data po extras"
+
EXTRA_DIST = [
"waf",
"GIT_VERSION",
@@ -99,7 +102,7 @@ def set_options(opt):
opt.add_option('--pyo',action='store_true',default=False,help='Install optimised compiled .pyo files [Default:not install]',dest='pyo')
opt.add_option('--no-runtime-deps',action='store_false',default=True,
help='Do not check for any runtime dependencies',dest='check_deps')
- opt.sub_options("extras")
+ opt.sub_options(config_subdirs)
def configure(conf):
conf.check_tool("python")
@@ -111,7 +114,7 @@ def configure(conf):
conf.env["KUPFER"] = Utils.subst_vars("${BINDIR}/kupfer", conf.env)
conf.env["VERSION"] = VERSION
- conf.sub_config("extras")
+ conf.sub_config(config_subdirs)
# Setup PYTHONDIR so we install into $DATADIR
conf.env["PYTHONDIR"] = Utils.subst_vars("${DATADIR}/kupfer", conf.env)
@@ -254,7 +257,7 @@ def build(bld):
bld.symlink_as("${MANDIR}/man1/kupfer-exec.1.gz", man_path)
# Separate subdirectories
- bld.add_subdirs("po auxdata data extras")
+ bld.add_subdirs(build_subdirs)
def intlupdate(util):
print "You should use intltool-update directly."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]