]> git.donarmstrong.com Git - debhelper.git/blob - dh_installemacsen
r211: Initial Import
[debhelper.git] / dh_installemacsen
1 #!/usr/bin/perl -w
2 #
3 # Registration with emacsen-common.
4
5 BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
6 use Dh_Lib;
7 init();
8
9 if (! defined $dh{number}) {
10         $dh{number}=50;
11 }
12 if (! defined $dh{flavor}) {
13         $dh{flavor}='emacs';
14 }
15
16 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
17         $TMP=tmpdir($PACKAGE);
18
19         $emacsen_install=pkgfile($PACKAGE,"emacsen-install");
20         $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove");
21         $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",$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","$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",$emacsen_startup,"$TMP/etc/$dh{flavor}/site-start.d/$dh{number}$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 }