From 61ee8ec24c4450aa457d423b199a916a29fc4c8c Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Mon, 6 Sep 2021 13:32:02 -0700 Subject: [PATCH] debian/{control,rules,*.elpa}: Use dh_elpa --- debian/commit-patch.elpa | 1 + debian/commit-patch.emacsen-compat | 1 - debian/control | 2 +- debian/emacsen-install | 56 ------------------------------ debian/emacsen-remove | 15 -------- debian/emacsen-startup | 23 ------------ debian/rules | 9 +++-- 7 files changed, 9 insertions(+), 98 deletions(-) create mode 100644 debian/commit-patch.elpa delete mode 100644 debian/commit-patch.emacsen-compat delete mode 100644 debian/emacsen-install delete mode 100644 debian/emacsen-remove delete mode 100644 debian/emacsen-startup diff --git a/debian/commit-patch.elpa b/debian/commit-patch.elpa new file mode 100644 index 0000000..abf136d --- /dev/null +++ b/debian/commit-patch.elpa @@ -0,0 +1 @@ +*.el diff --git a/debian/commit-patch.emacsen-compat b/debian/commit-patch.emacsen-compat deleted file mode 100644 index 573541a..0000000 --- a/debian/commit-patch.emacsen-compat +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/debian/control b/debian/control index f4a1e4c..dd7b354 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: commit-patch Section: vcs Priority: optional Maintainer: David Caldwell -Build-Depends: debhelper-compat (= 13), perl +Build-Depends: debhelper-compat (= 13), dh-elpa (>= 2.0.8~), perl Standards-Version: 4.5.1 Homepage: https://porkrind.org/commit-patch/ Vcs-Git: https://github.com/caldwell/commit-patch.git -b debian diff --git a/debian/emacsen-install b/debian/emacsen-install deleted file mode 100644 index 6518ad9..0000000 --- a/debian/emacsen-install +++ /dev/null @@ -1,56 +0,0 @@ -#! /bin/sh -e -# /usr/lib/emacsen-common/packages/install/commit-patch - -# Written by Jim Van Zandt , borrowing heavily -# from the install scripts for gettext by Santiago Vila -# and octave by Dirk Eddelbuettel . - -FLAVOR=$1 -PACKAGE=commit-patch - -case $FLAVOR in - xemacs*) - echo install/${PACKAGE}: Skipping unsupported emacs ${FLAVOR} - exit 0 - ;; - *) - echo install/${PACKAGE}: Handling install of emacsen flavor ${FLAVOR} -esac - -echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} - -#FLAVORTEST=`echo $FLAVOR | cut -c-6` -#if [ ${FLAVORTEST} = xemacs ] ; then -# SITEFLAG="-no-site-file" -#else -# SITEFLAG="--no-site-file" -#fi -FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" - -ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} -ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} -ELRELDIR=../../../emacs/site-lisp/${PACKAGE} - -# Install-info-altdir does not actually exist. -# Maybe somebody will write it. -if test -x /usr/sbin/install-info-altdir; then - echo install/${PACKAGE}: install Info links for ${FLAVOR} - install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz -fi - -install -m 755 -d ${ELCDIR} -cd ${ELDIR} -FILES=`echo *.el` -cd ${ELCDIR} -if [ $ELDIR != $ELCDIR ]; then - ln -sf ${ELRELDIR}/*.el . -fi - -cat << EOF > path.el -(debian-pkg-add-load-path-item ".") -(setq byte-compile-warnings nil) -EOF -${FLAVOR} ${FLAGS} ${FILES} -rm -f path.el - -exit 0 diff --git a/debian/emacsen-remove b/debian/emacsen-remove deleted file mode 100644 index 1768fbb..0000000 --- a/debian/emacsen-remove +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -e -# /usr/lib/emacsen-common/packages/remove/commit-patch - -FLAVOR=$1 -PACKAGE=commit-patch - -if [ ${FLAVOR} != emacs ]; then - if test -x /usr/sbin/install-info-altdir; then - echo remove/${PACKAGE}: removing Info links for ${FLAVOR} - install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/commit-patch.info.gz - fi - - echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} - rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} -fi diff --git a/debian/emacsen-startup b/debian/emacsen-startup deleted file mode 100644 index 9a965f2..0000000 --- a/debian/emacsen-startup +++ /dev/null @@ -1,23 +0,0 @@ -;; -*-emacs-lisp-*- -;; -;; Emacs startup file, e.g. /etc/emacs/site-start.d/50commit-patch.el -;; for the Debian commit-patch package -;; -;; Originally contributed by Nils Naumann -;; Modified by Dirk Eddelbuettel -;; Adapted for dh-make by Jim Van Zandt - -;; The commit-patch package follows the Debian/GNU Linux 'emacsen' policy and -;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, -;; xemacs19, emacs20, xemacs20...). The compiled code is then -;; installed in a subdirectory of the respective site-lisp directory. -;; We have to add this to the load-path: -(let ((package-dir (concat "/usr/share/" - (symbol-name flavor) - "/site-lisp/commit-patch"))) -;; If package-dir does not exist, the commit-patch package must have -;; removed but not purged, and we should skip the setup. - (when (file-directory-p package-dir) - (setq load-path (cons package-dir load-path)) - (eval-after-load 'diff-mode - '(require 'commit-patch-buffer nil 'noerror)))) diff --git a/debian/rules b/debian/rules index 7e5568f..6df2ad6 100755 --- a/debian/rules +++ b/debian/rules @@ -4,8 +4,13 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +ELPA_NAME=commit-patch-buffer +export ELPA_NAME + override_dh_auto_install: - make install PREFIX=debian/commit-patch/usr LISPDIR=/share/emacs/site-lisp/commit-patch + make install PREFIX=debian/commit-patch/usr + # dh_elpa copies the .el file to a new place + rm debian/commit-patch/usr/share/emacs/site-lisp/commit-patch-buffer.el # No need for another copy of the GPL: rm debian/commit-patch/usr/share/doc/commit-patch/COPYING # Installed by dh_installchangelogs: @@ -18,4 +23,4 @@ override_dh_auto_test: true %: - dh $@ --no-parallel + dh $@ --no-parallel --with elpa -- 2.51.2