ports/163517: [patch]: textproc/p5-ack: install bash completion plugin
Adam Weinberger
adamw at FreeBSD.org
Wed Dec 21 22:10:10 UTC 2011
>Number: 163517
>Category: ports
>Synopsis: [patch]: textproc/p5-ack: install bash completion plugin
>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: Wed Dec 21 22:10:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Adam Weinberger
>Release:
>Organization:
>Environment:
>Description:
p5-ack comes with a plugin for bash shell completion (shells/bash_completion). This patch installs the plugin if the bash completion system is installed.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/textproc/p5-ack/Makefile,v
retrieving revision 1.31
diff -u -d -p -r1.31 Makefile
--- Makefile 19 Sep 2011 15:03:48 -0000 1.31
+++ Makefile 21 Dec 2011 22:00:41 -0000
@@ -7,6 +7,7 @@
PORTNAME= ack
PORTVERSION= 1.96
+PORTREVISION= 1
CATEGORIES= textproc perl5 sysutils
MASTER_SITES= CPAN
MASTER_SITE_SUBDIR= App
@@ -22,4 +23,17 @@ PERL_CONFIGURE= yes
MAN1= ack.1
-.include <bsd.port.mk>
+
+.include <bsd.port.pre.mk>
+
+COMPLETION_DIR= ${PREFIX}/etc/bash_completion.d
+.if exists(${COMPLETION_DIR})
+RUN_DEPENDS+= ${COMPLETION_DIR}:${PORTSDIR}/shells/bash-completion
+PLIST_SUB+= BASH=""
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/etc/ack.bash_completion.sh ${COMPLETION_DIR}
+.else
+PLIST_SUB+= BASH="@comment "
+.endif
+
+.include <bsd.port.post.mk>
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/textproc/p5-ack/pkg-plist,v
retrieving revision 1.2
diff -u -d -p -r1.2 pkg-plist
--- pkg-plist 23 Mar 2009 18:50:32 -0000 1.2
+++ pkg-plist 21 Dec 2011 22:00:41 -0000
@@ -1,4 +1,5 @@
bin/ack
+%%BASH%%etc/bash_completion.d/ack.bash_completion.sh
%%SITE_PERL%%/App/Ack.pm
%%SITE_PERL%%/App/Ack/Plugin/Basic.pm
%%SITE_PERL%%/App/Ack/Plugin.pm
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list