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 dh_installwm is a debhelper program that is responsible for
19 generating the postinst and 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 usr/share/man/man1/ in the package build directory.
24 Any window manager programs specified as parameters will be registered in
25 the first package dh_installwm is told to act on. By default, this is the
26 first binary package in debian/control, but if you use -p, -i, or -a flags,
27 it will be the first package specified by those flags.
29 Files named debian/package.wm can list other window manager programs to
36 =item B<--priority=>I<n>
38 Set the priority of the window manager. Default is 20, which is too low for
39 most window managers; see the Debian Policy document for instructions on
40 calculating the correct value.
42 =item B<-n>, B<--noscripts>
44 Do not modify postinst/postrm scripts. Turns this command into a no-op.
48 The commands used to run the window manager or window managers you want to
55 Note that this command is not idempotent. L<dh_prep(1)> should be called
56 between invocations of this command. Otherwise, it may cause multiple
57 instances of the same text to be added to maintainer scripts.
63 if (! defined $dh{PRIORITY}) {
68 # This is here for backwards compatibility. If the filename doesn't
69 # include a path, assume it's in /usr/bin.
70 if ($ARGV[0] !~ m:/:) {
71 $ARGV[0]="/usr/bin/$ARGV[0]";
75 foreach my $package (@{$dh{DOPACKAGES}}) {
76 my $tmp=tmpdir($package);
77 my $file=pkgfile($package,"wm");
81 @wm=filearray($file, '.');
84 if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) {
88 if (! $dh{NOSCRIPTS}) {
89 WM: foreach my $wm (@wm) {
90 autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:");
94 foreach my $ext (".1", ".1x") {
95 $wmman="/usr/share/man/man1/".basename($wm).$ext;
96 if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") {
97 autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:;s:#WMMAN#:$wmman.gz:;s/#PRIORITY#/$dh{PRIORITY}/",);
102 autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:;s/#PRIORITY#/$dh{PRIORITY}/",);
111 This program is a part of debhelper.
115 Joey Hess <joeyh@debian.org>