Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2FE09431FBD; Tue, 1 Dec 2009 10:19:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R3RKGqbc7dUj; Tue, 1 Dec 2009 10:19:05 -0800 (PST) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5EA05431FAE; Tue, 1 Dec 2009 10:19:05 -0800 (PST) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 6A8B9254419; Tue, 1 Dec 2009 10:18:47 -0800 (PST) From: Carl Worth To: Ingmar Vanhassel , notmuch In-Reply-To: <1258990831-sup-2789@cannonball> References: <46263c600911230731i529f2db5rec11bed02f84ef13@mail.gmail.com> <1258990831-sup-2789@cannonball> Date: Tue, 01 Dec 2009 10:18:46 -0800 Message-ID: <87einea77d.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: [notmuch] [patch] Trivial fix for non-root install X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 18:19:06 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 23 Nov 2009 16:41:23 +0100, Ingmar Vanhassel w= rote: > Excerpts from Brett Viren's message of Mon Nov 23 16:31:47 +0100 2009: > > Installing as a normal user fails because the bash completion config > > files try to install into /etc. This trivial patch fixes this. >=20 > Your patch breaks the more common case of installing as root user. It > now installs into /usr/etc where bash completions most likely won't be > found. Here's a compromise, which is to move the installation of the bash completion support from "make install" to a new "make install-bash". So I think we'll end up with a bunch of install- targets corresponding to each of the things in contrib. And it then shouldn't be surprising that things in contrib aren't installed by "make install". The only thing I think I'd really like beyond this is a better way to advertise the existence of the various install- targets, (maybe a message at the end of "make install" that greps and seds these out of Makefile.local?). =2DCarl commit 7c2c26bc4ec5fdab5c6fa72ea325d846b46929e3 Author: Carl Worth Date: Tue Dec 1 10:14:00 2009 -0800 Makefile: Add new "install-bash" target for bash completion support =20=20=20=20 It was problematic to have this in "make install" since it would unconditionally try to install to /etc, (even if a non-privileged user was attempting an install to a prefix in the user's home directory, for example). diff --git a/Makefile b/Makefile index ae0f991..e42584b 100644 =2D-- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ ifeq ($(emacs_lispdir),) emacs_lispdir =3D $(prefix)/share/emacs/site-lisp endif =20 +bash_completion_dir =3D /etc/bash_completion.d + all_deps =3D Makefile Makefile.local Makefile.config \ lib/Makefile lib/Makefile.local =20 diff --git a/Makefile.local b/Makefile.local index 1744747..aff7d2c 100644 =2D-- a/Makefile.local +++ b/Makefile.local @@ -29,15 +29,12 @@ notmuch.1.gz: notmuch.1 $(call quiet,gzip) --stdout $^ > $@ =20 install: all notmuch.1.gz =2D for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/m= an1 \ =2D $(DESTDIR)$(bash_completion_dir) ; \ + for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man= 1 ; \ do \ install -d $$d ; \ done ; install notmuch $(DESTDIR)$(prefix)/bin/ install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/ =2D install contrib/notmuch-completion.bash \ =2D $(DESTDIR)$(bash_completion_dir)/notmuch =20 install-emacs: install emacs for d in $(DESTDIR)/$(emacs_lispdir) ; \ @@ -47,5 +44,10 @@ install-emacs: install emacs install -m0644 notmuch.el $(DESTDIR)$(emacs_lispdir) install -m0644 notmuch.elc $(DESTDIR)$(emacs_lispdir) =20 +install-bash: + install -d $(DESTDIR)$(bash_completion_dir) + install contrib/notmuch-completion.bash \ + $(DESTDIR)$(bash_completion_dir)/notmuch + SRCS :=3D $(SRCS) $(notmuch_client_srcs) CLEAN :=3D $(CLEAN) notmuch $(notmuch_client_modules) notmuch.elc notmuch.= 1.gz diff --git a/configure b/configure index 64816e0..140711f 100755 =2D-- a/configure +++ b/configure @@ -133,6 +133,5 @@ EOF # construct the Makefile.config cat > Makefile.config <