3 # Integration with debian menu system:
5 # If debian/menu file exists, save it to $tmp/usr/lib/menu/$package
6 # If debian/menu-method file exists, save it to
7 # $tmp/etc/menu-methods/$package
9 # Also, add to postinst and postrm.
12 use Debian::Debhelper::Dh_Lib;
15 foreach my $package (@{$dh{DOPACKAGES}}) {
16 my $tmp=tmpdir($package);
17 my $menu=pkgfile($package,"menu");
18 my $menu_method=pkgfile($package,"menu-method");
21 if (! -d "$tmp/usr/lib/menu") {
22 doit("install","-d","$tmp/usr/lib/menu");
24 doit("install","-p","-m644",$menu,"$tmp/usr/lib/menu/$package");
26 # Add the scripts if a menu-method file doesn't exist.
27 # The scripts for menu-method handle everything these do, too.
28 if ($menu_method eq "" && ! $dh{NOSCRIPTS}) {
29 autoscript($package,"postinst","postinst-menu");
30 autoscript($package,"postrm","postrm-menu")
34 if ($menu_method ne '') {
35 if (!-d "$tmp/etc/menu-methods") {
36 doit("install","-d","$tmp/etc/menu-methods");
38 doit("install","-p",$menu_method,"$tmp/etc/menu-methods/$package");
40 if (! $dh{NOSCRIPTS}) {
41 autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/");
42 autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/");