4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
21 # Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
23 GEM
=/usr
/ruby
/$(RUBY_VERSION
)/bin
/gem
25 VENDOR_GEM_DIR
=/usr
/ruby
/$(RUBY_VERSION
)/lib
/ruby
/vendor_ruby
/gems
/$(RUBY_LIB_VERSION
)
27 # Name of the gem spec to use. This will typically be
28 # <component_name>.gemspec
29 GEMSPEC
=$(COMPONENT_NAME
).gemspec
32 # Some gems projects have to be built using rake
33 # Allow GEM build/install commands to be overwritten
34 # to account for possible differences
35 GEM_BUILD_ACTION
=(cd
$(@D
); $(GEM
) build
$(GEMSPEC
))
38 $(GEM
) install -V
--local
--install-dir
$(PROTO_DIR
)/$(VENDOR_GEM_DIR
) \
39 --bindir $(PROTO_DIR
)/$(VENDOR_GEM_DIR
)/bin
--force \
40 $(@D
)/$(COMPONENT_ARCHIVE
)
42 $(BUILD_DIR
)/%/.built
: $(SOURCE_DIR
)/.prep
43 $(RM
) -r
$(@D
) ; $(MKDIR
) $(@D
)
44 $(CLONEY
) $(SOURCE_DIR
) $(@D
)
45 $(COMPONENT_PRE_BUILD_ACTION
)
46 # Build the gem and cause the generation of a new gem spec
47 # file in $(COMPONENT_SRC)
49 $(COMPONENT_POST_BUILD_ACTION
)
52 $(BUILD_DIR
)/%/.installed
: $(BUILD_DIR
)/%/.built
53 $(COMPONENT_PRE_INSTALL_ACTION
)
54 $(MKDIR
) $(PROTO_DIR
)/$(GEM_DIR
)
55 # Install the new recreated gem
57 $(COMPONENT_POST_INSTALL_ACTION
)
61 $(RM
) -r
$(SOURCE_DIR
) $(BUILD_DIR
)