5 dh_installxfonts - register X fonts
10 use Debian::Debhelper::Dh_Lib;
14 dh_installxfonts [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
23 provided by your package into the appropriate location in the package build
24 directory. Also, your package should depend on xbase-clients (>=
27 It automatically generates the postinst and postrm commands needed to
28 register X fonts. See L<dh_installdeb(1)> for an explanation of how this
33 See L<update-fonts-alias(8)>, L<update-fonts-scale(8)>, and L<mkfontdir(1x)>
34 for more information about X font installation.
40 foreach my $package (@{$dh{DOPACKAGES}}) {
41 my $tmp=tmpdir($package);
42 my $XFONTDIR="$tmp/usr/X11R6/lib/X11/fonts/";
44 # Find all fint directories in the package build directory.
45 opendir DIR, $XFONTDIR || next;
46 my @fontdirs = grep { -d "$XFONTDIR/$_" && !/^\./ } (readdir DIR);
50 # Figure out what commands the postinst will need to call.
51 my @updatecmds=('makefontdir');
52 foreach my $f (@fontdirs) {
53 push @updatecmds, '/usr/sbin/update-fonts-alias'
54 if -f "$tmp/etc/X11/fonts/$f/$package.alias";
55 # This must come _before_ mkfontdir, thus the unshift.
56 unshift @updatecmds, '/usr/sbin/update-fonts-scale'
57 if -f "$tmp/etc/X11/fonts/$f/$package.scale";
60 autoscript($package, "postinst", "postinst-xfonts",
61 "s:#FONTDIRS#:".join(' ', @fontdirs).
62 ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":");
63 autoscript($package, "postrm", "postrm-xfonts",
64 "s:#FONTDIRS#:".join(' ', @fontdirs).
65 ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":");
73 This program is a part of debhelper.
77 Joey Hess <joeyh@debian.org>