diff options
Diffstat (limited to 'dh_installxfonts')
-rwxr-xr-x | dh_installxfonts | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/dh_installxfonts b/dh_installxfonts index 6c699611..3611a8c2 100755 --- a/dh_installxfonts +++ b/dh_installxfonts @@ -19,19 +19,26 @@ dh_installxfonts is a debhelper program that is responsible for registering X fonts, so their corresponding fonts.dir, fonts.alias, and fonts.scale be rebuilt properly at install time. -Before calling this program, you should have installed any X fonts -provided by your package into the appropriate location in the package build -directory. Also, your package should depend on xbase-clients (>= -3.3.3.1-5). +Before calling this program, you should have installed any X fonts provided +by your package into the appropriate location in the package build +directory, and if you have fonts.alias or fonts.scale files, you should +install them into the correct location under etc/X11/fonts in your package +build directory. -It automatically generates the postinst and postrm commands needed to -register X fonts. See L<dh_installdeb(1)> for an explanation of how this +Your package should should depend on xutils (>= 4.0.3) so that the +update-fonts-* commands are available. + +This programt automatically generates the postinst and postrm commands needed +to register X fonts. See L<dh_installdeb(1)> for an explanation of how this works. =head1 NOTES -See L<update-fonts-alias(8)>, L<update-fonts-scale(8)>, and L<mkfontdir(1x)> -for more information about X font installation. +See L<update-fonts-alias(8)>, L<update-fonts-scale(8)>, and +L<update-fonts-dir(8)> for more information about X font installation. + +See Debian policy, section 12.8.5. for details about doing fonts the Debian +way. =cut @@ -41,28 +48,26 @@ foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $XFONTDIR="$tmp/usr/X11R6/lib/X11/fonts/"; - # Find all fint directories in the package build directory. + # Find all font directories in the package build directory. opendir DIR, $XFONTDIR || next; my @fontdirs = grep { -d "$XFONTDIR/$_" && !/^\./ } (readdir DIR); closedir DIR; if (@fontdirs) { - # Figure out what commands the postinst will need to call. - my @updatecmds=('makefontdir'); + # Figure out what commands the postinst and postrm will need + # to call. + my @cmds; foreach my $f (@fontdirs) { - push @updatecmds, 'update-fonts-alias' + push @cmds, "update-fonts-dir $f"; + push @cmds, "update-fonts-alias $f" if -f "$tmp/etc/X11/fonts/$f/$package.alias"; # This must come _before_ mkfontdir, thus the unshift. - unshift @updatecmds, 'update-fonts-scale' + unshift @cmds, "update-fonts-scale $f" if -f "$tmp/etc/X11/fonts/$f/$package.scale"; } autoscript($package, "postinst", "postinst-xfonts", - "s:#FONTDIRS#:".join(' ', @fontdirs). - ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":"); - autoscript($package, "postrm", "postrm-xfonts", - "s:#FONTDIRS#:".join(' ', @fontdirs). - ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":"); + "s:#CMDS#:".join("\n", @cmds).":;"); } } |