Snippets and such for dh_elpa-fied emacs addon Debian package

This contains information that may prove useful in packaging an emacs addon for Debian when using the dh_elpa system and conforming to Debian elpa emacs addon policy. An attempt is made to organize the information in a fashion that facilitates copy-and-paste.

For concreteness, we imagine packaging a "hello" emacs addon package, which was previously packaged as hello-el.

This is not exhaustive. It does not include files or stanzas which are not specific to dh_elpa-ified emacs addon packages, e.g., debian/source/format or debian/changelog. Nor does it show how to generate or install an info file.

Quickstart

debian/* script snippets

debian/control

      Section: editors
      Priority: optional

      Maintainer: Debian Emacs addons team <pkg-emacsen-addons@lists.alioth.debian.org>
      Uploaders: Hello Packager <hellpackage@debian.org>

      Build-Depends: debhelper (>= 10), dh-elpa (>= 0.0.17)

      Vcs-Git: https://salsa.debian.org/emacsen-team/hello.git/
      Vcs-Browser: https://salsa.debian.org/emacsen-team/hello

      Package: elpa-hello
      Architecture: all
      Depends: ${misc:Depends}, ${elpa:Depends}
      Recommends: emacs (>= 46.0)
      Enhances: emacs, emacs24, emacs25
      Breaks: hello-el (<< 1.0)
      Provides: hello-el
      Description: Emacs addon to say hello
       The Emacs editor addon likes to wave and say hello.

      Package: hello-el
      Architecture: all
      Depends: ${misc:Depends}, elpa-hello
      Description: Transition Package, hello-el to elpa-hello
       The hello emacs addon has been elpafied.  This dummy package
       helps ease transition from hello-el to elpa-hello.

debian/hello-el.maintscript

      rm_conffile /etc/emacs/site-start.d/50hello-el.el

Only included if you have a hello-el transitional binary package.

debian/compat

      10

debian/rules

      \#!/usr/bin/make -f

      %:
              dh $@ --with elpa

debian/*.elpa

      lisp/git-commit.el

      lisp/with-editor.el

      lisp/git-rebase.el

      lisp/magit.el
      lisp/magit-*.el

Common mistakes to avoid

dh_elpa and dh_make_elpa are designed to obviate the need for tools like Cask. Do not be misled by upstream's repository into thinking that you need to build-depend on Cask! Generally, you will want to disable Cask with rules targets like this:

and then configure dh_elpa_test to run the test suite anyway (which in most cases will not require any additional configuration).