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
26 package build directory.
28 Your package should depend on xfonts-utils 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. These commands are inserted into the maintainer
34 scripts by dh_installdeb. See L<dh_installdeb(1)> for an explanation of how
39 See L<update-fonts-alias(8)>, L<update-fonts-scale(8)>, and
40 L<update-fonts-dir(8)> for more information about X font installation.
42 See Debian policy, section 11.8.5. for details about doing fonts the Debian
49 foreach my $package (@{$dh{DOPACKAGES}}) {
50 my $tmp=tmpdir($package);
52 # Find all font directories in the package build directory.
54 foreach my $parentdir ("$tmp/usr/X11R6/lib/X11/fonts/", "$tmp/usr/share/fonts/X11/") {
55 opendir DIR, $parentdir || next;
56 @fontdirs = grep { -d "$parentdir/$_" && !/^\./ } (readdir DIR);
61 # Figure out what commands the postinst and postrm will need
64 foreach my $f (@fontdirs) {
65 # This must come before update-fonts-dir.
66 push @cmds, "update-fonts-scale $f"
67 if -f "$tmp/etc/X11/fonts/$f/$package.scale";
68 push @cmds, "update-fonts-dir --x11r7-layout $f";
69 push @cmds, "update-fonts-alias $f"
70 if -f "$tmp/etc/X11/fonts/$f/$package.alias";
73 autoscript($package, "postinst", "postinst-xfonts",
74 "s:#CMDS#:".join(";", @cmds).":;");
75 autoscript($package, "postrm", "postrm-xfonts",
76 "s:#CMDS#:".join(";", @cmds).":;");
78 addsubstvar($package, "misc:Depends", "xfonts-utils");
82 addsubstvar($package, "misc:Depends", "xfonts-utils", "", 1);
90 This program is a part of debhelper.
94 Joey Hess <joeyh@debian.org>