| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: gem.mk,v 1.10 2011/12/13 15:47:06 taca Exp $ | | 1 | # $NetBSD: gem.mk,v 1.11 2012/01/12 08:43:22 obache Exp $ |
2 | # | | 2 | # |
3 | # This Makefile fragment is intended to be included by packages that build | | 3 | # This Makefile fragment is intended to be included by packages that build |
4 | # and install Ruby gems. | | 4 | # and install Ruby gems. |
5 | # | | 5 | # |
6 | # Package-settable variables: | | 6 | # Package-settable variables: |
7 | # | | 7 | # |
8 | # RUBYGEMS_REQD | | 8 | # RUBYGEMS_REQD |
9 | # Minimum version of required rubygems. Ruby base packages contain: | | 9 | # Minimum version of required rubygems. Ruby base packages contain: |
10 | # | | 10 | # |
11 | # ruby18-base: none | | 11 | # ruby18-base: none |
12 | # ruby19-base: 1.3.7 | | 12 | # ruby19-base: 1.3.7 |
13 | # ruby193-base: 1.8.11 | | 13 | # ruby193-base: 1.8.11 |
14 | # | | 14 | # |
| @@ -104,26 +104,42 @@ RUBYGEM_ENV?= LANG=${RUBYGEM_LANG} LC_CT | | | @@ -104,26 +104,42 @@ RUBYGEM_ENV?= LANG=${RUBYGEM_LANG} LC_CT |
104 | | | 104 | |
105 | .if !empty(OVERRIDE_GEMSPEC) | | 105 | .if !empty(OVERRIDE_GEMSPEC) |
106 | UPDATE_GEMSPEC= ../../lang/ruby/files/update-gemspec.rb | | 106 | UPDATE_GEMSPEC= ../../lang/ruby/files/update-gemspec.rb |
107 | .endif | | 107 | .endif |
108 | | | 108 | |
109 | .if ${GEM_BUILD} == "rake" | | 109 | .if ${GEM_BUILD} == "rake" |
110 | USE_RAKE= YES | | 110 | USE_RAKE= YES |
111 | .endif | | 111 | .endif |
112 | | | 112 | |
113 | .if defined(RUBY_RAILS_SUPPORTED) | | 113 | .if defined(RUBY_RAILS_SUPPORTED) |
114 | USE_TOOLS+= expr | | 114 | USE_TOOLS+= expr |
115 | .endif | | 115 | .endif |
116 | | | 116 | |
| | | 117 | # print-PLIST support |
| | | 118 | PRINT_PLIST_AWK+= /${GEM_NAME}\.(gem|gemspec)$$/ \ |
| | | 119 | { gsub(/${GEM_NAME}\.gem/, "$${GEM_NAME}.gem"); } |
| | | 120 | PRINT_PLIST_AWK+= /${GEM_NAME:S/./[.]/g}[.](gem|gemspec)$$/ \ |
| | | 121 | { gsub(/${PKGVERSION_NOREV:S|/|\\/|g}[.]gem/, "$${PKGVERSION}.gem"); } |
| | | 122 | PRINT_PLIST_AWK+= /^${GEM_LIBDIR:S|/|\\/|g}/ \ |
| | | 123 | { gsub(/${GEM_LIBDIR:S|/|\\/|g}/, "$${GEM_LIBDIR}"); print; next; } |
| | | 124 | PRINT_PLIST_AWK+= /^${GEM_DOCDIR:S|/|\\/|g}/ \ |
| | | 125 | { next; } |
| | | 126 | PRINT_PLIST_AWK+= /^${GEM_HOME:S|/|\\/|g}/ \ |
| | | 127 | { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); \ |
| | | 128 | print; next; } |
| | | 129 | PRINT_PLIST_AWK+= /^${RUBY_GEM_BASE:S|/|\\/|g}/ \ |
| | | 130 | { gsub(/${RUBY_GEM_BASE:S|/|\\/|g}/, "$${RUBY_GEM_BASE}"); \ |
| | | 131 | print; next; } |
| | | 132 | |
117 | # Include this early in case some of its target are needed | | 133 | # Include this early in case some of its target are needed |
118 | .include "../../lang/ruby/modules.mk" | | 134 | .include "../../lang/ruby/modules.mk" |
119 | | | 135 | |
120 | .if defined(RUBY_RAILS_SUPPORTED) | | 136 | .if defined(RUBY_RAILS_SUPPORTED) |
121 | .include "../../lang/ruby/rails.mk" | | 137 | .include "../../lang/ruby/rails.mk" |
122 | .endif | | 138 | .endif |
123 | | | 139 | |
124 | # Build and run-time dependencies for Ruby prior to 1.9. | | 140 | # Build and run-time dependencies for Ruby prior to 1.9. |
125 | # | | 141 | # |
126 | # We need rubygems>=1.1.0 to actually build the package, but the | | 142 | # We need rubygems>=1.1.0 to actually build the package, but the |
127 | # resulting installed gem can run with older versions of rubygems. | | 143 | # resulting installed gem can run with older versions of rubygems. |
128 | # | | 144 | # |
129 | # If we're using rake to build the local gem, then include it as a | | 145 | # If we're using rake to build the local gem, then include it as a |
| @@ -197,42 +213,26 @@ GEM_CACHEDIR= ${GEM_HOME}/cache | | | @@ -197,42 +213,26 @@ GEM_CACHEDIR= ${GEM_HOME}/cache |
197 | # | | 213 | # |
198 | CHECK_INTERPRETER_SKIP+= ${GEM_LIBDIR}/* | | 214 | CHECK_INTERPRETER_SKIP+= ${GEM_LIBDIR}/* |
199 | CHECK_PERMS_SKIP+= ${GEM_LIBDIR}/* | | 215 | CHECK_PERMS_SKIP+= ${GEM_LIBDIR}/* |
200 | | | 216 | |
201 | # RUBYGEM holds the path to RubyGems' gem command | | 217 | # RUBYGEM holds the path to RubyGems' gem command |
202 | EVAL_PREFIX+= RUBYGEM_PREFIX=${RUBYGEM_NAME} | | 218 | EVAL_PREFIX+= RUBYGEM_PREFIX=${RUBYGEM_NAME} |
203 | RUBYGEM= ${RUBYGEM_PREFIX}/bin/${RUBYGEM_NAME} | | 219 | RUBYGEM= ${RUBYGEM_PREFIX}/bin/${RUBYGEM_NAME} |
204 | | | 220 | |
205 | # PLIST support | | 221 | # PLIST support |
206 | PLIST_SUBST+= GEM_NAME=${GEM_NAME} | | 222 | PLIST_SUBST+= GEM_NAME=${GEM_NAME} |
207 | PLIST_SUBST+= GEM_LIBDIR=${GEM_LIBDIR} | | 223 | PLIST_SUBST+= GEM_LIBDIR=${GEM_LIBDIR} |
208 | PLIST_SUBST+= GEM_DOCDIR=${GEM_DOCDIR} | | 224 | PLIST_SUBST+= GEM_DOCDIR=${GEM_DOCDIR} |
209 | | | 225 | |
210 | # print-PLIST support | | | |
211 | PRINT_PLIST_AWK+= /${GEM_NAME}\.(gem|gemspec)$$/ \ | | | |
212 | { gsub(/${GEM_NAME}\.gem/, "$${GEM_NAME}.gem"); } | | | |
213 | PRINT_PLIST_AWK+= /${GEM_NAME:S/./[.]/g}[.](gem|gemspec)$$/ \ | | | |
214 | { gsub(/${PKGVERSION_NOREV:S|/|\\/|g}[.]gem/, "$${PKGVERSION}.gem"); } | | | |
215 | PRINT_PLIST_AWK+= /^${GEM_LIBDIR:S|/|\\/|g}/ \ | | | |
216 | { gsub(/${GEM_LIBDIR:S|/|\\/|g}/, "$${GEM_LIBDIR}"); print; next; } | | | |
217 | PRINT_PLIST_AWK+= /^${GEM_DOCDIR:S|/|\\/|g}/ \ | | | |
218 | { next; } | | | |
219 | PRINT_PLIST_AWK+= /^${GEM_HOME:S|/|\\/|g}/ \ | | | |
220 | { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); \ | | | |
221 | print; next; } | | | |
222 | PRINT_PLIST_AWK+= /^${RUBY_GEM_BASE:S|/|\\/|g}/ \ | | | |
223 | { gsub(/${RUBY_GEM_BASE:S|/|\\/|g}/, "$${RUBY_GEM_BASE}"); \ | | | |
224 | print; next; } | | | |
225 | | | | |
226 | ### | | 226 | ### |
227 | ### gem-extract | | 227 | ### gem-extract |
228 | ### | | 228 | ### |
229 | ### The gem-extract target extracts a standard gem file. It is an | | 229 | ### The gem-extract target extracts a standard gem file. It is an |
230 | ### automatic dependency for the post-extract target so it doesn't | | 230 | ### automatic dependency for the post-extract target so it doesn't |
231 | ### disturb the usual do-extract actions. | | 231 | ### disturb the usual do-extract actions. |
232 | ### | | 232 | ### |
233 | GEM_SPECFILE?= ${WRKDIR}/${DISTNAME}.gemspec | | 233 | GEM_SPECFILE?= ${WRKDIR}/${DISTNAME}.gemspec |
234 | | | 234 | |
235 | .PHONY: gem-extract | | 235 | .PHONY: gem-extract |
236 | post-extract: gem-extract | | 236 | post-extract: gem-extract |
237 | .if !target(gem-extract) | | 237 | .if !target(gem-extract) |
238 | gem-extract: fake-home | | 238 | gem-extract: fake-home |