]> git.donarmstrong.com Git - debhelper.git/blob - dh_gconf
Add FILES sections to man pages. Closes: #545041
[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<--priority=<number>>]
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 usr/share/gconf/schemas, using
23 gconf-schemas.
24
25 An appropriate dependency on gconf2 will be generated in ${misc:Depends}.
26
27 =head1 FILES
28
29 =over 4
30
31 =item debian/I<package>.gconf-defaults
32
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.
36
37 =item debian/I<package>.gconf-mandatory
38
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.
42
43 =back
44
45 =head1 OPTIONS
46
47 =over 4
48
49 =item B<--priority> I<priority>
50
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
54 packages (90).
55
56 =back
57
58 =cut
59
60 init();
61
62 my $priority=10;
63 if (defined $dh{PRIORITY}) {
64         $priority=$dh{PRIORITY};
65 }
66
67 foreach my $package (@{$dh{DOPACKAGES}}) {
68         my $tmp=tmpdir($package);
69         
70         my $gconf_dep = 0;
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)");
77                 $gconf_dep = 1;
78         }
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;
86                 $gconf_dep = 1;
87         }
88
89         my $old_schemas_dir = "$tmp/etc/gconf/schemas";
90         my $new_schemas_dir = "$tmp/usr/share/gconf/schemas";
91
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");
97         }
98
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;
106                 }
107         }
108 }
109
110 =head1 SEE ALSO
111
112 L<debhelper(7)>
113
114 This program is a part of debhelper.
115
116 =head1 AUTHOR
117
118 Ross Burton <ross@burtonini.com>
119 Josselin Mouette <joss@debian.org>
120
121 =cut