Differences between revisions 7 and 8
Revision 7 as of 2019-10-15 21:37:07
Size: 4233
Comment: Drop versioned dh-elpa (stretch had 1.6); dh-elpa deps emacs-nox if no emacs is installed; update team name and email address; Update recommends and Enhances; normalise elpafied conjugation
Revision 8 as of 2020-06-28 05:30:49
Size: 4282
Editor: LevLamberov
Comment: Proper place for teams' wikis are under Teams/
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from EmacsenTeam/elpa-hello

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_elpafied emacs addon packages, e.g., debian/source/format or debian/changelog. Nor does it show how to generate or install an info file.


  • apt-get install dh-make-elpa
  • man dh-make-elpa

debian/* script snippets


  • Appropriate section and priority:

      Section: editors
      Priority: optional
  • Indicate team maintenance:

      Maintainer: Debian Emacsen team <debian-emacsen@lists.debian.org>
      Uploaders: Hello Packager <hellopackager@debian.org>
  • Declare appropriate build dependencies. Note that dh-elpa depends on emacs-nox if emacs is not installed.

      Build-Depends: debhelper-compat (= 12), dh-elpa
  • Use an emacs addon packaging team git repo:

      Vcs-Git: https://salsa.debian.org/emacsen-team/hello.git
      Vcs-Browser: https://salsa.debian.org/emacsen-team/hello
  • (Unless there are good reasons to use something else, like a pre-existing collab-maint repository. Collab-maint became the Debian team/namespace on Salsa.)
  • Declare the actual binary package:

      Package: elpa-hello
      Architecture: all
      Depends: ${misc:Depends}, ${elpa:Depends}
      Enhances: emacs
      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.
  • The transition package only included if there the addon was previously packaged under a different name, in this case hello-el. You should build a binary package for each ELPA package included in the upstream source repo. See "debian/*.elpa" below.


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

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


  • Standard boilerplate:

      #!/usr/bin/make -f

              dh $@ --with elpa


  • You should include a .elpa file for each elpa-* binary package your source package builds.
  • For our hello.el example, you just need elpa-hello.elpa:

  • For upstream source repos that contain more than one ELPA package,
    • first identify the root ELPA packages---generally the .el files that

      contains a Package-Requires line. Then list the *.el files associated with each one. For example, for magit, we would have


  • with-editor.elpa:

  • git-rebase.elpa:

  • magit.elpa:

  • To help in figuring this out you can look at the MELPA recipes for the packages where upstream should have broken down the files like this for you.

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:

  • override_dh_auto_build:
    • /bin/true

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