Makefile revision 1273
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powers# CDDL HEADER START
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powers# The contents of this file are subject to the terms of the
45d2468cd430f160914c353c714144054804373aMark Powers# Common Development and Distribution License (the "License").
45d2468cd430f160914c353c714144054804373aMark Powers# You may not use this file except in compliance with the License.
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powers# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
45d2468cd430f160914c353c714144054804373aMark Powers# or http://www.opensolaris.org/os/licensing.
45d2468cd430f160914c353c714144054804373aMark Powers# See the License for the specific language governing permissions
45d2468cd430f160914c353c714144054804373aMark Powers# and limitations under the License.
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powers# When distributing Covered Code, include this CDDL HEADER in each
45d2468cd430f160914c353c714144054804373aMark Powers# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
45d2468cd430f160914c353c714144054804373aMark Powers# If applicable, add the following below this CDDL HEADER, with the
45d2468cd430f160914c353c714144054804373aMark Powers# fields enclosed by brackets "[]" replaced with your own identifying
45d2468cd430f160914c353c714144054804373aMark Powers# information: Portions Copyright [yyyy] [name of copyright owner]
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powers# CDDL HEADER END
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powers# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
45d2468cd430f160914c353c714144054804373aMark Powers#
45d2468cd430f160914c353c714144054804373aMark Powersinclude ../../make-rules/shared-macros.mk
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_NAME= gzip
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_VERSION= 1.5
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_PROJECT_URL= http://www.gnu.org/software/gzip/
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_ARCHIVE_HASH= \
45d2468cd430f160914c353c714144054804373aMark Powers sha256:b5d56e8ffc9918e8c941fab56e04121194f9870adeeb859e09c09eac264035a3
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_ARCHIVE_URL= ftp://ftp.gnu.org/gnu/gzip/$(COMPONENT_ARCHIVE)
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_BUGDB= utility/gzip
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powersinclude ../../make-rules/prep.mk
45d2468cd430f160914c353c714144054804373aMark Powersinclude ../../make-rules/configure.mk
45d2468cd430f160914c353c714144054804373aMark Powersinclude ../../make-rules/ips.mk
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers# To get correct @bindir@ substitution in the various gz<whatever> scripts.
45d2468cd430f160914c353c714144054804373aMark PowersCONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark PowersCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
45d2468cd430f160914c353c714144054804373aMark PowersCONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers# Needed for "gmake test" to work successfully.
45d2468cd430f160914c353c714144054804373aMark Powers# If SHELLOPTS is exported (as it is by the userland makefiles),
45d2468cd430f160914c353c714144054804373aMark Powers# then all shell options get exported to child invocations of bash,
45d2468cd430f160914c353c714144054804373aMark Powers# which results in test failures due to nounset and xtrace being
45d2468cd430f160914c353c714144054804373aMark Powers# set unexpectedly, and errors such as "$1: unbound variable" and
45d2468cd430f160914c353c714144054804373aMark Powers# diffs failing due to script tracing in output files.
45d2468cd430f160914c353c714144054804373aMark Powersunexport SHELLOPTS
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers# Get the binaries to test from the component build area.
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_TEST_ENV += PATH=$(BUILD_DIR_$(BITS)):/usr/xpg4/bin:/usr/bin
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_TEST_TARGETS = check
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers# Fix references to Solaris renamed programs (z*->gz*) in man pages, info
45d2468cd430f160914c353c714144054804373aMark Powers# pages and in wrapper scripts.
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_PRE_INSTALL_ACTION = \
45d2468cd430f160914c353c714144054804373aMark Powers (cd $(COMPONENT_SRC) ; \
45d2468cd430f160914c353c714144054804373aMark Powers for file in `ls *.1 doc/*.info z*.in` ; do \
45d2468cd430f160914c353c714144054804373aMark Powers mv $$file $$file.tmp ; \
45d2468cd430f160914c353c714144054804373aMark Powers $(GSED) -f $(COMPONENT_DIR)/renaming.sed $$file.tmp > $$file ; \
45d2468cd430f160914c353c714144054804373aMark Powers $(RM) $$file.tmp ; \
45d2468cd430f160914c353c714144054804373aMark Powers done)
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers# Rename installed programs and man pages in proto dir (z*->gz*).
45d2468cd430f160914c353c714144054804373aMark PowersCOMPONENT_POST_INSTALL_ACTION = \
45d2468cd430f160914c353c714144054804373aMark Powers (for dir in $(PROTOUSRBINDIR) $(PROTOUSRSHAREMAN1DIR) ; do \
45d2468cd430f160914c353c714144054804373aMark Powers cd $$dir; \
45d2468cd430f160914c353c714144054804373aMark Powers for zfile in `ls z*`; do \
45d2468cd430f160914c353c714144054804373aMark Powers mv $$zfile g$$zfile ; \
45d2468cd430f160914c353c714144054804373aMark Powers done ; \
45d2468cd430f160914c353c714144054804373aMark Powers done)
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers# Provide missing man pages.
45d2468cd430f160914c353c714144054804373aMark PowersGZGREP_MAN_VARIANTS+=$(PROTOUSRSHAREMAN1DIR)/gzegrep.1
45d2468cd430f160914c353c714144054804373aMark PowersGZGREP_MAN_VARIANTS+=$(PROTOUSRSHAREMAN1DIR)/gzfgrep.1
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powers$(GZGREP_MAN_VARIANTS):
45d2468cd430f160914c353c714144054804373aMark Powers $(RM) $@; echo ".so man1/gzgrep.1" > $@
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powersbuild: $(BUILD_64)
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powersinstall: $(INSTALL_64) $(GZGREP_MAN_VARIANTS)
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powerstest: $(TEST_64)
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark PowersBUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
45d2468cd430f160914c353c714144054804373aMark Powers
45d2468cd430f160914c353c714144054804373aMark Powersinclude ../../make-rules/depend.mk
45d2468cd430f160914c353c714144054804373aMark Powers