author | pkidd <patrick.kidd@oracle.com> |
Thu, 01 Dec 2016 09:15:00 -0800 | |
branch | s11u3-sru |
changeset 7423 | a17eef087a5e |
parent 6035 | c9748fcc32de |
permissions | -rw-r--r-- |
3378
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
1 |
# |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
2 |
# CDDL HEADER START |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
3 |
# |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
4 |
# The contents of this file are subject to the terms of the |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
5 |
# Common Development and Distribution License (the "License"). |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
6 |
# You may not use this file except in compliance with the License. |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
7 |
# |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
8 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
9 |
# or http://www.opensolaris.org/os/licensing. |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
10 |
# See the License for the specific language governing permissions |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
11 |
# and limitations under the License. |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
12 |
# |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
13 |
# When distributing Covered Code, include this CDDL HEADER in each |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
14 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
15 |
# If applicable, add the following below this CDDL HEADER, with the |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
16 |
# fields enclosed by brackets "[]" replaced with your own identifying |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
17 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
18 |
# |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
19 |
# CDDL HEADER END |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
20 |
# |
3996
20c0f21bbe1e
15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
3378
diff
changeset
|
21 |
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
3378
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
22 |
# |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
23 |
GEM=/usr/ruby/$(RUBY_VERSION)/bin/gem |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
24 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
25 |
VENDOR_GEM_DIR=/usr/ruby/$(RUBY_VERSION)/lib/ruby/vendor_ruby/gems/$(RUBY_LIB_VERSION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
26 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
27 |
# Name of the gem spec to use. This will typically be |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
28 |
# <component_name>.gemspec |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
29 |
GEMSPEC=$(COMPONENT_NAME).gemspec |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
30 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
31 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
32 |
# Some gems projects have to be built using rake |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
33 |
# Allow GEM build/install commands to be overwritten |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
34 |
# to account for possible differences |
6035
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
35 |
GEM_BUILD_ACTION=(cd $(@D); $(GEM) build $(GEM_BUILD_ARGS) $(GEMSPEC)) |
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
36 |
|
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
37 |
ifeq ($(firstword $(subst .,$(space),$(RUBY_VERSION))),2) |
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
38 |
# gem install 2.x does docs differently. Continue to generate both types |
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
39 |
GEM_INSTALL_ARGS=--document rdoc,ri |
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
40 |
endif |
3378
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
41 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
42 |
GEM_INSTALL_ACTION=\ |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
43 |
$(GEM) install -V --local --install-dir $(PROTO_DIR)/$(VENDOR_GEM_DIR) \ |
6035
c9748fcc32de
PSARC 2015/535 OpenStack service updates for Kilo
Devjani Ray <devjani.ray@oracle.com>
parents:
3996
diff
changeset
|
44 |
--bindir $(PROTO_DIR)/$(VENDOR_GEM_DIR)/bin --force $(GEM_INSTALL_ARGS) \ |
3378
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
45 |
$(@D)/$(COMPONENT_ARCHIVE) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
46 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
47 |
$(BUILD_DIR)/%/.built: $(SOURCE_DIR)/.prep |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
48 |
$(RM) -r $(@D) ; $(MKDIR) $(@D) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
49 |
$(CLONEY) $(SOURCE_DIR) $(@D) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
50 |
$(COMPONENT_PRE_BUILD_ACTION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
51 |
# Build the gem and cause the generation of a new gem spec |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
52 |
# file in $(COMPONENT_SRC) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
53 |
$(GEM_BUILD_ACTION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
54 |
$(COMPONENT_POST_BUILD_ACTION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
55 |
$(TOUCH) $@ |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
56 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
57 |
$(BUILD_DIR)/%/.installed: $(BUILD_DIR)/%/.built |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
58 |
$(COMPONENT_PRE_INSTALL_ACTION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
59 |
$(MKDIR) $(PROTO_DIR)/$(GEM_DIR) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
60 |
# Install the new recreated gem |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
61 |
$(GEM_INSTALL_ACTION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
62 |
$(COMPONENT_POST_INSTALL_ACTION) |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
63 |
$(TOUCH) $@ |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
64 |
|
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
65 |
clean:: |
8c7eb3630145
PSARC/2014/275 Hiera 1.3.4
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff
changeset
|
66 |
$(RM) -r $(SOURCE_DIR) $(BUILD_DIR) |
3996
20c0f21bbe1e
15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
3378
diff
changeset
|
67 |
|
20c0f21bbe1e
15786608 SUNBT7162754 create new meta package developer/opensolaris/userland
Norm Jacobs <Norm.Jacobs@Oracle.COM>
parents:
3378
diff
changeset
|
68 |
REQUIRED_PACKAGES += runtime/ruby |