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