3 # Registration with emacsen-common.
6 use Debian::Debhelper::Dh_Lib;
9 if (! defined $dh{PRIORITY}) {
12 if (! defined $dh{FLAVOR}) {
16 foreach my $package (@{$dh{DOPACKAGES}}) {
17 my $tmp=tmpdir($package);
19 my $emacsen_install=pkgfile($package,"emacsen-install");
20 my $emacsen_remove=pkgfile($package,"emacsen-remove");
21 my $emacsen_startup=pkgfile($package,"emacsen-startup");
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");
27 doit("install","-m0755",$emacsen_install,"$tmp/usr/lib/emacsen-common/packages/install/$package");
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");
34 doit("install","-m0755","$emacsen_remove","$tmp/usr/lib/emacsen-common/packages/remove/$package");
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/");
41 doit("install","-m0644",$emacsen_startup,"$tmp/etc/$dh{FLAVOR}/site-start.d/$dh{PRIORITY}$package.el");
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/");