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.
11 BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
15 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
16 $TMP=tmpdir($PACKAGE);
17 $menu=pkgfile($PACKAGE,"menu");
18 $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/");