3 # Integration with the Debian X11 font policy.
6 use Debian::Debhelper::Dh_Lib;
9 foreach my $package (@{$dh{DOPACKAGES}}) {
10 my $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).":");