]> git.donarmstrong.com Git - debhelper.git/blob - dh_gconf
Updated French man page translation. Closes: #685560
[debhelper.git] / dh_gconf
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_gconf - install GConf defaults files and register schemas
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<--priority=>I<priority>]
15
16 =head1 DESCRIPTION
17
18 B<dh_gconf> is a debhelper program that is responsible for installing GConf
19 defaults files and registering GConf schemas.
20
21 An appropriate dependency on gconf2 will be generated in B<${misc:Depends}>.
22
23 =head1 FILES
24
25 =over 4
26
27 =item debian/I<package>.gconf-defaults
28
29 Installed into F<usr/share/gconf/defaults/10_package> in the package build
30 directory, with I<package> replaced by the package name.
31
32 =item debian/I<package>.gconf-mandatory
33
34 Installed into F<usr/share/gconf/mandatory/10_package> in the package build
35 directory, with I<package> replaced by the package name.
36
37 =back
38
39 =head1 OPTIONS
40
41 =over 4
42
43 =item B<--priority> I<priority>
44
45 Use I<priority> (which should be a 2-digit number) as the defaults
46 priority instead of B<10>. Higher values than ten can be used by 
47 derived distributions (B<20>), CDD distributions (B<50>), or site-specific
48 packages (B<90>).
49
50 =back
51
52 =cut
53
54 init();
55
56 my $priority=10;
57 if (defined $dh{PRIORITY}) {
58         $priority=$dh{PRIORITY};
59 }
60
61 foreach my $package (@{$dh{DOPACKAGES}}) {
62         my $tmp=tmpdir($package);
63         
64         my $gconf_dep = 0;
65         my $mandatory = pkgfile($package, "gconf-mandatory");
66         if ($mandatory ne '') {
67                 doit("mkdir","-p","$tmp/usr/share/gconf/mandatory");
68                 doit("install","-p","-m644",$mandatory,"$tmp/usr/share/gconf/mandatory/${priority}_$package");
69                 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.28.1-2)");
70                 $gconf_dep = 1;
71         }
72         my $defaults = pkgfile($package,"gconf-defaults");
73         if ($defaults ne '') {
74                 doit("mkdir","-p","$tmp/usr/share/gconf/defaults");
75                 doit("install","-p","-m644",$defaults,"$tmp/usr/share/gconf/defaults/${priority}_$package");
76                 addsubstvar($package, "misc:Depends", "gconf2 (>= 2.28.1-2)") unless $gconf_dep;
77                 $gconf_dep = 1;
78         }
79
80         my $old_schemas_dir = "$tmp/etc/gconf/schemas";
81         my $new_schemas_dir = "$tmp/usr/share/gconf/schemas";
82
83         # Migrate schemas from /etc/gconf/schemas to /usr/share/gconf/schemas
84         if (-d $old_schemas_dir) {
85                 doit("mkdir -p $new_schemas_dir") unless -d $new_schemas_dir;
86                 doit("mv $old_schemas_dir/*.schemas $new_schemas_dir/");
87                 doit("rmdir -p --ignore-fail-on-non-empty $old_schemas_dir");
88         }
89
90         if (-d "$new_schemas_dir") {
91                 # Get a list of the schemas
92                 my $schemas = `find $new_schemas_dir -type f -name \\*.schemas -printf '%P '`;
93                 if ($schemas ne '') {
94                         addsubstvar($package, "misc:Depends", "gconf2 (>= 2.28.1-2)") unless $gconf_dep;
95                 }
96         }
97 }
98
99 =head1 SEE ALSO
100
101 L<debhelper(7)>
102
103 This program is a part of debhelper.
104
105 =head1 AUTHOR
106
107 Ross Burton <ross@burtonini.com>
108 Josselin Mouette <joss@debian.org>
109
110 =cut