]> git.donarmstrong.com Git - debhelper.git/blob - dh_desktop
r1730: releasing version 4.2.27
[debhelper.git] / dh_desktop
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_desktop - Register .desktop files
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_desktop> [S<I<debhelper options>>] [B<-p<package>>]
15
16 =head1 DESCRIPTION
17
18 dh_desktop is a debhelper program that registers .desktop files.
19 Currently this program does not handle installation of the files, though it
20 may do so at a later date. It takes care of adding maintainer script
21 fragements to call F<update-desktop-database>.
22
23 =cut
24
25 init();
26
27 foreach my $package (@{$dh{DOPACKAGES}}) {
28         my $tmp=tmpdir($package);
29
30         if (-d "$tmp/usr/share/applications") {
31                 # Get a list of the desktop files that are in
32                 # usr/share/applications and thus might need
33                 # update-desktop-database be called. Other desktop
34                 # files don't.
35                 my $desktop_files = `find $tmp/usr/share/applications -type f -name \\*.desktop -printf '%p\n'`;
36                 if ($desktop_files && ! $dh{NOSCRIPTS}) {
37                         autoscript($package,"postinst","postinst-desktop");
38                         autoscript($package,"postrm","postrm-desktop");
39                 }
40         }
41 }
42
43 =head1 SEE ALSO
44
45 L<debhelper>
46
47 This program is a part of debhelper.
48
49 =head1 AUTHOR
50
51 Ross Burton <ross@burtonini.com>
52
53 =cut