5 dh_gconf - generate GConf schema registration scripts
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_gconf> [S<I<debhelper options>>] [B<--priority=<number>>]
18 dh_gconf is a debhelper program that is responsible for registering
21 It automatically generates the postinst and prerm fragments needed
22 to register and unregister the schemas in usr/share/gconf/schemas, using
25 If a file named debian/package.gconf-defaults exists, then it is
26 installed into usr/share/gconf/defaults/10_package in the package build
27 directory, with "package" replaced by the package name. Some postinst and
28 postrm fragments will be generated to launch update-gconf-defaults.
30 The gconf-schemas and update-gconf-defaults scripts are provided by the
31 gconf2 package. An appropriate dependency will be generated in
38 =item B<--priority> I<priority>
40 Use I<priority> (which should be a 2-digit number) as the defaults
41 priority instead of 10. Higher values than ten can be used by
42 derived distributions (20), CDD distributions (50), or site-specific
50 if (defined $dh{PRIORITY}) {
51 $priority=$dh{PRIORITY};
54 foreach my $package (@{$dh{DOPACKAGES}}) {
55 my $tmp=tmpdir($package);
58 my $defaults = pkgfile($package,"gconf-defaults");
59 if ($defaults ne '') {
60 doit("mkdir","-p","$tmp/usr/share/gconf/defaults");
61 doit("install","-p","-m644",$defaults,"$tmp/usr/share/gconf/defaults/${priority}_$package");
62 autoscript($package,"postinst","postinst-gconf-defaults");
63 autoscript($package,"postrm","postrm-gconf-defaults");
64 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.12.1-1)");
68 my $old_schemas_dir = "$tmp/etc/gconf/schemas";
69 my $new_schemas_dir = "$tmp/usr/share/gconf/schemas";
71 # Migrate schemas from /etc/gconf/schemas to /usr/share/gconf/schemas
72 if (-d $old_schemas_dir) {
73 doit("mkdir -p $new_schemas_dir") unless -d $new_schemas_dir;
74 doit("mv $old_schemas_dir/*.schemas $new_schemas_dir/");
75 doit("rmdir -p --ignore-fail-on-non-empty $old_schemas_dir");
78 if (-d "$new_schemas_dir") {
79 # Get a list of the schemas
80 my $schemas = `find $new_schemas_dir -type f -name \\*.schemas -printf '%P '`;
82 autoscript($package,"postinst","postinst-gconf","s%#SCHEMAS#%$schemas%");
83 autoscript($package,"prerm","prerm-gconf","s%#SCHEMAS#%$schemas%");
84 autoscript($package,"postrm","postrm-gconf","s%#SCHEMAS#%$schemas%");
85 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.10.1-2)") unless $gconf_dep;
94 This program is a part of debhelper.
98 Ross Burton <ross@burtonini.com>
99 Josselin Mouette <joss@debian.org>