summaryrefslogtreecommitdiff
path: root/dh_installmenu
diff options
context:
space:
mode:
authorjoey <joey>2000-03-02 21:23:22 +0000
committerjoey <joey>2000-03-02 21:23:22 +0000
commit67b74298f08a3e2b30e43cbcd7cdaccc2e1b1614 (patch)
tree3ce180eedb8c91f9371456f3fb40336b4c7c34dd /dh_installmenu
parentc7f541bd2bc869c366e8242baf1faa6856cd2e39 (diff)
r338: * Patch from Jorgen `forcer' Schaefer <forcer at mindless.com> (much
modified)to make dh_installwm use new window manager registration method, update-alternatives. Closes: #52156, #34684 (latter bug is obsolete) * Fixed $dh{flavor} to be upper-case. * Deprecated dh_installemavcsen --number; use --priority instead. Also, the option parser requires the parameter be a number now. And, dh_installwm now accepts --priority, and window manager packages should start using it. * dh_installwm now behaves like a proper debhelper command, and reads debian/<package>.wm too. This is a small behavior change; filenames specified on the command line no longer apply to all packages it acts on. I can't belive this program existed for 2 years with such a glaring problem; I guess most people don't need ot register 5 wm's in 3 sub-packages. Anyway, it can handle such things now. :-) * Moved Dh_*.pm to /usr/lib/perl5/Debian/Debhelper. *big* change.
Diffstat (limited to 'dh_installmenu')
-rwxr-xr-xdh_installmenu54
1 files changed, 37 insertions, 17 deletions
diff --git a/dh_installmenu b/dh_installmenu
index 26798c2..d6050fe 100755
--- a/dh_installmenu
+++ b/dh_installmenu
@@ -1,24 +1,44 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
# Integration with debian menu system:
#
-# If debian/menu file exists, save it to debian/tmp/usr/lib/menu/$PACKAGE
+# If debian/menu file exists, save it to $TMP/usr/lib/menu/$PACKAGE
# If debian/menu-method file exists, save it to
-# debian/tmp/etc/menu-methods/$PACKAGE
+# $TMP/etc/menu-methods/$PACKAGE
+#
+# Also, add to postinst and postrm.
+
+use Debian::Debhelper::Dh_Lib;
+init();
-PATH=debian:$PATH:/usr/lib/debhelper
-source dh_lib
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $menu=pkgfile($PACKAGE,"menu");
+ $menu_method=pkgfile($PACKAGE,"menu-method");
+
+ if ($menu ne '') {
+ if (! -d "$TMP/usr/lib/menu") {
+ doit("install","-d","$TMP/usr/lib/menu");
+ }
+ doit("install","-p","-m644",$menu,"$TMP/usr/lib/menu/$PACKAGE");
+
+ # Add the scripts if a menu-method file doesn't exist.
+ # The scripts for menu-method handle everything these do, too.
+ if ($menu_method eq "" && ! $dh{NOSCRIPTS}) {
+ autoscript($PACKAGE,"postinst","postinst-menu");
+ autoscript($PACKAGE,"postrm","postrm-menu")
+ }
+ }
-if [ -e debian/menu ]; then
- if [ ! -d debian/tmp/usr/lib/menu ]; then
- doit "install -d debian/tmp/usr/lib/menu"
- fi
- doit "install -p -m644 debian/menu debian/tmp/usr/lib/menu/$PACKAGE"
-fi
+ if ($menu_method ne '') {
+ if (!-d "$TMP/etc/menu-methods") {
+ doit("install","-d","$TMP/etc/menu-methods");
+ }
+ doit("install","-p",$menu_method,"$TMP/etc/menu-methods/$PACKAGE");
-if [ -e debian/menu-method ]; then
- if [ ! -d debian/tmp/etc/menu-methods ]; then
- doit "install -d debian/tmp/etc/menu-methods"
- fi
- doit "install -p debian/menu-method debian/tmp/etc/menu-methods/$PACKAGE"
-fi
+ if (! $dh{NOSCRIPTS}) {
+ autoscript($PACKAGE,"postinst","postinst-menu-method","s/#PACKAGE#/$PACKAGE/");
+ autoscript($PACKAGE,"postrm","postrm-menu-method","s/#PACKAGE#/$PACKAGE/");
+ }
+ }
+}