summaryrefslogtreecommitdiff
path: root/dh_elpa
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2015-07-17 18:38:13 +0200
committerDavid Bremner <david@tethera.net>2015-07-17 18:38:13 +0200
commit7bbfed658b723a39a0a81811f1e7734d14205ce7 (patch)
treefdb1aa7340d632401ce4e654c2c76e388b8efe6a /dh_elpa
parentcba6b313f0b1c4d324692f6fe74c37c190091642 (diff)
auto-installation of helper scripts
This means no fancy predepends are needed because we just copy the scripts in at build time. Of course bug fixes for the helper scripts require package rebuilds.
Diffstat (limited to 'dh_elpa')
-rwxr-xr-xdh_elpa31
1 files changed, 31 insertions, 0 deletions
diff --git a/dh_elpa b/dh_elpa
index e742d86..617c6f5 100755
--- a/dh_elpa
+++ b/dh_elpa
@@ -75,6 +75,25 @@ sub doit_quietly {
}
+my $templatedir = "/usr/share/debhelper/dh_elpa/emacsen-common";
+
+sub maybe_install_helper{
+ my ($package,$piece)=@_;
+ my $file=pkgfile($package,"emacsen-$piece");
+
+ my $tmp=tmpdir($package);
+ my $ecdest="$tmp/usr/lib/emacsen-common/packages";
+
+ # if there is file, leave it for dh_installemacsen
+ if ($file eq '') {
+ if (! -d "$ecdest/$piece") {
+ doit("install","-d","$ecdest/$piece");
+ }
+ doit("install","-m0755","$templatedir/$piece",
+ "$ecdest/$piece/$package");
+ }
+}
+
$dh{BYTECOMPILE} = 1 unless defined($dh{BYTECOMPILE});
my $elpadir;
@@ -90,6 +109,18 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp=tmpdir($package);
my $file=pkgfile($package,"elpa");
+ if ($dh{BYTECOMPILE}) {
+ foreach my $piece (qw{compat install remove}) {
+ maybe_install_helper($package,$piece);
+ }
+ if (! $dh{NOSCRIPTS}) {
+ autoscript($package,"postinst","postinst-emacsen",
+ "s/#PACKAGE#/$package/");
+ autoscript($package,"prerm","prerm-emacsen",
+ "s/#PACKAGE#/$package/");
+ }
+ }
+
my $elpapkg=$package;
# TODO do this more sanely or at least allow an override
$elpapkg =~ s/^elpa-//;