5 dh_installxfonts - register X fonts
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_installxfonts> [S<I<debhelper options>>]
18 dh_installxfonts is a debhelper program that is responsible for
19 registering X fonts, so their corresponding fonts.dir, fonts.alias,
20 and fonts.scale be rebuilt properly at install time.
22 Before calling this program, you should have installed any X fonts provided
23 by your package into the appropriate location in the package build
24 directory, and if you have fonts.alias or fonts.scale files, you should
25 install them into the correct location under etc/X11/fonts in your package
28 Your package should depend on xutils (>= 4.0.3) so that the
29 update-fonts-* commands are available. (This program adds that dependency to
32 This program automatically generates the postinst and postrm commands needed
33 to register X fonts. See L<dh_installdeb(1)> for an explanation of how this
38 See L<update-fonts-alias(8)>, L<update-fonts-scale(8)>, and
39 L<update-fonts-dir(8)> for more information about X font installation.
41 See Debian policy, section 11.8.5. for details about doing fonts the Debian
48 foreach my $package (@{$dh{DOPACKAGES}}) {
49 my $tmp=tmpdir($package);
50 my $XFONTDIR="$tmp/usr/X11R6/lib/X11/fonts/";
52 # Find all font directories in the package build directory.
53 opendir DIR, $XFONTDIR || next;
54 my @fontdirs = grep { -d "$XFONTDIR/$_" && !/^\./ } (readdir DIR);
58 # Figure out what commands the postinst and postrm will need
61 foreach my $f (@fontdirs) {
62 # This must come before update-fonts-dir.
63 push @cmds, "update-fonts-scale $f"
64 if -f "$tmp/etc/X11/fonts/$f/$package.scale";
65 push @cmds, "update-fonts-dir $f";
66 push @cmds, "update-fonts-alias $f"
67 if -f "$tmp/etc/X11/fonts/$f/$package.alias";
70 autoscript($package, "postinst", "postinst-xfonts",
71 "s:#CMDS#:".join(";", @cmds).":;");
72 autoscript($package, "postrm", "postrm-xfonts",
73 "s:#CMDS#:".join(";", @cmds).":;");
75 addsubstvar($package, "misc:Depends", "xutils", ">= 4.0.3");
79 addsubstvar($package, "misc:Depends", "xutils", ">= 4.0.3", 1);
87 This program is a part of debhelper.
91 Joey Hess <joeyh@debian.org>