]> git.donarmstrong.com Git - debhelper.git/blob - dh_installgsettings
Typo. Closes: #653339
[debhelper.git] / dh_installgsettings
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_installgsettings - install GSettings overrides and set dependencies
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_installgsettings> [S<I<debhelper options>>] [B<--priority=<number>>]
15
16 =head1 DESCRIPTION
17
18 B<dh_installgsettings> is a debhelper program that is responsible for installing
19 GSettings override files and generating appropriate dependencies on the
20 GSettings backend.
21
22 The dependency on the backend will be generated in B<${misc:Depends}>.
23
24 =head1 FILES
25
26 =over 4
27
28 =item debian/I<package>.gsettings-override
29
30 Installed into usr/share/glib-2.0/schemas/10_I<package>.gschema.override in
31 the package build directory, with "I<package>" replaced by the package name.
32
33 The format of the file is the following:
34
35   [org.gnome.mypackage]
36   boolean-setting=true
37   string-setting='string'
38   ...
39
40 =back
41
42 =head1 OPTIONS
43
44 =over 4
45
46 =item B<--priority> I<priority>
47
48 Use I<priority> (which should be a 2-digit number) as the override
49 priority instead of 10. Higher values than ten can be used by 
50 derived distributions (20), blend distributions (50), or site-specific
51 packages (90).
52
53 =cut
54
55 init();
56
57 my $priority=10;
58 if (defined $dh{PRIORITY}) {
59         $priority=$dh{PRIORITY};
60 }
61
62 foreach my $package (@{$dh{DOPACKAGES}}) {
63         my $tmp=tmpdir($package);
64
65         my $gsettings_schemas_dir = "$tmp/usr/share/glib-2.0/schemas/";
66
67         my $override = pkgfile($package,"gsettings-override");
68         if ($override ne '') {
69                 doit("mkdir","-p",$gsettings_schemas_dir);
70                 doit("install","-p","-m644",$override,"$gsettings_schemas_dir/${priority}_$package.gschema.override");
71         }
72
73         if (-d "$gsettings_schemas_dir") {
74                 # Get a list of the schemas
75                 my $schemas = `find $gsettings_schemas_dir -type f \\( -name \\*.xml -o -name \\*.override \\) -printf '%P '`;
76                 if ($schemas ne '') {
77                         addsubstvar($package, "misc:Depends", "dconf-gsettings-backend | gsettings-backend");
78                 }
79         }
80 }
81
82 =back
83
84 =head1 SEE ALSO
85
86 L<debhelper(7)>
87
88 This program is a part of debhelper.
89
90 =head1 AUTHOR
91
92 Laurent Bigonville <bigon@debian.org>,
93 Josselin Mouette <joss@debian.org>
94
95 =cut
96