debian/{control,rules,*.elpa}: Use dh_elpa
David Caldwell
2 years ago
0 | *.el |
1 | 1 | Section: vcs |
2 | 2 | Priority: optional |
3 | 3 | Maintainer: David Caldwell <david@porkrind.org> |
4 | Build-Depends: debhelper-compat (= 13), perl | |
4 | Build-Depends: debhelper-compat (= 13), dh-elpa (>= 2.0.8~), perl | |
5 | 5 | Standards-Version: 4.5.1 |
6 | 6 | Homepage: https://porkrind.org/commit-patch/ |
7 | 7 | Vcs-Git: https://github.com/caldwell/commit-patch.git -b debian |
0 | #! /bin/sh -e | |
1 | # /usr/lib/emacsen-common/packages/install/commit-patch | |
2 | ||
3 | # Written by Jim Van Zandt <jrv@debian.org>, borrowing heavily | |
4 | # from the install scripts for gettext by Santiago Vila | |
5 | # <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>. | |
6 | ||
7 | FLAVOR=$1 | |
8 | PACKAGE=commit-patch | |
9 | ||
10 | case $FLAVOR in | |
11 | xemacs*) | |
12 | echo install/${PACKAGE}: Skipping unsupported emacs ${FLAVOR} | |
13 | exit 0 | |
14 | ;; | |
15 | *) | |
16 | echo install/${PACKAGE}: Handling install of emacsen flavor ${FLAVOR} | |
17 | esac | |
18 | ||
19 | echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} | |
20 | ||
21 | #FLAVORTEST=`echo $FLAVOR | cut -c-6` | |
22 | #if [ ${FLAVORTEST} = xemacs ] ; then | |
23 | # SITEFLAG="-no-site-file" | |
24 | #else | |
25 | # SITEFLAG="--no-site-file" | |
26 | #fi | |
27 | FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" | |
28 | ||
29 | ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} | |
30 | ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} | |
31 | ELRELDIR=../../../emacs/site-lisp/${PACKAGE} | |
32 | ||
33 | # Install-info-altdir does not actually exist. | |
34 | # Maybe somebody will write it. | |
35 | if test -x /usr/sbin/install-info-altdir; then | |
36 | echo install/${PACKAGE}: install Info links for ${FLAVOR} | |
37 | install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz | |
38 | fi | |
39 | ||
40 | install -m 755 -d ${ELCDIR} | |
41 | cd ${ELDIR} | |
42 | FILES=`echo *.el` | |
43 | cd ${ELCDIR} | |
44 | if [ $ELDIR != $ELCDIR ]; then | |
45 | ln -sf ${ELRELDIR}/*.el . | |
46 | fi | |
47 | ||
48 | cat << EOF > path.el | |
49 | (debian-pkg-add-load-path-item ".") | |
50 | (setq byte-compile-warnings nil) | |
51 | EOF | |
52 | ${FLAVOR} ${FLAGS} ${FILES} | |
53 | rm -f path.el | |
54 | ||
55 | exit 0 |
0 | #!/bin/sh -e | |
1 | # /usr/lib/emacsen-common/packages/remove/commit-patch | |
2 | ||
3 | FLAVOR=$1 | |
4 | PACKAGE=commit-patch | |
5 | ||
6 | if [ ${FLAVOR} != emacs ]; then | |
7 | if test -x /usr/sbin/install-info-altdir; then | |
8 | echo remove/${PACKAGE}: removing Info links for ${FLAVOR} | |
9 | install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/commit-patch.info.gz | |
10 | fi | |
11 | ||
12 | echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} | |
13 | rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} | |
14 | fi |
0 | ;; -*-emacs-lisp-*- | |
1 | ;; | |
2 | ;; Emacs startup file, e.g. /etc/emacs/site-start.d/50commit-patch.el | |
3 | ;; for the Debian commit-patch package | |
4 | ;; | |
5 | ;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at> | |
6 | ;; Modified by Dirk Eddelbuettel <edd@debian.org> | |
7 | ;; Adapted for dh-make by Jim Van Zandt <jrv@debian.org> | |
8 | ||
9 | ;; The commit-patch package follows the Debian/GNU Linux 'emacsen' policy and | |
10 | ;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, | |
11 | ;; xemacs19, emacs20, xemacs20...). The compiled code is then | |
12 | ;; installed in a subdirectory of the respective site-lisp directory. | |
13 | ;; We have to add this to the load-path: | |
14 | (let ((package-dir (concat "/usr/share/" | |
15 | (symbol-name flavor) | |
16 | "/site-lisp/commit-patch"))) | |
17 | ;; If package-dir does not exist, the commit-patch package must have | |
18 | ;; removed but not purged, and we should skip the setup. | |
19 | (when (file-directory-p package-dir) | |
20 | (setq load-path (cons package-dir load-path)) | |
21 | (eval-after-load 'diff-mode | |
22 | '(require 'commit-patch-buffer nil 'noerror)))) |
3 | 3 | # Uncomment this to turn on verbose mode. |
4 | 4 | #export DH_VERBOSE=1 |
5 | 5 | |
6 | ELPA_NAME=commit-patch-buffer | |
7 | export ELPA_NAME | |
8 | ||
6 | 9 | override_dh_auto_install: |
7 | make install PREFIX=debian/commit-patch/usr LISPDIR=/share/emacs/site-lisp/commit-patch | |
10 | make install PREFIX=debian/commit-patch/usr | |
11 | # dh_elpa copies the .el file to a new place | |
12 | rm debian/commit-patch/usr/share/emacs/site-lisp/commit-patch-buffer.el | |
8 | 13 | # No need for another copy of the GPL: |
9 | 14 | rm debian/commit-patch/usr/share/doc/commit-patch/COPYING |
10 | 15 | # Installed by dh_installchangelogs: |
17 | 22 | true |
18 | 23 | |
19 | 24 | %: |
20 | dh $@ --no-parallel | |
25 | dh $@ --no-parallel --with elpa |