Fix packaging of ODT exporter (org-7.8.02) in Gentoo
commit07f006e4fd9a7b66643cd7b404c8994665ba8300
authorJambunathan K <kjambunathan@gmail.com>
Fri, 30 Dec 2011 19:30:56 +0000 (31 01:00 +0530)
committerJambunathan K <kjambunathan@gmail.com>
Fri, 30 Dec 2011 19:41:33 +0000 (31 01:11 +0530)
tree0ddddcefd178744475b73bcedf7f033ca781c9e4
parent18708a2b5aa683b602534e41990877f4facd747d
Fix packaging of ODT exporter (org-7.8.02) in Gentoo

* org-odt.el (org-odt-lib-dir): Add docstring.
(org-odt-data-dir): New variable.  Use this variable to
control the locations from which the ODT exporter picks the
OpenDocument styles and schema files from.  Set this variable
explicitly only if the in-built heuristics for locating the
above files fails.
(org-odt-styles-dir-list, org-odt-schema-dir-list): New
variables.  Pay specific attention to (eval-when-compile ...)
form through which Makefile's $(datadir) - contained in
`org-odt-data-dir' - gets compiled in as a "hard coded"
constant.
(org-odt-styles-dir, org-export-odt-schema-dir): Add messages
to aid debugging.

* Makefile (etcdir): Remove this.
(stylesdir): Rename to datadir.
(datadir): Was stylesdir.
(STYLESFILES): Rename to DATAFILES.
(DATAFILES): Was STYLESFILES.  Offer a menu of files that is
available.  Package maintainers can use this list and their
own discretion to cherry-pick what they are willing to install
in their distribution.
(CP): Add recursive flag so that directories listed in
DATAFILES can be copied enbloc.
(install-lisp): Use conditional flag BATCH_EXTRA
(BATCH_EXTRA): "Target-specific variable value" that plumbs
the value of $(datadir) in to org-odt.el via
`org-odt-data-dir'.  See ChangeLog entries for
`org-odt-styles-dir-list' and `org-odt-schema-dir-list'.
(BATCH): Add BATCH_EXTRA.
(lisp/org-odt.elc): Force re-generation of this target every
time so that $(datadir) gets plumbed in to org-odt.el through
`org-odt-data-dir'.
(org-odt-data-dir): "FORCE" target.  Also a variable defined
in org-odt.el.
(install-etc): Rename this target to install-data.
(install-data): Was install-etc.

Fix for the following report:
http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00799.html

Ulrich Mueller <ulm@gentoo.org> writes:
  In Gentoo we have an issue with the location of the
  OpenDocument style files, reported to us in bug 396269 [1].

  When org-mode is installed as a separate Gentoo package, its
  lisp files are installed in
  /usr/share/emacs/site-lisp/org-mode/.  According to our
  policy, non-lisp files would go to
  /usr/share/emacs/etc/org-mode/. We would pass this as the
  "etcdir" parameter to "make install", so the odt style files
  would be installed in stylesdir =
  /usr/share/emacs/etc/org-mode/styles/.

  Now org-odt.el currently defines org-odt-styles-dir in a
  defconst, and it searches only in ../etc/styles/,
  ./etc/styles/, and ./etc/org/ relative to lispdir. Obviously
  it cannot find the files in the Gentoo location.

  [1] <https://bugs.gentoo.org/show_bug.cgi?id=396269>
Makefile
lisp/org-odt.el