Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2012 15:08:51 GMT
From:      Adam Weinberger <adamw@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/164405: [PATCH] sysutils/tmux - install bash completions into completion dir
Message-ID:  <201201231508.q0NF8p8B008764@freefall.freebsd.org>
Resent-Message-ID: <201201231510.q0NFA8pL008945@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         164405
>Category:       ports
>Synopsis:       [PATCH] sysutils/tmux - install bash completions into completion dir
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 23 15:10:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Adam Weinberger
>Release:        FreeBSD 8.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 8.2-STABLE FreeBSD 8.2-STABLE #5 r227907: Wed Nov 23 21:55:50 UTC 2011 simon@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386


	
>Description:

tmux installs a bash completion into ${EXAMPLESDIR}. I thought it might
be nice to put it into the bash completion dir so it's be active.

The attached patch hard-links the file into the bash completion dir.
Unfortunately it has to be an OPTION.

	
>How-To-Repeat:
	
>Fix:

	

--- tmux.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/tmux/Makefile,v
retrieving revision 1.32
diff -u -d -p -r1.32 Makefile
--- Makefile	23 Sep 2011 22:25:37 -0000	1.32
+++ Makefile	23 Jan 2012 15:02:28 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	tmux
 PORTVERSION=	1.5
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
 
@@ -26,7 +27,8 @@ PORTEXAMPLES=	*
 
 OPTIONS=	LIBEVENT2	"Use libevent version 2" Off \
 		LIBEVENT_STATIC	"Build with static libevent" Off \
-		BACKSPACE 	"Build with tty/keys patch" Off
+		BACKSPACE 	"Build with tty/keys patch" Off \
+		BASH_COMPLETE	"Install bash completions" Off
 
 .include <bsd.port.pre.mk>
 
@@ -50,6 +52,12 @@ LESTATIC=	${LOCALBASE}/lib/libevent.a
 EXTRA_PATCHES=	${PATCHDIR}/extra-patch-tty-keys.c
 .endif
 
+.if defined(WITH_BASH_COMPLETE)
+BASH_COMPLETE_DIR=	etc/bash_completion.d
+RUN_DEPENDS+=	${PREFIX}/${BASH_COMPLETE_DIR}:${PORTSDIR}/shells/bash-completion
+PLIST_FILES+=	${BASH_COMPLETE_DIR}/${PORTNAME}
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|/etc/tmux.conf|${PREFIX}/etc/tmux.conf|g' \
 		${WRKSRC}/tmux.1 ${WRKSRC}/tmux.h ${WRKSRC}/CHANGES
@@ -75,4 +83,8 @@ post-install:
 	@${INSTALL_DATA} ${WRKSRC}/examples/* ${EXAMPLESDIR}
 .endif
 
+.if defined(WITH_BASH_COMPLETE)
+	@${LN} ${EXAMPLESDIR}/bash_completion_tmux.sh ${PREFIX}/${BASH_COMPLETE_DIR}/${PORTNAME}
+.endif
+
 .include <bsd.port.post.mk>
--- tmux.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201231508.q0NF8p8B008764>