prep-unpack.mk revision 5475
4194N/A#
4194N/A# CDDL HEADER START
4194N/A#
4194N/A# The contents of this file are subject to the terms of the
4194N/A# Common Development and Distribution License (the "License").
4194N/A# You may not use this file except in compliance with the License.
4194N/A#
4194N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4194N/A# or http://www.opensolaris.org/os/licensing.
4194N/A# See the License for the specific language governing permissions
4194N/A# and limitations under the License.
4194N/A#
4194N/A# When distributing Covered Code, include this CDDL HEADER in each
4194N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4194N/A# If applicable, add the following below this CDDL HEADER, with the
4194N/A# fields enclosed by brackets "[]" replaced with your own identifying
4194N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4194N/A#
4194N/A# CDDL HEADER END
4194N/A#
5475N/A# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
4194N/A#
4194N/A
4194N/AUNPACK = $(WS_TOOLS)/userland-unpack
4194N/A
4194N/A#
4194N/A# Anything that we downloaded and want to unpack must have a
4194N/A# COMPONENT_ARCHIVE{_[0-9]+} macro.
4194N/A#
4249N/APCK_SUFFIXES = $(subst COMPONENT_ARCHIVE_,, \
4194N/A $(filter COMPONENT_ARCHIVE_%, $(.VARIABLES)))
4194N/A
4194N/A# Template for unpacking rules.
4194N/Adefine unpack-rules
4194N/Aifdef COMPONENT_ARCHIVE$(1)
4194N/Aifdef COMPONENT_SRC$(1)
4194N/A
4194N/ACLEAN_PATHS += $$(COMPONENT_SRC$(1))
4194N/ASOURCE_DIR$(1) = $$(COMPONENT_DIR)/$(COMPONENT_SRC$(1))
4194N/A
4194N/AUNPACK_STAMP$(1) = $$(SOURCE_DIR$(1))/.unpacked
4194N/A
5475N/A# RUBY_VERSION is passed on to ensure userland-unpack uses the
5475N/A# correct gem command for the ruby version specified
4194N/A$$(UNPACK_STAMP$(1)): $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1)) download
4194N/A $$(RM) -r $$(SOURCE_DIR$(1))
5475N/A $(ENV) RUBY_VERSION=$(RUBY_VERSION) \
4194N/A $$(UNPACK) $$(UNPACK_ARGS$(1)) $$(USERLAND_ARCHIVES)$$(COMPONENT_ARCHIVE$(1))
4194N/A $$(COMPONENT_POST_UNPACK_ACTION$(1))
4194N/A $$(TOUCH) $$@
4194N/A
4194N/Aunpack:: $$(UNPACK_STAMP$(1))
4194N/A
4194N/AREQUIRED_PACKAGES += archiver/gnu-tar
4194N/AREQUIRED_PACKAGES += compress/bzip2
4194N/AREQUIRED_PACKAGES += compress/gzip
4194N/AREQUIRED_PACKAGES += compress/p7zip
4194N/AREQUIRED_PACKAGES += compress/unzip
4194N/AREQUIRED_PACKAGES += compress/xz
4951N/AREQUIRED_PACKAGES += compress/zip
4194N/AREQUIRED_PACKAGES += developer/java/jdk
4194N/AREQUIRED_PACKAGES += runtime/ruby
4194N/A
4194N/Aendif
4194N/Aendif
4194N/Aendef
4194N/A
4194N/A#
4194N/A# Define the rules required to download any source archives and augment any
4194N/A# cleanup macros.
4194N/A#
4194N/A$(eval $(call unpack-rules,))
4249N/A$(foreach suffix, $(PCK_SUFFIXES), $(eval $(call unpack-rules,_$(suffix))))