unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* convert debian packaging to dh-elpa
@ 2016-11-11 11:46 David Bremner
  2016-11-11 11:46 ` [PATCH 1/3] emacs: generate notmuch-pkg.el David Bremner
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: David Bremner @ 2016-11-11 11:46 UTC (permalink / raw)
  To: notmuch

The main part which needs sanity checking is 

    [PATCH 1/3] emacs: generate notmuch-pkg.el

It may make sense later (after we drop support for emacs23) to make
our standard install also use package.el. 

This is mainly for information; you can see it drops a lot more than
it adds.  People maintaining packages for old derivatives might have
to revert this commit

[PATCH 2/3] debian: convert to use dh-elpa

Initially I thought about doing just a debian upload, but I'll
probably do another point release with some emacs bugfixes from Mark.

[PATCH 3/3] debian: changelog stanza for 0.23.1-2

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] emacs: generate notmuch-pkg.el
  2016-11-11 11:46 convert debian packaging to dh-elpa David Bremner
@ 2016-11-11 11:46 ` David Bremner
  2016-11-16 17:37   ` Tomi Ollila
  2016-11-11 11:46 ` [PATCH 2/3] debian: convert to use dh-elpa David Bremner
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: David Bremner @ 2016-11-11 11:46 UTC (permalink / raw)
  To: notmuch

This file contains metadata for the built in (as of emacs 24) packaging
system.
---
 Makefile.local            | 3 +++
 emacs/.gitignore          | 1 +
 emacs/Makefile.local      | 8 +++++++-
 emacs/notmuch-pkg.el.tmpl | 6 ++++++
 4 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 emacs/notmuch-pkg.el.tmpl

diff --git a/Makefile.local b/Makefile.local
index d1b0585..0a122ab 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -19,9 +19,12 @@ DATE:=$(shell date +%F)
 endif
 
 VERSION:=$(shell cat ${srcdir}/version)
