]> git.donarmstrong.com Git - debhelper.git/blob - dh_installmime
Merge branch 'wheezy'
[debhelper.git] / dh_installmime
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_installmime - install mime 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_installmime> [S<I<debhelper options>>]
15
16 =head1 DESCRIPTION
17
18 B<dh_installmime> is a debhelper program that is responsible for installing
19 mime files into package build directories.
20
21 =head1 FILES
22
23 =over 4
24
25 =item debian/I<package>.mime
26
27 Installed into usr/lib/mime/packages/I<package> in the package build
28 directory.
29
30 =item debian/I<package>.sharedmimeinfo
31
32 Installed into /usr/share/mime/packages/I<package>.xml in the package build
33 directory.
34
35 =back
36
37 =cut
38
39 init();
40
41 foreach my $package (@{$dh{DOPACKAGES}}) {
42         my $tmp=tmpdir($package);
43         my $mime=pkgfile($package,"mime");
44         
45         if ($mime ne '') {
46                 if (! -d "$tmp/usr/lib/mime/packages") {
47                         doit("install","-d","$tmp/usr/lib/mime/packages");
48                 }
49                 doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package");
50         }
51         
52         my $sharedmimeinfo=pkgfile($package,"sharedmimeinfo");
53         
54         if ($sharedmimeinfo ne '') {
55                 if (! -d "$tmp/usr/share/mime/packages") {
56                         doit("install", "-d", "$tmp/usr/share/mime/packages");
57                 }
58                 doit("install", "-p", "-m644", $sharedmimeinfo, "$tmp/usr/share/mime/packages/$package.xml");
59         }
60 }
61
62 =head1 SEE ALSO
63
64 L<debhelper(7)>
65
66 This program is a part of debhelper.
67
68 =head1 AUTHOR
69
70 Joey Hess <joeyh@debian.org>
71
72 =cut