Subject: pkg/17776: Solaris grep/sed issues
To: None <gnats-bugs@gnats.netbsd.org>
From: None <julien.letessier@sun.com>
List: netbsd-bugs
Date: 07/31/2002 01:35:29
>Number:         17776
>Category:       pkg
>Synopsis:       Solaris grep/sed issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 31 01:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Julien T. Letessier
>Release:        Zoularis/Solaris8
>Organization:
Sun Labs Europe
>Environment:
SunOS mikdemia 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-Enterprise
>Description:
Several tools bundled with Solaris (grep, sed) have a particular or limited set of options, whereas many makefiles/configure scripts/whatever rely on some options only found in the GNU equivalents.
>How-To-Repeat:

>Fix:
My personnal solution was to add a 'textproc/grep' package to my pkgsrc (10 minutes!), and patch defs.SunOS.mk in order to allow Makefiles to use the GNU tools when available:

Index: defs.SunOS.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/defs.SunOS.mk,v
retrieving revision 1.26
diff -r1.26 defs.SunOS.mk
17d16
< EGREP?=		/usr/xpg4/bin/egrep
21a21,25
> .if exists(${LOCALBASE}/bin/grep)
> GREP?=		${LOCALBASE}/bin/grep
> EGREP?=		${LOCALBASE}/bin/egrep
> FGREP?=		${LOCALBASE}/bin/fgrep
> .else
22a27,32
> EGREP?=		/usr/xpg4/bin/egrep
> FGREP?=		/usr/bin/fgrep
> .endif
> .if exists(${LOCALBASE}/bin/gtar)
> GTAR?=		${LOCALBASE}/bin/gtar
> .else
24,28d33
< .if exists(/usr/bin/gzip)
< GUNZIP_CMD?=	/usr/bin/gunzip -f
< GZCAT?=		/usr/bin/gzcat
< GZIP?=		-9
< GZIP_CMD?=	/usr/bin/gzip -nf ${GZIP}
35a41,46
> .if exists(/usr/bin/gzip)
> GUNZIP_CMD?=	/usr/bin/gunzip -f
> GZCAT?=		/usr/bin/gzcat
> GZIP?=		-9
> GZIP_CMD?=	/usr/bin/gzip -nf ${GZIP}
> .endif
54a66,68
> .if exists(${LOCALBASE}/bin/gsed)
> SED?=		${LOCALBASE}/bin/gsed
> .else
55a70
> .endif

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