From 744ff27882bd96d2db44c720040a6adaf91baa30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Fri, 17 Sep 2021 15:17:38 +0200 Subject: [PATCH] Migrate emacsen helpers to dh_elpa Closes: #802915 --- debian/changelog | 6 ++++++ debian/clean | 1 + debian/cmake-data.elpa | 2 ++ debian/cmake-data.emacsen-compat | 1 - debian/cmake-data.emacsen-install | 28 ---------------------------- debian/cmake-data.emacsen-remove | 11 ----------- debian/cmake-data.emacsen-startup | 15 --------------- debian/cmake-data.install | 1 - debian/cmake-data.maintscript | 1 + debian/cmake-mode-pkg.el.in | 4 ++++ debian/control | 6 ++++-- debian/not-installed | 2 ++ debian/rules | 7 ++++++- 13 files changed, 26 insertions(+), 59 deletions(-) create mode 100644 debian/clean create mode 100644 debian/cmake-data.elpa delete mode 100644 debian/cmake-data.emacsen-compat delete mode 100644 debian/cmake-data.emacsen-install delete mode 100644 debian/cmake-data.emacsen-remove delete mode 100644 debian/cmake-data.emacsen-startup create mode 100644 debian/cmake-data.maintscript create mode 100644 debian/cmake-mode-pkg.el.in diff --git a/debian/changelog b/debian/changelog index 54726c300..69deca004 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cmake (3.21.2-2) UNRELEASED; urgency=medium + + * Migrate emacsen helpers to dh_elpa (Closes: #802915) + + -- Timo Röhling Fri, 17 Sep 2021 14:42:17 +0200 + cmake (3.21.2-1) unstable; urgency=medium [ Debian Janitor ] diff --git a/debian/clean b/debian/clean new file mode 100644 index 000000000..7dd56b4cf --- /dev/null +++ b/debian/clean @@ -0,0 +1 @@ +debian/cmake-mode-pkg.el diff --git a/debian/cmake-data.elpa b/debian/cmake-data.elpa new file mode 100644 index 000000000..99bb09751 --- /dev/null +++ b/debian/cmake-data.elpa @@ -0,0 +1,2 @@ +debian/cmake-mode-pkg.el +Auxiliary/cmake-mode.el diff --git a/debian/cmake-data.emacsen-compat b/debian/cmake-data.emacsen-compat deleted file mode 100644 index 573541ac9..000000000 --- a/debian/cmake-data.emacsen-compat +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/debian/cmake-data.emacsen-install b/debian/cmake-data.emacsen-install deleted file mode 100644 index e7f0356e2..000000000 --- a/debian/cmake-data.emacsen-install +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# emacsen install script for the Debian GNU/Linux cmake package - -FLAVOR=$1 -PACKAGE=cmake-data - -ELDIR=/usr/share/emacs/site-lisp/ -ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} -ELFILE="cmake-mode.el" -FLAGS="-batch -no-site-file -l path.el -f batch-byte-compile" - -if [ ${FLAVOR} != emacs ]; then - echo install/${PACKAGE}: Byte-compiling for ${FLAVOR} - - install -m 755 -d ${ELCDIR} - - # Source file symlink (emacsen policy 5C) - ln -s "${ELDIR}/${ELFILE}" "${ELCDIR}/${ELFILE}" - - # Compile cmake-mode.el - cd ${ELCDIR} - cat << EOF > path.el -(setq load-path (cons "." load-path) byte-compile-warnings nil) -EOF - ${FLAVOR} ${FLAGS} ${ELFILE} - rm -f path.el -fi diff --git a/debian/cmake-data.emacsen-remove b/debian/cmake-data.emacsen-remove deleted file mode 100644 index 52191ea73..000000000 --- a/debian/cmake-data.emacsen-remove +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -e - -FLAVOR=$1 -PACKAGE=cmake-data -ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} - -if [ ${FLAVOR} != emacs ]; then - echo remove/${PACKAGE}: Purging byte-compiled files for ${FLAVOR} - rm -rf "${ELCDIR}" -fi diff --git a/debian/cmake-data.emacsen-startup b/debian/cmake-data.emacsen-startup deleted file mode 100644 index 96fa7bab1..000000000 --- a/debian/cmake-data.emacsen-startup +++ /dev/null @@ -1,15 +0,0 @@ -;; -*-emacs-lisp-*- -;; -;; Emacs startup file for the Debian GNU/Linux cmake package - -(if (file-exists-p "/usr/share/emacs/site-lisp/cmake-mode.el") - (progn - (debian-pkg-add-load-path-item (concat "/usr/share/" - (symbol-name debian-emacs-flavor) - "/site-lisp/cmake-data")) - (autoload 'cmake-mode "cmake-mode") - (setq auto-mode-alist - (append '(("CMakeLists\\.txt\\'" . cmake-mode) - ("\\.cmake\\'" . cmake-mode)) - auto-mode-alist))) - (message "cmake-data removed but not purged, skipping setup")) diff --git a/debian/cmake-data.install b/debian/cmake-data.install index 4f2d10b80..4da8e3357 100644 --- a/debian/cmake-data.install +++ b/debian/cmake-data.install @@ -1,6 +1,5 @@ usr/share/aclocal/cmake.m4 usr/share/cmake-*/ -usr/share/emacs/site-lisp/cmake-mode.el usr/share/man/man7/cmake-buildsystem.7 usr/share/man/man7/cmake-commands.7 usr/share/man/man7/cmake-compile-features.7 diff --git a/debian/cmake-data.maintscript b/debian/cmake-data.maintscript new file mode 100644 index 000000000..c2f2c8ca6 --- /dev/null +++ b/debian/cmake-data.maintscript @@ -0,0 +1 @@ +rm_conffile /etc/emacs/site-start.d/50cmake-data.el 3.21.2-2~ diff --git a/debian/cmake-mode-pkg.el.in b/debian/cmake-mode-pkg.el.in new file mode 100644 index 000000000..d522e5303 --- /dev/null +++ b/debian/cmake-mode-pkg.el.in @@ -0,0 +1,4 @@ +;;; -*- no-byte-compile: t -*- +(define-package "cmake-mode" "@VERSION@" "major-mode for editing CMake sources" + '((emacs "24.1")) +) diff --git a/debian/control b/debian/control index 1423ac6a7..0ecb1da9d 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,8 @@ Build-Depends: debhelper-compat (= 13), zlib1g-dev, python3-sphinx, python3-sphinxcontrib.qthelp | python3-sphinx (<< 2.0), - dh-sequence-sphinxdoc + dh-sequence-sphinxdoc, + dh-elpa Rules-Requires-Root: no Standards-Version: 4.6.0 Vcs-Git: https://salsa.debian.org/cmake-team/cmake.git @@ -32,7 +33,8 @@ Multi-Arch: foreign Depends: cmake-data (= ${source:Version}), procps [!hurd-any], ${misc:Depends}, - ${shlibs:Depends} + ${shlibs:Depends}, + ${elpa:Depends} Recommends: gcc, make Suggests: cmake-doc, ninja-build Description: cross-platform, open-source make system diff --git a/debian/not-installed b/debian/not-installed index 223eeed22..1aa115a78 100644 --- a/debian/not-installed +++ b/debian/not-installed @@ -1,3 +1,5 @@ usr/share/doc/cmake/cmcompress/Copyright.txt usr/share/doc/cmake-data/Copyright.txt usr/share/doc/cmake-data/cmsys/Copyright.txt +usr/share/doc/cmake-data/cmsys/Copyright.txt +usr/share/emacs/site-lisp/cmake-mode.el diff --git a/debian/rules b/debian/rules index 2dd86c59a..5845c6856 100755 --- a/debian/rules +++ b/debian/rules @@ -69,5 +69,10 @@ override_dh_installdocs-indep: override_dh_sphinxdoc: dh_sphinxdoc -pcmake-doc +export ELPA_NAME = cmake-mode +execute_before_dh_elpa: debian/cmake-mode-pkg.el +debian/cmake-mode-pkg.el: debian/cmake-mode-pkg.el.in + sed -e 's/@VERSION@/$(DEB_VERSION_UPSTREAM)/' $< > $@ + %: - dh $@ --builddirectory=Build + dh $@ --with elpa --builddirectory=Build