3 # Registration with emacsen-common.
5 use Debian::Debhelper::Dh_Lib;
8 if (! defined $dh{PRIORITY}) {
11 if (! defined $dh{FLAVOR}) {
15 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
16 $TMP=tmpdir($PACKAGE);
18 $emacsen_install=pkgfile($PACKAGE,"emacsen-install");
19 $emacsen_remove=pkgfile($PACKAGE,"emacsen-remove");
20 $emacsen_startup=pkgfile($PACKAGE,"emacsen-startup");
22 if ($emacsen_install ne '') {
23 if (! -d "$TMP/usr/lib/emacsen-common/packages/install") {
24 doit("install","-d","$TMP/usr/lib/emacsen-common/packages/install");
26 doit("install","-m0755",$emacsen_install,"$TMP/usr/lib/emacsen-common/packages/install/$PACKAGE");
29 if ($emacsen_remove ne '') {
30 if (! -d "$TMP/usr/lib/emacsen-common/packages/remove") {
31 doit("install","-d","$TMP/usr/lib/emacsen-common/packages/remove");
33 doit("install","-m0755","$emacsen_remove","$TMP/usr/lib/emacsen-common/packages/remove/$PACKAGE");
36 if ($emacsen_startup ne '') {
37 if (! -d "$TMP/etc/$dh{FLAVOR}/site-start.d/") {
38 doit("install","-d","$TMP/etc/$dh{FLAVOR}/site-start.d/");
40 doit("install","-m0644",$emacsen_startup,"$TMP/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$PACKAGE.el");
43 if ($emacsen_install ne '' || $emacsen_remove ne '') {
44 if (! $dh{NOSCRIPTS}) {
45 autoscript($PACKAGE,"postinst","postinst-emacsen",
46 "s/#PACKAGE#/$PACKAGE/");
47 autoscript($PACKAGE,"prerm","prerm-emacsen",
48 "s/#PACKAGE#/$PACKAGE/");