]> git.donarmstrong.com Git - debhelper.git/blob - dh_installmenu
Updated French man page translation. Closes: #685560
[debhelper.git] / dh_installmenu
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_installmenu - install Debian menu files into package build directories
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Lib;
11
12 =head1 SYNOPSIS
13
14 B<dh_installmenu> [S<B<debhelper options>>] [B<-n>]
15
16 =head1 DESCRIPTION
17
18 B<dh_installmenu> is a debhelper program that is responsible for installing
19 files used by the Debian B<menu> package into package build directories.
20
21 It also automatically generates the F<postinst> and F<postrm> commands needed to
22 interface with the Debian B<menu> package. These commands are inserted into
23 the maintainer scripts by L<dh_installdeb(1)>.
24
25 =head1 FILES
26
27 =over 4
28
29 =item debian/I<package>.menu
30
31 Debian menu files, installed into usr/share/menu/I<package> in the package
32 build directory. See L<menufile(5)> for its format.
33
34 =item debian/I<package>.menu-method
35
36 Debian menu method files, installed into etc/menu-methods/I<package>
37 in the package build directory.
38
39 =back
40
41 =head1 OPTIONS
42
43 =over 4
44
45 =item B<-n>, B<--noscripts>
46
47 Do not modify F<postinst>/F<postrm> scripts.
48
49 =back
50
51 =cut
52
53 init();
54
55 foreach my $package (@{$dh{DOPACKAGES}}) {
56         my $tmp=tmpdir($package);
57         my $menu=pkgfile($package,"menu");
58         my $menu_method=pkgfile($package,"menu-method");
59         
60         if ($menu ne '') {
61                 if (! -d "$tmp/usr/share/menu") {
62                         doit("install","-d","$tmp/usr/share/menu");
63                 }
64                 doit("install","-p","-m644",$menu,"$tmp/usr/share/menu/$package");
65                 
66                 # Add the scripts if a menu-method file doesn't exist.
67                 # The scripts for menu-method handle everything these do, too.
68                 if ($menu_method eq "" && ! $dh{NOSCRIPTS}) {
69                         autoscript($package,"postinst","postinst-menu");
70                         autoscript($package,"postrm","postrm-menu")
71                 }
72         }
73
74         if ($menu_method ne '') {
75                 if (!-d "$tmp/etc/menu-methods") {
76                         doit("install","-d","$tmp/etc/menu-methods");
77                 }
78                 doit("install","-p","-m644",$menu_method,"$tmp/etc/menu-methods/$package");
79
80                 if (! $dh{NOSCRIPTS}) {
81                         autoscript($package,"postinst","postinst-menu-method","s/#PACKAGE#/$package/");
82                         autoscript($package,"postrm","postrm-menu-method","s/#PACKAGE#/$package/");
83                 }
84         }
85 }
86
87 =head1 SEE ALSO
88
89 L<debhelper(7)>
90 L<update-menus(1)>
91 L<menufile(5)>
92
93 This program is a part of debhelper.
94
95 =head1 AUTHOR
96
97 Joey Hess <joeyh@debian.org>
98
99 =cut