]> git.donarmstrong.com Git - debhelper.git/blob - dh_gconf
r1695: * dh_gconf: gconf schemas moved to /usr/share/gconf/schemas. Relocate
[debhelper.git] / dh_gconf
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_gconf - generate GConf schema registration scripts
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_gconf> [S<I<debhelper options>>] [B<-p<package>>]
15
16 =head1 DESCRIPTION
17
18 dh_gconf is a debhelper program that is responsible for registering
19 GConf schemas.
20
21 It automatically generates the postinst and prerm fragments needed
22 to register and unregister the schemas in etc/gconf/schemas.
23 These fragements will use gconftool-2, so the package should depend on
24 gconf2. This program will add an appropriate dependency to ${misc:Depends}.
25
26 The postinst script will also signal gconfd-2 so that the newly installed
27 schemas are available straight away.
28
29 =cut
30
31 init();
32
33
34 foreach my $package (@{$dh{DOPACKAGES}}) {
35         my $tmp=tmpdir($package);
36         my $old_schemas_dir = "$tmp/etc/gconf/schemas";
37         my $new_schemas_dir = "$tmp/usr/share/gconf/schemas";
38
39         # Migrate schemas from /etc/gconf/schemas to /usr/share/gconf/schemas
40         if (-d $old_schemas_dir) {
41                 doit("mkdir -p $new_schemas_dir") unless -d $new_schemas_dir;
42                 doit("mv $old_schemas_dir/*.schemas $new_schemas_dir/");
43                 doit("rmdir --ignore-fail-on-non-empty $old_schemas_dir");
44         }
45
46         if (-d "$new_schemas_dir") {
47                 # Get a list of the schemas
48                 my $schemas = `find $new_schemas_dir -type f -name \*.schemas -printf '%P '`;
49                 if ($schemas ne '') {
50                         autoscript($package,"postinst","postinst-gconf","s%#SCHEMAS#%$schemas%");
51                         autoscript($package,"prerm","prerm-gconf","s%#SCHEMAS#%$schemas%");
52                         autoscript($package,"postrm","postrm-gconf","s%#SCHEMAS#%$schemas%");
53                         addsubstvar($package, "misc:Depends", "gconf2 (>= 2.6.2-1)");
54                 }
55         }
56 }
57
58 =head1 SEE ALSO
59
60 L<debhelper(7)>
61
62 This program is a part of debhelper.
63
64 =head1 AUTHOR
65
66 Ross Burton <ross@burtonini.com>
67
68 =cut