[lintian] 01/02: New tag and associated tests: emacsen-common-without-dh-elpa
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit cd16b5ef444f68b51593bd0296d695c3e76e62ac
Author: Sean Whitton <spwhitton@spwhitton.name>
Date: Mon Jul 3 17:27:11 2017 +0100
New tag and associated tests: emacsen-common-without-dh-elpa
---
checks/elpa.desc | 23 +++++++++++
checks/elpa.pm | 38 +++++++++++++++++++
debian/control | 1 +
profiles/debian/main.profile | 12 +++---
t/tests/elpa/debian/debian/control.in | 16 ++++++++
t/tests/elpa/debian/debian/elpa-foo.elpa | 1 +
t/tests/elpa/debian/debian/rules | 4 ++
t/tests/elpa/debian/foo.el | 16 ++++++++
t/tests/elpa/desc | 6 +++
t/tests/elpa/tags | 0
.../emacsen-common/debian/debian/emacsen-compat | 1 +
.../emacsen-common/debian/debian/emacsen-install | 44 ++++++++++++++++++++++
.../emacsen-common/debian/debian/emacsen-remove | 15 ++++++++
.../emacsen-common/debian/debian/emacsen-startup | 24 ++++++++++++
t/tests/emacsen-common/debian/debian/install | 1 +
t/tests/emacsen-common/debian/foo.el | 1 +
t/tests/emacsen-common/desc | 6 +++
t/tests/emacsen-common/tags | 1 +
18 files changed, 204 insertions(+), 6 deletions(-)
diff --git a/checks/elpa.desc b/checks/elpa.desc
new file mode 100644
index 0000000..b5ada22
--- /dev/null
+++ b/checks/elpa.desc
@@ -0,0 +1,23 @@
+Check-Script: elpa
+Author: Sean Whitton <spwhitton@spwhitton.name>
+Abbrev: elpa
+Type: binary
+Needs-Info: unpacked
+Info: This script checks if the packages comply with various aspects of the
+ pkg-emacsen team's policy.
+
+Tag: emacsen-common-without-dh-elpa
+Severity: normal
+Certainty: certain
+Info: The package uses the emacsen-common infrastructure but the
+ package was not built with dh-elpa. Please consider transitioning
+ the package build to use dh-elpa, unless the package is required to
+ work with XEmacs.
+ .
+ dh-elpa centralises the emacsen-common maintscripts, which makes for
+ fewer bugs, and significantly easier cross-archive updates to emacsen
+ packages.
+ .
+ In addition, a package built with dh-elpa integrates with the GNU
+ Emacs package manager, for a better user experience.
+Ref: dh-elpa(1), dh-make-elpa(1), https://pkg-emacsen.alioth.debian.org/
diff --git a/checks/elpa.pm b/checks/elpa.pm
new file mode 100644
index 0000000..20f3ac0
--- /dev/null
+++ b/checks/elpa.pm
@@ -0,0 +1,38 @@
+# elpa -- lintian check script -*- perl -*-
+
+# Copyright (C) 2017 Sean Whitton
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::elpa;
+
+use strict;
+use warnings;
+
+use Lintian::Tags qw(tag);
+
+sub run {
+ my ($pkg, $type, $info, $proc, $group) = @_;
+
+ tag 'emacsen-common-without-dh-elpa'
+ if ($info->index('usr/lib/emacsen-common/packages/install/')
+ && (not $info->index('usr/share/emacs/site-lisp/elpa-src/')));
+
+ return;
+}
+
+1;
diff --git a/debian/control b/debian/control
index b307a6e..e47fe1e 100644
--- a/debian/control
+++ b/debian/control
@@ -17,6 +17,7 @@ Build-Depends: aspell,
cdbs,
debhelper (>= 9),
default-jdk,
+ dh-elpa,
diffstat,
docbook-utils,
docbook-xml,
diff --git a/profiles/debian/main.profile b/profiles/debian/main.profile
index 8829a95..7e4d126 100644
--- a/profiles/debian/main.profile
+++ b/profiles/debian/main.profile
@@ -4,10 +4,10 @@ Extends: debian/ftp-master-auto-reject
Enable-Tags-From-Check: apache2, application-not-library, appstream-metadata, automake,
binaries, changelog-file, changes-file, conffiles, control-file, control-files,
copyright-file, cruft, dbus, deb-format, debconf, debhelper, debian-readme,
- debian-source-dir, description, duplicate-files, fields, filename-length, files,
- gir, group-checks, huge-usr-share, infofiles, init.d, java, lintian, manpages,
- md5sums, menu-format, menus, nmu, obsolete-sites, ocaml, patch-systems, phppear,
- po-debconf, rules, scripts, shared-libs, source-copyright, standards-version,
- symlinks, systemd, testsuite, triggers, udev, upstream-metadata, usrmerge,
- version-substvars, watch-file
+ debian-source-dir, description, duplicate-files, elpa, fields, filename-length,
+ files, gir, group-checks, huge-usr-share, infofiles, init.d, java, lintian,
+ manpages, md5sums, menu-format, menus, nmu, obsolete-sites, ocaml,
+ patch-systems, phppear, po-debconf, rules, scripts, shared-libs,
+ source-copyright, standards-version, symlinks, systemd, testsuite, triggers,
+ udev, upstream-metadata, usrmerge, version-substvars, watch-file
diff --git a/t/tests/elpa/debian/debian/control.in b/t/tests/elpa/debian/debian/control.in
new file mode 100644
index 0000000..5b577b6
--- /dev/null
+++ b/t/tests/elpa/debian/debian/control.in
@@ -0,0 +1,16 @@
+Source: {$source}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}, dh-elpa
+Homepage: https://lintian.debian.org/
+
+Package: elpa-foo
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}, $\{elpa:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
diff --git a/t/tests/elpa/debian/debian/elpa-foo.elpa b/t/tests/elpa/debian/debian/elpa-foo.elpa
new file mode 100644
index 0000000..63163f5
--- /dev/null
+++ b/t/tests/elpa/debian/debian/elpa-foo.elpa
@@ -0,0 +1 @@
+foo.el
diff --git a/t/tests/elpa/debian/debian/rules b/t/tests/elpa/debian/debian/rules
new file mode 100755
index 0000000..e8e22ba
--- /dev/null
+++ b/t/tests/elpa/debian/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@ --with elpa
diff --git a/t/tests/elpa/debian/foo.el b/t/tests/elpa/debian/foo.el
new file mode 100644
index 0000000..6234f9d
--- /dev/null
+++ b/t/tests/elpa/debian/foo.el
@@ -0,0 +1,16 @@
+;;; foo.el --- foo
+
+;; Copyright (C) 2017 Sean Whitton
+
+;; Author: Sean Whitton <spwhitton@spwhitton.name>
+;; Version: 1.0
+;; Keywords: strings
+
+;;; Commentary:
+
+;;; Code:
+
+(message "Hello, world")
+
+(provide 'foo)
+;;; foo.el ends here
diff --git a/t/tests/elpa/desc b/t/tests/elpa/desc
new file mode 100644
index 0000000..5e4f14a
--- /dev/null
+++ b/t/tests/elpa/desc
@@ -0,0 +1,6 @@
+Testname: elpa
+Type: non-native
+Version: 1.0-1
+Description: Tests for emacsen-common packages using dh-elpa
+Test-Against:
+ emacsen-common-without-dh-elpa
diff --git a/t/tests/elpa/tags b/t/tests/elpa/tags
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/emacsen-common/debian/debian/emacsen-compat b/t/tests/emacsen-common/debian/debian/emacsen-compat
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/t/tests/emacsen-common/debian/debian/emacsen-compat
@@ -0,0 +1 @@
+0
diff --git a/t/tests/emacsen-common/debian/debian/emacsen-install b/t/tests/emacsen-common/debian/debian/emacsen-install
new file mode 100755
index 0000000..32dd6a5
--- /dev/null
+++ b/t/tests/emacsen-common/debian/debian/emacsen-install
@@ -0,0 +1,44 @@
+#! /bin/sh -e
+# /usr/lib/emacsen-common/packages/install/muse
+
+# Written by Jim Van Zandt <jrv@vanzandt.mv.com>, borrowing heavily
+# from the install scripts for gettext by Santiago Vila
+# <sanvila@ctv.es> and octave by Dirk Eddelbuettel <edd@debian.org>.
+
+FLAVOR=$1
+PACKAGE=foo-el
+
+if [ ${FLAVOR} = emacs ]; then exit 0; fi
+
+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"
+ELPREFIX=/usr/share/emacs/site-lisp/${PACKAGE}
+
+for i in ${PACKAGE} ${PACKAGE}/contrib; do
+
+ ELDIR=/usr/share/emacs/site-lisp/$i
+ ELCDIR=/usr/share/${FLAVOR}/site-lisp/$i
+
+ install -m 755 -d ${ELCDIR}
+ cd ${ELDIR}
+ FILES=`ls -1 *.el | grep -v autoloads`
+ rm -f ${ELCDIR}/*.el
+ cd ${ELCDIR}
+ ln -sf ${ELDIR}/*.el .
+
+ cat << EOF > path.el
+(setq load-path (cons "${ELPREFIX}" (cons "${ELPREFIX}/contrib" load-path))
+ byte-compile-warnings nil)
+EOF
+ ${FLAVOR} ${FLAGS} ${FILES} 2>&1 | gzip -9qf > CompilationLog.gz
+ rm -f path.el
+done
+
+exit 0
diff --git a/t/tests/emacsen-common/debian/debian/emacsen-remove b/t/tests/emacsen-common/debian/debian/emacsen-remove
new file mode 100755
index 0000000..9bc1fb3
--- /dev/null
+++ b/t/tests/emacsen-common/debian/debian/emacsen-remove
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+# /usr/lib/emacsen-common/packages/remove/muse
+
+FLAVOR=$1
+PACKAGE=foo-el
+
+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/info/emacs-wiki.info.gz
+ # fi
+
+ echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR}
+ rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE}
+fi
diff --git a/t/tests/emacsen-common/debian/debian/emacsen-startup b/t/tests/emacsen-common/debian/debian/emacsen-startup
new file mode 100644
index 0000000..3a059c3
--- /dev/null
+++ b/t/tests/emacsen-common/debian/debian/emacsen-startup
@@ -0,0 +1,24 @@
+;; -*-emacs-lisp-*-
+;;
+;; Emacs startup file for the Debian GNU/Linux muse package
+;;
+;; Originally contributed by Nils Naumann <naumann@unileoben.ac.at>
+;; Modified by Dirk Eddelbuettel <edd@debian.org>
+;; Adapted for dh-make by Jim Van Zandt <jrv@vanzandt.mv.com>
+;; Adapted for Muse by Michael Olson <mwolson@gnu.org>
+
+;; The muse 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:
+
+(if (not (file-exists-p "/usr/share/emacs/site-lisp/foo-el"))
+ (message "Package foo-el removed but not purged. Skipping setup.")
+ (let ((prefix (concat "/usr/share/"
+ (symbol-name flavor)
+ "/site-lisp/foo-el")))
+ (debian-pkg-add-load-path-item prefix)
+ (debian-pkg-add-load-path-item (concat prefix "/contrib")))
+
+ (load "foo-autoloads.el"))
diff --git a/t/tests/emacsen-common/debian/debian/install b/t/tests/emacsen-common/debian/debian/install
new file mode 100644
index 0000000..a2af265
--- /dev/null
+++ b/t/tests/emacsen-common/debian/debian/install
@@ -0,0 +1 @@
+foo.el /usr/share/emacs/site-lisp/foo-el
diff --git a/t/tests/emacsen-common/debian/foo.el b/t/tests/emacsen-common/debian/foo.el
new file mode 100644
index 0000000..414739b
--- /dev/null
+++ b/t/tests/emacsen-common/debian/foo.el
@@ -0,0 +1 @@
+(message "Hello, world")
diff --git a/t/tests/emacsen-common/desc b/t/tests/emacsen-common/desc
new file mode 100644
index 0000000..49bc50e
--- /dev/null
+++ b/t/tests/emacsen-common/desc
@@ -0,0 +1,6 @@
+Testname: emacsen-common
+Type: non-native
+Version: 1.0-1
+Description: Tests for emacsen-common packages not using dh-elpa
+Test-For:
+ emacsen-common-without-dh-elpa
diff --git a/t/tests/emacsen-common/tags b/t/tests/emacsen-common/tags
new file mode 100644
index 0000000..e7b9a7e
--- /dev/null
+++ b/t/tests/emacsen-common/tags
@@ -0,0 +1 @@
+W: emacsen-common: emacsen-common-without-dh-elpa
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: