summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/elpa1
-rw-r--r--debian/install1
-rwxr-xr-xdebian/rules2
-rw-r--r--dh-elpa.el4
-rwxr-xr-xdh_elpa37
5 files changed, 36 insertions, 9 deletions
diff --git a/debian/elpa b/debian/elpa
new file mode 100644
index 0000000..abf136d
--- /dev/null
+++ b/debian/elpa
@@ -0,0 +1 @@
+*.el
diff --git a/debian/install b/debian/install
index adc3fdf..e772481 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1 @@
-usr/share/emacs
usr/bin
diff --git a/debian/rules b/debian/rules
index 1c6778b..d0aed4d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,5 +6,5 @@ DESTDIR=$(CURDIR)/debian/tmp
dh $@
override_dh_auto_install:
- ./dh_elpa dh-elpa.el $(DESTDIR)/usr/share/emacs/site-lisp/elpa
+ ./dh_elpa
install -m 755 -D dh_elpa $(DESTDIR)/usr/bin/dh_elpa
diff --git a/dh-elpa.el b/dh-elpa.el
index ed70822..cff7009 100644
--- a/dh-elpa.el
+++ b/dh-elpa.el
@@ -64,8 +64,8 @@ Downloads and installs required packages as needed."
(defun dhelpa-batch-install-file ()
"install first command line argument (an emacs lisp file)
into second command line argument"
- (let ((el-file (car command-line-args-left))
- (dest (cadr command-line-args-left)))
+ (let ((dest (car command-line-args-left))
+ (el-file (cadr command-line-args-left)))
(with-temp-buffer
(insert-file-contents-literally el-file)
(dhelpa-install-from-buffer dest))))
diff --git a/dh_elpa b/dh_elpa
index d867c47..c122f48 100755
--- a/dh_elpa
+++ b/dh_elpa
@@ -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);
+}