- foreach (@wm) {
- autoscript($package,"postinst","postinst-wm","s:#WM#:$_:;s/#PRIORITY#/$dh{PRIORITY}/",);
- autoscript($package,"prerm","prerm-wm","s:#WM#:$_:");
+WM: foreach my $wm (@wm) {
+ autoscript($package,"prerm","prerm-wm","s:#WM#:$wm:");
+
+ my $wmman;
+ if (! compat(5)) {
+ foreach my $ext (".1", ".1x") {
+ $wmman="/usr/share/man/man1/".basename($wm).$ext;
+ if (-e "$tmp$wmman" || -e "$tmp$wmman.gz") {
+ autoscript($package,"postinst","postinst-wm","s:#WM#:$wm:;s:#WMMAN#:$wmman.gz:;s/#PRIORITY#/$dh{PRIORITY}/",);
+ next WM;
+ }
+ }
+ }
+ autoscript($package,"postinst","postinst-wm-noman","s:#WM#:$wm:;s/#PRIORITY#/$dh{PRIORITY}/",);