5 dh_icons - Update Freedesktop icon caches
11 use Debian::Debhelper::Dh_Lib;
15 B<dh_icons> [S<I<debhelper options>>] [B<-n>]
19 B<dh_icons> is a debhelper program that updates Freedesktop icon caches
20 when needed, using the B<update-icon-caches> program provided by GTK+2.12.
21 Currently this program does not handle installation of the files, though it
22 may do so at a later date, so should be run after icons are installed in
23 the package build directories.
25 It takes care of adding maintainer script fragments to call
26 B<update-icon-caches> for icon directories. (This is not done for gnome and
27 hicolor icons, as those are handled by triggers.)
28 These commands are inserted into the maintainer scripts by L<dh_installdeb(1)>.
34 =item B<-n>, B<--noscripts>
36 Do not modify maintainer scripts.
44 my $baseicondir="/usr/share/icons";
46 foreach my $package (@{$dh{DOPACKAGES}}) {
47 my $tmp=tmpdir($package);
48 my $icondir="$tmp$baseicondir";
51 opendir(DIRHANDLE, $icondir);
52 while (my $subdir = readdir(DIRHANDLE)) {
53 next if $subdir =~ /^\./;
54 next if $subdir eq "gnome";
55 next if $subdir eq "hicolor";
58 $needs_cache = 1 if -f and (/\.png$/ or /\.svg$/ or /\.xpm$/ or /\.icon$/);
59 }, "$icondir/$subdir" ;
60 push @dirlist, "$baseicondir/$subdir" if $needs_cache;
62 if (@dirlist and ! $dh{NOSCRIPTS}) {
63 my $list=join(" ", @dirlist);
64 autoscript($package,"postinst","postinst-icons","s%#DIRLIST#%$list%");
65 autoscript($package,"postrm","postrm-icons","s%#DIRLIST#%$list%");
74 This program is a part of debhelper.
78 Ross Burton <ross@burtonini.com>
79 Jordi Mallach <jordi@debian.org>
80 Josselin Mouette <joss@debian.org>