5 dh_installmime - install mime files into package build directories
10 use Debian::Debhelper::Dh_Lib;
14 B<dh_installmime> [S<I<debhelper options>>] [B<-n>]
18 B<dh_installmime> is a debhelper program that is responsible for installing
19 mime files into package build directories.
21 It also automatically generates the F<postinst> and F<postrm> commands needed to
22 interface with the debian B<mime-support> and B<shared-mime-info> packages. These
23 commands are inserted into the maintainer scripts by L<dh_installdeb(1)>.
29 =item debian/I<package>.mime
31 Installed into usr/lib/mime/packages/I<package> in the package build
34 =item debian/I<package>.sharedmimeinfo
36 Installed into /usr/share/mime/packages/I<package>.xml in the package build
45 =item B<-n>, B<--noscripts>
47 Do not modify F<postinst>/F<postrm> scripts.
53 Note that this command is not idempotent. L<dh_prep(1)> should be called
54 between invocations of this command. Otherwise, it may cause multiple
55 instances of the same text to be added to maintainer scripts.
61 foreach my $package (@{$dh{DOPACKAGES}}) {
62 my $tmp=tmpdir($package);
63 my $mime=pkgfile($package,"mime");
66 if (! -d "$tmp/usr/lib/mime/packages") {
67 doit("install","-d","$tmp/usr/lib/mime/packages");
69 doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package");
71 # Check whether we have to call update-mime (either upstream already
72 # installs a MIME information file or Debian provides one)
73 if ((! $dh{NOSCRIPTS}) && (-d "$tmp/usr/lib/mime/packages")) {
74 autoscript($package,"postinst","postinst-mime");
75 autoscript($package,"postrm","postrm-mime")
78 my $sharedmimeinfo=pkgfile($package,"sharedmimeinfo");
80 if ($sharedmimeinfo ne '') {
81 if (! -d "$tmp/usr/share/mime/packages") {
82 doit("install", "-d", "$tmp/usr/share/mime/packages");
84 doit("install", "-p", "-m644", $sharedmimeinfo, "$tmp/usr/share/mime/packages/$package.xml");
86 # check whether we have to call update-mime-database (either upstream
87 # already installs a shared MIME information file or Debian provides
89 if ((! $dh{NOSCRIPTS}) && (-d "$tmp/usr/share/mime/packages")) {
90 autoscript($package, "postinst", "postinst-sharedmimeinfo");
91 autoscript($package, "postrm", "postrm-sharedmimeinfo")
99 This program is a part of debhelper.
103 Joey Hess <joeyh@debian.org>