]> git.donarmstrong.com Git - debhelper.git/blob - dh_installemacsen
r420: big monsta changes
[debhelper.git] / dh_installemacsen
1 #!/usr/bin/perl -w
2 #
3 # Registration with emacsen-common.
4
5 use strict;
6 use Debian::Debhelper::Dh_Lib;
7 init();
8
9 if (! defined $dh{PRIORITY}) {
10         $dh{PRIORITY}=50;
11 }
12 if (! defined $dh{FLAVOR}) {
13         $dh{FLAVOR}='emacs';
14 }
15
16 foreach my $package (@{$dh{DOPACKAGES}}) {
17         my $tmp=tmpdir($package);
18
19         my $emacsen_install=pkgfile($package,"emacsen-install");
20         my $emacsen_remove=pkgfile($package,"emacsen-remove");
21         my $emacsen_startup=pkgfile($package,"emacsen-startup");
22
23         if ($emacsen_install ne '') {
24                 if (! -d "$tmp/usr/lib/emacsen-common/packages/install") {
25                         doit("install","-d","$tmp/usr/lib/emacsen-common/packages/install");
26                 }
27                 doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
28         }
29
30         if ($emacsen_remove ne '') {
31                 if (! -d "$tmp/usr/lib/emacsen-common/packages/remove") {
32                         doit("install","-d","$tmp/usr/lib/emacsen-common/packages/remove");
33                 }
34                 doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
35         }
36         
37         if ($emacsen_startup ne '') {
38                 if (! -d "$tmp/etc/$dh{FLAVOR}/site-start.d/") {
39                         doit("install","-d","$tmp/etc/$dh{FLAVOR}/site-start.d/");
40                 }
41                 doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
42         }
43
44         if ($emacsen_install ne '' || $emacsen_remove ne '') {
45                 if (! $dh{NOSCRIPTS}) {
46                         autoscript($package,"postinst","postinst-emacsen",
47                                 "s/#PACKAGE#/$package/");
48                         autoscript($package,"prerm","prerm-emacsen",
49                                 "s/#PACKAGE#/$package/");
50                 }
51         }
52 }