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 should depend on xutils (>= 4.0.3) so that the
29 update-fonts-* commands are available.
31 This programt automatically generates the postinst and postrm commands needed
32 to register X fonts. See L<dh_installdeb(1)> for an explanation of how this
37 See L<update-fonts-alias(8)>, L<update-fonts-scale(8)>, and
38 L<update-fonts-dir(8)> for more information about X font installation.
40 See Debian policy, section 12.8.5. for details about doing fonts the Debian
47 foreach my $package (@{$dh{DOPACKAGES}}) {
48 my $tmp=tmpdir($package);
49 my $XFONTDIR="$tmp/usr/X11R6/lib/X11/fonts/";
51 # Find all font directories in the package build directory.
52 opendir DIR, $XFONTDIR || next;
53 my @fontdirs = grep { -d "$XFONTDIR/$_" && !/^\./ } (readdir DIR);
57 # Figure out what commands the postinst and postrm will need
60 foreach my $f (@fontdirs) {
61 push @cmds, "update-fonts-dir $f";
62 push @cmds, "update-fonts-alias $f"
63 if -f "$tmp/etc/X11/fonts/$f/$package.alias";
64 # This must come _before_ mkfontdir, thus the unshift.
65 unshift @cmds, "update-fonts-scale $f"
66 if -f "$tmp/etc/X11/fonts/$f/$package.scale";
69 autoscript($package, "postinst", "postinst-xfonts",
70 "s:#CMDS#:".join("\n", @cmds).":;");
78 This program is a part of debhelper.
82 Joey Hess <joeyh@debian.org>