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 An appropriate dependency on gconf2 will be generated in ${misc:Depends}.
31 =item debian/I<package>.gconf-defaults
33 Installed into usr/share/gconf/defaults/10_package in the package build
34 directory, with "I<package>" replaced by the package name. Some postinst
35 and postrm fragments will be generated to run update-gconf-defaults.
37 =item debian/I<package>.gconf-mandatory
39 Installed into usr/share/gconf/mandatory/10_package in the package build
40 directory, with "I<package>" replaced by the package name, and similar
41 postinst and postrm fragments will be generated.
49 =item B<--priority> I<priority>
51 Use I<priority> (which should be a 2-digit number) as the defaults
52 priority instead of 10. Higher values than ten can be used by
53 derived distributions (20), CDD distributions (50), or site-specific
63 if (defined $dh{PRIORITY}) {
64 $priority=$dh{PRIORITY};
67 foreach my $package (@{$dh{DOPACKAGES}}) {
68 my $tmp=tmpdir($package);
71 my $mandatory = pkgfile($package, "gconf-mandatory");
72 if ($mandatory ne '') {
73 doit("mkdir","-p","$tmp/usr/share/gconf/mandatory");
74 doit("install","-p","-m644",$mandatory,"$tmp/usr/share/gconf/mandatory/${priority}_$package");
75 autoscript($package,"postinst","postinst-gconf-defaults","s%#OPT#%--mandatory%");
76 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.24.0-5)");
79 my $defaults = pkgfile($package,"gconf-defaults");
80 if ($defaults ne '') {
81 doit("mkdir","-p","$tmp/usr/share/gconf/defaults");
82 doit("install","-p","-m644",$defaults,"$tmp/usr/share/gconf/defaults/${priority}_$package");
83 autoscript($package,"postinst","postinst-gconf-defaults","s%#OPT#%%");
84 autoscript($package,"postrm","postrm-gconf-defaults","s%#OPT#%%");
85 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.12.1-1)") unless $gconf_dep;
89 my $old_schemas_dir = "$tmp/etc/gconf/schemas";
90 my $new_schemas_dir = "$tmp/usr/share/gconf/schemas";
92 # Migrate schemas from /etc/gconf/schemas to /usr/share/gconf/schemas
93 if (-d $old_schemas_dir) {
94 doit("mkdir -p $new_schemas_dir") unless -d $new_schemas_dir;
95 doit("mv $old_schemas_dir/*.schemas $new_schemas_dir/");
96 doit("rmdir -p --ignore-fail-on-non-empty $old_schemas_dir");
99 if (-d "$new_schemas_dir") {
100 # Get a list of the schemas
101 my $schemas = `find $new_schemas_dir -type f -name \\*.schemas -printf '%P '`;
102 if ($schemas ne '') {
103 autoscript($package,"postinst","postinst-gconf","s%#SCHEMAS#%$schemas%");
104 autoscript($package,"prerm","prerm-gconf","s%#SCHEMAS#%$schemas%");
105 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.10.1-2)") unless $gconf_dep;
114 This program is a part of debhelper.
118 Ross Burton <ross@burtonini.com>
119 Josselin Mouette <joss@debian.org>