5 dh_installwm - register a window manager
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_installwm> [S<I<debhelper options>>] [B<-n>] [B<--priority=>I<n>] [S<I<wm> ...>]
18 B<dh_installwm> is a debhelper program that is responsible for
19 generating the F<postinst> and F<postrm> commands that register a window manager
20 with L<update-alternatives(8)>. The window manager's man page is also
21 registered as a slave symlink (in v6 mode and up), if it is found in
22 F<usr/share/man/man1/> in the package build directory.
28 =item debian/I<package>.wm
30 List window manager programs to register.
38 =item B<--priority=>I<n>
40 Set the priority of the window manager. Default is 20, which is too low for
41 most window managers; see the Debian Policy document for instructions on
42 calculating the correct value.
44 =item B<-n>, B<--noscripts>
46 Do not modify F<postinst>/F<postrm> scripts. Turns this command into a no-op.
50 Window manager programs to register.
56 Note that this command is not idempotent. L<dh_prep(1)> should be called
57 between invocations of this command. Otherwise, it may cause multiple
58 instances of the same text to be added to maintainer scripts.
64 if (! defined $dh{PRIORITY}) {
69 # This is here for backwards compatibility. If the filename doesn't
70 # include a path, assume it's in /usr/bin.
71 if ($ARGV[0] !~ m:/:) {
72 $ARGV[0]="/usr/bin/$ARGV[0]";
76 foreach my $package (@{$dh{DOPACKAGES}}) {
77 my $tmp=tmpdir($package);
78 my $file=pkgfile($package,"wm");
82 @wm=filearray($file, '.');
85 if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
89 if (! $dh{NOSCRIPTS}) {
90 WM: foreach my $wm (@wm) {
91 autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:");
95 foreach my $ext (".1", ".1x") {
96 $wmman="/usr/share/man/man1/".basename($wm).$ext;
97 if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") {
98 autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:;s:#WMMAN#:$wmman.gz:;s/#PRIORITY#/$dh{PRIORITY}/",);
103 autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:;s/#PRIORITY#/$dh{PRIORITY}/",);
112 This program is a part of debhelper.
116 Joey Hess <joeyh@debian.org>