debian: convert to use dh-elpa

This packaging helper eliminates most of the boilerplate from packaging
emacs extensions for debian. It requires package.el compatible metadata.
This commit is contained in:
David Bremner 2016-11-11 07:46:51 -04:00
parent 297d27e9f9
commit 6e1628decb
10 changed files with 9 additions and 103 deletions

14
debian/control vendored
View file

@ -17,6 +17,7 @@ Build-Depends:
python-all (>= 2.6.6-3~),
python3-all (>= 3.1.2-7~),
dh-python,
dh-elpa (>= 1.3),
python-sphinx (>= 1.0),
ruby, ruby-dev (>>1:1.9.3~),
emacs24-nox | emacs24 (>=24~) | emacs24-lucid (>=24~) |
@ -111,13 +112,12 @@ Description: Ruby interface to the notmuch mail search and index library
Package: notmuch-emacs
Architecture: all
Section: mail
Breaks: notmuch (<<0.6~254~)
Replaces: notmuch (<<0.6~254~)
Depends: ${misc:Depends}, notmuch (>= ${source:Version}),
emacs23 (>= 23~) | emacs23-nox (>=23~) | emacs23-lucid (>=23~) |
emacs24 (>= 24~) | emacs24-nox (>=24~) | emacs24-lucid (>=24~),
emacsen-common (>= 2.0.8)
Description: thread-based email index, search and tagging (transitional package)
This dummy package help ease transition to the new package elpa-notmuch
Package: elpa-notmuch
Architecture: all
Depends: ${misc:Depends}, ${elpa:Depends}
Description: thread-based email index, search and tagging (emacs interface)
Notmuch is a system for indexing, searching, reading, and tagging
large collections of email messages in maildir or mh format. It uses

1
debian/elpa-notmuch.elpa vendored Normal file
View file

@ -0,0 +1 @@
emacs/*.el

View file

@ -1 +0,0 @@
usr/share/emacs/site-lisp/notmuch

View file

@ -1 +0,0 @@
0

View file

@ -1,48 +0,0 @@
#!/bin/sh
# /usr/lib/emacsen-common/packages/install/notmuch-emacs
set -e
FLAVOR=$1
PACKAGE=notmuch
case "${FLAVOR}" in
emacs)
return 0
;;
xemacs*|emacs2[12])
# patches welcome.
echo install/${PACKAGE}: skipping install for unsupported emacsen flavor ${FLAVOR}
exit 0
;;
*)
echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
esac
elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
el_dir=/usr/share/emacs/site-lisp/${PACKAGE}
byte_compile_options="--quick --directory=${el_dir} -batch -f batch-byte-compile"
echo install/${PACKAGE}: byte-compiling for ${FLAVOR}
[ -d ${elc_dir} ] || mkdir ${elc_dir}
# Create symlinks to the .el files (see section 6E in debian-emacs
# polcy). This makes complation easy, and also allows find-function
# and find-library to work properly.
(cd ${elc_dir} && ln -sf ${el_dir}/*.el .)
# Byte compile them
(cd ${elc_dir}
set +e
${FLAVOR} ${byte_compile_options} *.el > Install.log 2>&1
if test $? -ne 0
then
cat Install.log
exit 1
fi
set -e
gzip -9f Install.log)
exit 0;

View file

@ -1,34 +0,0 @@
#!/bin/sh
# /usr/lib/emacsen-common/packages/remove/notmuch
set -e
FLAVOR=$1
PACKAGE=notmuch
elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
case "${FLAVOR}" in
emacs)
return 0
;;
xemacs*|emacs2[12])
# patches welcome.
echo install/${PACKAGE}: skipping removal for unsupported emacsen flavor ${FLAVOR}
exit 0
;;
*)
echo remove/${PACKAGE}: Handling removal for emacsen flavor ${FLAVOR}
esac
echo remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR}
echo emacsen-common: purging byte-compiled files for ${FLAVOR}
rm -f ${elc_dir}/*.elc
rm -f ${elc_dir}/*.el
rm -f ${elc_dir}/Install.log*
if test -e "${elc_dir}"
then
rmdir --ignore-fail-on-non-empty "${elc_dir}"
fi
exit 0;

View file

@ -1 +0,0 @@
usr/share/emacs/site-lisp/notmuch/*.el

View file

@ -1,7 +0,0 @@
dir="/var/lib/emacsen-common/state/package/installed"
mkdir -p -m 0755 ${dir}
touch ${dir}/notmuch-emacs
#DEBHELPER#
if [ -d /0755 ]; then
rmdir /0755 || true
fi

View file

@ -1,3 +0,0 @@
#DEBHELPER#
dir="/var/lib/emacsen-common/state/package/installed"
rm -f ${dir}/notmuch-emacs

2
debian/rules vendored
View file

@ -3,7 +3,7 @@
python3_all = py3versions -s | xargs -n1 | xargs -t -I {} env {}
%:
dh $@ --with python2,python3
dh $@ --with python2,python3,elpa
override_dh_auto_configure:
./configure --prefix=/usr \