diff options
author | David Bremner <david@tethera.net> | 2015-07-11 22:40:26 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2015-07-12 08:08:39 +0200 |
commit | 45ac760c6da6cd86660ceac632525593477299c8 (patch) | |
tree | 62124b132fc442c5172dcd163aea305b6b8c3013 /dh_elpa | |
parent | 82a2216013af44a82b78fa9c999d4fec1501e3fc (diff) |
minimal conversion to perl / debhelper lib
It turns out this isn't $MESSY_CONFLICT_ZONE, there are rules about
writing debhelper extensions.
This is mainly cargo culting from dh_installdocs.
- compute destination directory, support multiple binary packages.
- add debian/elpa file, test the "standard" codepath. Still not very
standard because it's a single file elpa package.
Diffstat (limited to 'dh_elpa')
-rwxr-xr-x | dh_elpa | 37 |
1 files changed, 32 insertions, 5 deletions
@@ -1,6 +1,33 @@ -#!/bin/sh +#!/usr/bin/perl -emacs -batch -Q -l package \ - --eval '(add-to-list (quote package-directory-list) "/usr/share/emacs/site-lisp/elpa")' \ - -f package-initialize \ - -l dh-elpa.el -f dhelpa-batch-install-file "$@" +use Debian::Debhelper::Dh_Lib; + +init(); + +my $elpadir="/usr/share/emacs/site-lisp/elpa"; + +foreach my $package (@{$dh{DOPACKAGES}}) { + + my $tmp=tmpdir($package); + my $file=pkgfile($package,"elpa"); + + my @files; + if ($file) { + @files=filearray($file, "."); + } + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) + && @ARGV) { + push @files, @ARGV; + } + + if (scalar(@files) == 1) { + $pkg_file=$files[0]; + } else { + die("multifile packages unimplimented"); + } + + doit(qw{emacs -batch -Q -l package}, + '--eval',"(add-to-list 'package-directory-list \"$elpadir\")", + qw{-f package-initialize -l dh-elpa.el}, + qw{-f dhelpa-batch-install-file}, "$tmp/$elpadir", $pkg_file); +} |