English Japanese
Packaging of add-ons for GNU Emacs and XEmacs
The purpose of this document is to promote good practice in packaging add-ons for GNU Emacs and XEmacs, and to encourage the submission of more Emacs add-on packages to the package collection by providing easy to use spec file templates.
Important notes on these Guidelines
The guidelines in the following sections make extensive use of the macros defined in /etc/rpm/macros.emacs and /etc/rpm/macros.xemacs which are installed with the emacs-common and xemacs-common packages.
There are two distinct cases where consideration of these guidelines is required:
This case refers to the situation where a package's principal purpose is to provide extra functionality for (X)Emacs, and the package serves no purpose without the presence of (X)Emacs. An example of this case is the VM mail reader, as packaged in emacs-vm. Below we refer to this as *Case I*.
This case refers to the situation where a package's principal functionality does not require (X)Emacs, but the package also includes some auxiliary Elisp files to provide support for the package in (X)Emacs. Below we refer to this as *Case II*.
Package naming and sub-package organization
Case I
Where an add-on package foo is for both GNU Emacs and XEmacs, the main package should be called emacs-common-foo. This main package should contain files common to both GNU Emacs and XEmacs such as documentation etc. Files specific to each of GNU Emacs and XEmacs should be placed in sub-packages called emacs-foo and xemacs-foo.
Where a package is primarily an add-on for one flavour of (X)Emacs, the main package should be called emacs-foo or xemacs-foo.
Case II
Where a package's principal functionality does not require (X)Emacs, but the package also includes some auxiliary Elisp files to provide support for the package in (X)Emacs, these should be included in the main package which will need to Require the emacs-filesystem and/or xemacs-filesystem packages. More detail below.
Package contents
Files specific to GNU Emacs should be placed in a sub-package called emacs-foo. This should contain the elisp source, compiled elisp and any other files needed to use the package or sub-package with GNU Emacs.
Files specific to XEmacs should be placed in a sub-package called xemacs-foo. This should contain the elisp source, compiled elisp and any other files needed to use the add-on package or sub-package with XEmacs.
The compiled elisp source and the elisp source files should be packaged as part of the main package, and not split out into separate packages.
File locations
File locations for GNU Emacs add-on (sub-)packages:
All elisp and related files for the package should be installed in the directory `+%{_emacs_sitelispdir}/foo+`.