Commits

elbaschid committed 81a9e52

added command to install gconf schema

  • Participants
  • Parent commits a72176e

Comments (0)

Files changed (1)

 # 
 # You should have received a copy of the GNU General Public License
 
+import os
+import sys
+import glob
+import subprocess
+
 from distutils.core import setup
 from DistUtilsExtra.command import *
 
-
-import revelation_indicator
+schema_files = glob.glob('data/gconf/*.schemas')
 
 setup(
     name = 'revelation_indicator',
     provides = [],
     license = 'GNU General Public License (GPL)',
 
-    data_files = [],
+    data_files = [
+        (sys.prefix+'/share/gconf/schemas', schema_files),
+    ],
 
     cmdclass = { 
         "build" : build_extra.build_extra,
         'Programming Language :: Python',
     ]
 )
+
+
+config_source = subprocess.check_output([
+    'gconftool-2',
+    '--get-default-source'
+]).strip()
+for schema_file in [os.path.basename(f) for f in schema_files]:
+    cmd = ' '.join([
+        "GCONF_CONFIG_SOURCE=%s" % config_source,
+        "gconftool-2",
+        "--makefile-install-rule",
+        sys.prefix+'/share/gconf/schemas/'+schema_file
+    ])
+    output = subprocess.check_output(cmd, shell=True)