1 Return-Path: <jeff@ocjtech.us>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 887B3431FBC
\r
6 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 06:27:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id xGqVpb-09FmG for <notmuch@notmuchmail.org>;
\r
11 Thu, 19 Nov 2009 06:27:27 -0800 (PST)
\r
12 Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com
\r
14 by olra.theworths.org (Postfix) with ESMTP id A0C94431FAE
\r
15 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 06:27:27 -0800 (PST)
\r
16 Received: by yxe42 with SMTP id 42so2346340yxe.22
\r
17 for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 06:27:25 -0800 (PST)
\r
18 Received: by 10.150.28.4 with SMTP id b4mr238825ybb.124.1258640844305;
\r
19 Thu, 19 Nov 2009 06:27:24 -0800 (PST)
\r
20 Received: from lt26923.campus.dmacc.edu ([161.210.45.123])
\r
21 by mx.google.com with ESMTPS id 13sm324247gxk.13.2009.11.19.06.27.23
\r
22 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
23 Thu, 19 Nov 2009 06:27:23 -0800 (PST)
\r
24 Received: from localhost ([127.0.0.1] helo=localhost.localdomain)
\r
25 by lt26923.campus.dmacc.edu with esmtps (TLSv1:AES256-SHA:256)
\r
26 (Exim 4.69) (envelope-from <jeff@ocjtech.us>)
\r
27 id 1NB7yk-00015R-CD; Thu, 19 Nov 2009 08:27:22 -0600
\r
28 From: "Jeffrey C. Ollie" <jeff@ocjtech.us>
\r
29 To: Not Much Mail <notmuch@notmuchmail.org>
\r
30 Date: Thu, 19 Nov 2009 08:27:02 -0600
\r
31 Message-Id: <1258640822-4146-1-git-send-email-jeff@ocjtech.us>
\r
32 X-Mailer: git-send-email 1.6.5.2
\r
33 In-Reply-To: <1258636656-sup-8390@cannonball>
\r
34 References: <1258636656-sup-8390@cannonball>
\r
35 Subject: [notmuch] [PATCH] notmuch: improve installation of emacs mode
\r
36 X-BeenThere: notmuch@notmuchmail.org
\r
37 X-Mailman-Version: 2.1.12
\r
39 List-Id: "Use and development of the notmuch mail system."
\r
40 <notmuch.notmuchmail.org>
\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
42 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
44 List-Post: <mailto:notmuch@notmuchmail.org>
\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
48 X-List-Received-Date: Thu, 19 Nov 2009 14:27:28 -0000
\r
50 1) Add a separate targets to build and install emacs mode.
\r
52 2) Don't hardcode the installation directory, instead use emacs'
\r
55 3) Install a byte compiled version of the emacs mode.
\r
57 4) Install the emacs mode in emacs' site-start directory so that it
\r
58 gets loaded automatically.
\r
60 5) Ignore byte-compiled emacs files.
\r
62 Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
\r
66 Makefile.local | 15 ++++++++++++---
\r
67 3 files changed, 19 insertions(+), 4 deletions(-)
\r
69 diff --git a/.gitignore b/.gitignore
\r
70 index 8417d60..7d3c543 100644
\r
73 @@ -5,4 +5,4 @@ notmuch.1.gz
\r
79 diff --git a/Makefile b/Makefile
\r
80 index 023b2ec..17fa4a2 100644
\r
83 @@ -7,6 +7,9 @@ CFLAGS=-O2
\r
84 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)
\r
85 extra_cxxflags := $(shell xapian-config --cxxflags)
\r
87 +emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)
\r
88 +emacs_startdir := $(shell pkg-config emacs --variable sitestartdir)
\r
90 # Now smash together user's values with our extra values
\r
91 override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
\r
92 override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
\r
93 @@ -28,6 +31,9 @@ include Makefile.config
\r
95 $(CC) -c $(CFLAGS) $< -o $@
\r
98 + emacs -batch -f batch-byte-compile $<
\r
101 @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
\r
102 $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
\r
103 diff --git a/Makefile.local b/Makefile.local
\r
104 index 6bc01a5..2bb4521 100644
\r
105 --- a/Makefile.local
\r
106 +++ b/Makefile.local
\r
108 all: notmuch notmuch.1.gz
\r
110 +emacs: notmuch.elc
\r
112 notmuch_client_srcs = \
\r
115 @@ -25,15 +27,22 @@ notmuch.1.gz: notmuch.1
\r
117 install: all notmuch.1.gz
\r
118 for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \
\r
119 - $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \
\r
120 + $(DESTDIR)/etc/bash_completion.d/ ; \
\r
124 install notmuch $(DESTDIR)$(prefix)/bin/
\r
125 install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
\r
126 - install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/
\r
127 install notmuch-completion.bash \
\r
128 $(DESTDIR)/etc/bash_completion.d/notmuch
\r
130 +install-emacs: install emacs
\r
131 + for d in $(DESTDIR)/$(emacs_startdir) ; \
\r
133 + install -d $$d ; \
\r
135 + install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir)
\r
136 + install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir)
\r
138 SRCS := $(SRCS) $(notmuch_client_srcs)
\r
139 -CLEAN := $(CLEAN) notmuch $(notmuch_client_modules)
\r
140 +CLEAN := $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc
\r