3 # Integration with the Debian X11 font policy.
5 use Debian::Debhelper::Dh_Lib;
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
10 my $XFONTDIR="$TMP/usr/X11R6/lib/X11/fonts/";
12 # Find all fint directories in the package build directory.
13 opendir DIR, $XFONTDIR || next;
14 my @fontdirs = grep { -d "$XFONTDIR/$_" && !/^\./ } (readdir DIR);
18 # Figure out what commands the postinst will need to call.
19 my @updatecmds=('/usr/bin/X11/mkfontdir');
20 foreach my $f (@fontdirs) {
21 push @updatecmds, '/usr/sbin/update-fonts-alias'
22 if -f "$TMP/etc/X11/fonts/$f/$PACKAGE.alias";
23 # This must come _before_ mkfontdir, thus the unshift.
24 unshift @updatecmds, '/usr/sbin/update-fonts-scale'
25 if -f "$TMP/etc/X11/fonts/$f/$PACKAGE.scale";
28 autoscript($PACKAGE, "postinst", "postinst-xfonts",
29 "s:#FONTDIRS#:".join(' ', @fontdirs).
30 ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":");
31 autoscript($PACKAGE, "postrm", "postrm-xfonts",
32 "s:#FONTDIRS#:".join(' ', @fontdirs).
33 ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":");