]> git.donarmstrong.com Git - debhelper.git/blob - dh_installmime
r576: * Rename debhelper.1 to debhelper.7.
[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>>] [B<-n>]
15
16 =head1 DESCRIPTION
17
18 dh_installmime is a debhelper program that is responsible for installing
19 mime files into package build directories.
20
21 It also automatically generates the postinst and postrm commands needed to
22 interface with the debian mime-support package. See L<dh_installdeb(1)> for
23 an explanation of how this works.
24
25 If a file named debian/package.mime exists, then it is installed into
26 usr/lib/mime/packages/package in the package build directory.
27
28 =head1 OPTIONS
29
30 =over 4
31
32 =item B<-n>, B<--noscripts>
33
34 Do not modify postinst/postrm scripts.
35
36 =back
37
38 =head1 NOTES
39
40 Note that this command is not idempotent. "dh_clean -k" should be called
41 between invocations of this command. Otherwise, it may cause multiple
42 instances of the same text to be added to maintainer scripts.
43
44 =cut
45
46 init();
47
48 foreach my $package (@{$dh{DOPACKAGES}}) {
49         my $tmp=tmpdir($package);
50         my $mime=pkgfile($package,"mime");
51         
52         if ($mime ne '') {
53                 if (! -d "$tmp/usr/lib/mime/packages") {
54                         doit("install","-d","$tmp/usr/lib/mime/packages");
55                 }
56                 doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package");
57
58                 if (! $dh{NOSCRIPTS}) {
59                         autoscript($package,"postinst","postinst-mime");
60                         autoscript($package,"postrm","postrm-mime")
61                 }
62         }
63 }
64
65 =head1 SEE ALSO
66
67 L<debhelper(7)>
68
69 This program is a part of debhelper.
70
71 =head1 AUTHOR
72
73 Joey Hess <joeyh@debian.org>
74
75 =cut