80N/A#
80N/A# CDDL HEADER START
80N/A#
80N/A# The contents of this file are subject to the terms of the
80N/A# Common Development and Distribution License (the "License").
80N/A# You may not use this file except in compliance with the License.
80N/A#
80N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
80N/A# or http://www.opensolaris.org/os/licensing.
80N/A# See the License for the specific language governing permissions
80N/A# and limitations under the License.
80N/A#
80N/A# When distributing Covered Code, include this CDDL HEADER in each
80N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
80N/A# If applicable, add the following below this CDDL HEADER, with the
80N/A# fields enclosed by brackets "[]" replaced with your own identifying
80N/A# information: Portions Copyright [yyyy] [name of copyright owner]
80N/A#
80N/A# CDDL HEADER END
80N/A#
5680N/A
5680N/A#
5389N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
80N/A#
5680N/ABUILD_BITS= 64
5907N/ACOMPILER= gcc
80N/Ainclude ../../make-rules/shared-macros.mk
80N/A
80N/ACOMPONENT_NAME= grep
5907N/ACOMPONENT_VERSION= 2.25
1462N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
844N/ACOMPONENT_ARCHIVE_HASH= \
5907N/A sha256:e21e83bac50450e0d0d61a42c154ee0dceaacdbf4f604ef6e79071cb8e596830
1258N/ACOMPONENT_BUGDB= utility/ggrep
1258N/A
5907N/ATPNO= 28105
2899N/A
5680N/ASYSTEM_TEST_TARGET= $(SOURCE_DIR)/.system-test-patched configure $(SYSTEM_TEST_64)
5680N/Ainclude $(WS_MAKE_RULES)/gnu-component.mk
80N/A
5680N/ACONFIGURE_PREFIX = $(USRGNUDIR)
5680N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
5680N/ACONFIGURE_OPTIONS += --localedir=$(USRSHARELOCALEDIR)
80N/A
1462N/A# Needed for "gmake test" to work.
1462N/A# SHELLOPTS is exported via make-rules/shared-macros.mk,
1462N/A# causing the braceexpand option to be set.
1462N/A# This option causes "$1: unbound variable" errors during the check-TESTS,
1462N/A# and the gnulib-tests don't even run at all.
1462N/A# Note that the below unexports SHELLOPTS, even for targets
1462N/A# other than "test."
1462N/Aunexport SHELLOPTS
80N/A
4793N/A# Test transforms retain only relevant results output.
4793N/ACOMPONENT_TEST_TRANSFORMS += \
4793N/A '-n ' \
4793N/A '-e "/TOTAL/p" ' \
4793N/A '-e "/SKIP/p" ' \
4793N/A '-e "/PASS/p" ' \
4793N/A '-e "/FAIL/p" ' \
4793N/A '-e "/ERROR/p" '
4793N/A
4793N/A# Putting GNU on path first prevents some tests from being skipped,
4793N/A# which also keeps the test and system-test results consistent.
4793N/A# With the test target, the path to the just-built commands is
4793N/A# prepended to PATH. With the system-test target, we patch
4793N/A# to prevent the PATH from being prepended.
4793N/ACOMPONENT_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
4793N/ACOMPONENT_SYSTEM_TEST_ENV += "PATH=$(GNUBIN):$(PATH)"
4793N/A
4793N/A# Patch to change test path so it tests grep commands from /usr/gnu/bin
4793N/A# installed on the test system. If we patch, we must re-configure the
4793N/A# tests.
4793N/A$(SOURCE_DIR)/.system-test-patched: $(SOURCE_DIR)/.prep
4793N/A $(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $(COMPONENT_DIR)/system-test-patches/systest.patch
4793N/A $(TOUCH) $(@)
4793N/A
4793N/A# if we previously patched the source for the system-test target,
4793N/A# ensure we rebuild without that patch
5680N/ACOMPONENT_PRE_TEST_ACTION += \
4793N/A if [ -e $(SOURCE_DIR)/.system-test-patched ]; then \
4793N/A cd $(COMPONENT_DIR); \
4793N/A $(GMAKE) clean build; \
4793N/A fi
4400N/A
5907N/AREQUIRED_PACKAGES += developer/gcc
3817N/AREQUIRED_PACKAGES += library/pcre
3817N/AREQUIRED_PACKAGES += shell/bash