+ELPA_VERSION:=$(subst ~,_,$(VERSION))
 ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
 ifeq ($(IS_GIT),yes)
 VERSION:=$(shell git --git-dir=${srcdir}/.git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
+# drop the ~g$sha1 part
+ELPA_VERSION:=$(word 1,$(subst ~, ,$(VERSION)))
 # Write the file 'version.stamp' in case its contents differ from $(VERSION)
 FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
 ifneq ($(FILE_VERSION),$(VERSION))
diff --git a/emacs/.gitignore b/emacs/.gitignore
index 9fa1c44..8e15eed 100644
--- a/emacs/.gitignore
+++ b/emacs/.gitignore
@@ -1,3 +1,4 @@
 .eldeps*
 *.elc
 notmuch-version.el
+notmuch-pkg.el
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 2d6aedb..e4f7a04 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -27,6 +27,12 @@ $(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
 	@sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
 	     -e 's/%VERSION%/"$(VERSION)"/' $< > $@
 
+$(dir)/notmuch-pkg.el: $(srcdir)/$(dir)/notmuch-pkg.el.tmpl
+	@sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
+	     -e 's/%VERSION%/"$(ELPA_VERSION)"/' $< > $@
+
+all: $(dir)/notmuch-pkg.el
+install-emacs: $(dir)/notmuch-pkg.el
 
 emacs_images := \
 	$(srcdir)/$(dir)/notmuch-logo.png
@@ -84,4 +90,4 @@ endif
 	mkdir -p "$(DESTDIR)$(emacsetcdir)"
 	install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
 
-CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el
+CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el
diff --git a/emacs/notmuch-pkg.el.tmpl b/emacs/notmuch-pkg.el.tmpl
new file mode 100644
index 0000000..de97baa
--- /dev/null
+++ b/emacs/notmuch-pkg.el.tmpl
@@ -0,0 +1,6 @@
+;; %AG%
+(define-package
+  "notmuch"
+  %VERSION%
+  "Emacs based front-end (MUA) for notmuch"
+  nil)
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] debian: convert to use dh-elpa
  2016-11-11 11:46 convert debian packaging to dh-elpa David Bremner
  2016-11-11 11:46 ` [PATCH 1/3] emacs: generate notmuch-pkg.el David Bremner
@ 2016-11-11 11:46 ` David Bremner
  2016-11-11 11:46 ` [PATCH 3/3] debian: changelog stanza for 0.23.1-2 David Bremner
  2016-11-17 12:29 ` convert debian packaging to dh-elpa David Bremner
  3 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2016-11-11 11:46 UTC (permalink / raw)
  To: notmuch

This packaging helper eliminates most of the boilerplate from packaging
emacs extensions for debian. It requires package.el compatible metadata.
---
 debian/control                       | 14 +++++------
 debian/elpa-notmuch.elpa             |  1 +
 debian/notmuch-emacs.dirs            |  1 -
 debian/notmuch-emacs.emacsen-compat  |  1 -
 debian/notmuch-emacs.emacsen-install | 48 ------------------------------------
 debian/notmuch-emacs.emacsen-remove  | 34 -------------------------
 debian/notmuch-emacs.install         |  1 -
 debian/notmuch-emacs.postinst        |  7 ------
 debian/notmuch-emacs.prerm           |  3 ---
 debian/rules                         |  2 +-
 10 files changed, 9 insertions(+), 103 deletions(-)
 create mode 100644 debian/elpa-notmuch.elpa
 delete mode 100644 debian/notmuch-emacs.dirs
 delete mode 100644 debian/notmuch-emacs.emacsen-compat
 delete mode 100755 debian/notmuch-emacs.emacsen-install
 delete mode 100755 debian/notmuch-emacs.emacsen-remove
 delete mode 100644 debian/notmuch-emacs.install
 delete mode 100644 debian/notmuch-emacs.postinst
 delete mode 100644 debian/notmuch-emacs.prerm

diff --git a/debian/control b/debian/control
index 4027a79..a8c7ce2 100644
--- a/debian/control
+++ b/debian/control
@@ -17,6 +17,7 @@ Build-Depends:
  python-all (>= 2.6.6-3~),
  python3-all (>= 3.1.2-7~),
  dh-python,
+ dh-elpa (>= 1.3),
  python-sphinx (>= 1.0),
  ruby, ruby-dev (>>1:1.9.3~),
  emacs24-nox | emacs24 (>=24~) | emacs24-lucid (>=24~) |
@@ -111,13 +112,12 @@ Description: Ruby interface to the notmuch mail search and index library
 
 Package: notmuch-emacs
 Architecture: all
-Section: mail
-Breaks: notmuch (<<0.6~254~)
-Replaces: notmuch (<<0.6~254~)
-Depends: ${misc:Depends}, notmuch (>= ${source:Version}),
- emacs23 (>= 23~) | emacs23-nox (>=23~) | emacs23-lucid (>=23~) |
- emacs24 (>= 24~) | emacs24-nox (>=24~) | emacs24-lucid (>=24~),
- emacsen-common (>= 2.0.8)
+Description: thread-based email index, search and tagging (transitional package)
+ This dummy package help ease transition to the new package elpa-notmuch
+
+Package: elpa-notmuch
+Architecture: all
+Depends: ${misc:Depends}, ${elpa:Depends}
 Description: thread-based email index, search and tagging (emacs interface)
  Notmuch is a system for indexing, searching, reading, and tagging
  large collections of email messages in maildir or mh format. It uses
diff --git a/debian/elpa-notmuch.elpa b/debian/elpa-notmuch.elpa
new file mode 100644
index 0000000..b4e9e17
--- /dev/null
+++ b/debian/elpa-notmuch.elpa
@@ -0,0 +1 @@
+emacs/*.el
diff --git a/debian/notmuch-emacs.dirs b/debian/notmuch-emacs.dirs
deleted file mode 100644
index caeb400..0000000
--- a/debian/notmuch-emacs.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/emacs/site-lisp/notmuch
diff --git a/debian/notmuch-emacs.emacsen-compat b/debian/notmuch-emacs.emacsen-compat
deleted file mode 100644
index 573541a..0000000
--- a/debian/notmuch-emacs.emacsen-compat
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/debian/notmuch-emacs.emacsen-install b/debian/notmuch-emacs.emacsen-install
deleted file mode 100755
index cce95c3..0000000
--- a/debian/notmuch-emacs.emacsen-install
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-# /usr/lib/emacsen-common/packages/install/notmuch-emacs
-set -e
-
-FLAVOR=$1
-PACKAGE=notmuch
-
-case "${FLAVOR}" in
-    emacs)
-	return 0
-	;;
-    xemacs*|emacs2[12])
-	# patches welcome.
-	echo install/${PACKAGE}: skipping install for unsupported emacsen flavor ${FLAVOR}
-	exit 0
-	;;
-    *)
-	echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR}
-esac
-
-
-elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
-el_dir=/usr/share/emacs/site-lisp/${PACKAGE}
-
-byte_compile_options="--quick --directory=${el_dir} -batch -f batch-byte-compile"
-
-echo install/${PACKAGE}: byte-compiling for ${FLAVOR}
-
-[ -d ${elc_dir} ] || mkdir ${elc_dir}
-
-# Create symlinks to the .el files (see section 6E in debian-emacs
-# polcy).  This makes complation easy, and also allows find-function
-# and find-library to work properly.
-(cd ${elc_dir} && ln -sf ${el_dir}/*.el .)
-
-# Byte compile them
-(cd ${elc_dir}
- set +e
- ${FLAVOR} ${byte_compile_options} *.el > Install.log 2>&1
- if test $? -ne 0
- then
-   cat Install.log
-   exit 1
- fi
- set -e
- gzip -9f Install.log)
-
-exit 0;
diff --git a/debian/notmuch-emacs.emacsen-remove b/debian/notmuch-emacs.emacsen-remove
deleted file mode 100755
index a555320..0000000
--- a/debian/notmuch-emacs.emacsen-remove
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# /usr/lib/emacsen-common/packages/remove/notmuch
-
-set -e
-
-FLAVOR=$1
-PACKAGE=notmuch
-elc_dir=/usr/share/${FLAVOR}/site-lisp/${PACKAGE}
-
-case "${FLAVOR}" in
-    emacs)
-	return 0
-	;;
-    xemacs*|emacs2[12])
-	# patches welcome.
-	echo install/${PACKAGE}: skipping removal for unsupported emacsen flavor ${FLAVOR}
-	exit 0
-	;;
-    *)
-	echo remove/${PACKAGE}: Handling removal for emacsen flavor ${FLAVOR}
-esac
-
-echo remove/${PACKAGE}: Handling removal of emacsen flavor ${FLAVOR}
-
-echo emacsen-common: purging byte-compiled files for ${FLAVOR}
-rm -f ${elc_dir}/*.elc
-rm -f ${elc_dir}/*.el
-rm -f ${elc_dir}/Install.log*
-if test -e "${elc_dir}"
-then
-  rmdir --ignore-fail-on-non-empty "${elc_dir}"
-fi
-
-exit 0;
diff --git a/debian/notmuch-emacs.install b/debian/notmuch-emacs.install
deleted file mode 100644
index c73aece..0000000
--- a/debian/notmuch-emacs.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/emacs/site-lisp/notmuch/*.el
diff --git a/debian/notmuch-emacs.postinst b/debian/notmuch-emacs.postinst
deleted file mode 100644
index 1237237..0000000
--- a/debian/notmuch-emacs.postinst
+++ /dev/null
@@ -1,7 +0,0 @@
-dir="/var/lib/emacsen-common/state/package/installed"
-mkdir -p -m 0755 ${dir}
-touch ${dir}/notmuch-emacs
-#DEBHELPER#
-if [ -d /0755 ]; then
-   rmdir /0755 || true
-fi
diff --git a/debian/notmuch-emacs.prerm b/debian/notmuch-emacs.prerm
deleted file mode 100644
index 5e2758d..0000000
--- a/debian/notmuch-emacs.prerm
+++ /dev/null
@@ -1,3 +0,0 @@
-#DEBHELPER#
-dir="/var/lib/emacsen-common/state/package/installed"
-rm -f ${dir}/notmuch-emacs
diff --git a/debian/rules b/debian/rules
index 04f0062..15710a8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 python3_all = py3versions -s | xargs -n1 | xargs -t -I {} env {}
 
 %:
-	dh $@ --with python2,python3
+	dh $@ --with python2,python3,elpa
 
 override_dh_auto_configure:
 	./configure --prefix=/usr \
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] debian: changelog stanza for 0.23.1-2
  2016-11-11 11:46 convert debian packaging to dh-elpa David Bremner
  2016-11-11 11:46 ` [PATCH 1/3] emacs: generate notmuch-pkg.el David Bremner
  2016-11-11 11:46 ` [PATCH 2/3] debian: convert to use dh-elpa David Bremner
@ 2016-11-11 11:46 ` David Bremner
  2016-11-17 12:29 ` convert debian packaging to dh-elpa David Bremner
  3 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2016-11-11 11:46 UTC (permalink / raw)
  To: notmuch

---
 debian/changelog | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 2c7cd23..05d3522 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+notmuch (0.23.1-2) unstable; urgency=medium
+
+  * Convert notmuch-emacs to dh-elpa, new binary package elpa-notmuch
+  * Bug fix: "maintainer script(s) do not start on #!", thanks to
+    treinen@debian.org; (Closes: #843287).
+
+ -- David Bremner <bremner@debian.org>  Thu, 10 Nov 2016 22:36:04 -0400
+
 notmuch (0.23.1-1) unstable; urgency=medium
 
   * New upstream bugfix release
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] emacs: generate notmuch-pkg.el
  2016-11-11 11:46 ` [PATCH 1/3] emacs: generate notmuch-pkg.el David Bremner
@ 2016-11-16 17:37   ` Tomi Ollila
  0 siblings, 0 replies; 6+ messages in thread
From: Tomi Ollila @ 2016-11-16 17:37 UTC (permalink / raw)
  To: David Bremner, notmuch

On Fri, Nov 11 2016, David Bremner <david@tethera.net> wrote:

> This file contains metadata for the built in (as of emacs 24) packaging
> system.

Series LGTM.

Tomi


> ---
>  Makefile.local            | 3 +++
>  emacs/.gitignore          | 1 +
>  emacs/Makefile.local      | 8 +++++++-
>  emacs/notmuch-pkg.el.tmpl | 6 ++++++
>  4 files changed, 17 insertions(+), 1 deletion(-)
>  create mode 100644 emacs/notmuch-pkg.el.tmpl
>
> diff --git a/Makefile.local b/Makefile.local
> index d1b0585..0a122ab 100644
> --- a/Makefile.local
> +++ b/Makefile.local
> @@ -19,9 +19,12 @@ DATE:=$(shell date +%F)
>  endif
>  
>  VERSION:=$(shell cat ${srcdir}/version)
> +ELPA_VERSION:=$(subst ~,_,$(VERSION))
>  ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
>  ifeq ($(IS_GIT),yes)
>  VERSION:=$(shell git --git-dir=${srcdir}/.git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
> +# drop the ~g$sha1 part
> +ELPA_VERSION:=$(word 1,$(subst ~, ,$(VERSION)))
>  # Write the file 'version.stamp' in case its contents differ from $(VERSION)
>  FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
>  ifneq ($(FILE_VERSION),$(VERSION))
> diff --git a/emacs/.gitignore b/emacs/.gitignore
> index 9fa1c44..8e15eed 100644
> --- a/emacs/.gitignore
> +++ b/emacs/.gitignore
> @@ -1,3 +1,4 @@
>  .eldeps*
>  *.elc
>  notmuch-version.el
> +notmuch-pkg.el
> diff --git a/emacs/Makefile.local b/emacs/Makefile.local
> index 2d6aedb..e4f7a04 100644
> --- a/emacs/Makefile.local
> +++ b/emacs/Makefile.local
> @@ -27,6 +27,12 @@ $(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
>  	@sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
>  	     -e 's/%VERSION%/"$(VERSION)"/' $< > $@
>  
> +$(dir)/notmuch-pkg.el: $(srcdir)/$(dir)/notmuch-pkg.el.tmpl
> +	@sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
> +	     -e 's/%VERSION%/"$(ELPA_VERSION)"/' $< > $@
> +
> +all: $(dir)/notmuch-pkg.el
> +install-emacs: $(dir)/notmuch-pkg.el
>  
>  emacs_images := \
>  	$(srcdir)/$(dir)/notmuch-logo.png
> @@ -84,4 +90,4 @@ endif
>  	mkdir -p "$(DESTDIR)$(emacsetcdir)"
>  	install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
>  
> -CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el
> +CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el
> diff --git a/emacs/notmuch-pkg.el.tmpl b/emacs/notmuch-pkg.el.tmpl
> new file mode 100644
> index 0000000..de97baa
> --- /dev/null
> +++ b/emacs/notmuch-pkg.el.tmpl
> @@ -0,0 +1,6 @@
> +;; %AG%
> +(define-package
> +  "notmuch"
> +  %VERSION%
> +  "Emacs based front-end (MUA) for notmuch"
> +  nil)
> -- 
> 2.10.2
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: convert debian packaging to dh-elpa
  2016-11-11 11:46 convert debian packaging to dh-elpa David Bremner
                   ` (2 preceding siblings ...)
  2016-11-11 11:46 ` [PATCH 3/3] debian: changelog stanza for 0.23.1-2 David Bremner
@ 2016-11-17 12:29 ` David Bremner
  3 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2016-11-17 12:29 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> The main part which needs sanity checking is 
>
>     [PATCH 1/3] emacs: generate notmuch-pkg.el
>
> It may make sense later (after we drop support for emacs23) to make
> our standard install also use package.el. 

series pushed to release, with the debian versioning modified to reflect
an upstream point release

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-17 12:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11 11:46 convert debian packaging to dh-elpa David Bremner
2016-11-11 11:46 ` [PATCH 1/3] emacs: generate notmuch-pkg.el David Bremner
2016-11-16 17:37   ` Tomi Ollila
2016-11-11 11:46 ` [PATCH 2/3] debian: convert to use dh-elpa David Bremner
2016-11-11 11:46 ` [PATCH 3/3] debian: changelog stanza for 0.23.1-2 David Bremner
2016-11-17 12:29 ` convert debian packaging to dh-elpa David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).