Thu Jan 12 08:43:22 2012 UTC ()
Move PRINT_PLIST_AWK stuff for Gems before other ruby related PRINT_PLIST_AWK
will be added, or not works as expected.


(obache)
diff -r1.10 -r1.11 pkgsrc/lang/ruby/gem.mk

cvs diff -r1.10 -r1.11 pkgsrc/lang/ruby/gem.mk (expand / switch to unified diff)

--- pkgsrc/lang/ruby/gem.mk 2011/12/13 15:47:06 1.10
+++ pkgsrc/lang/ruby/gem.mk 2012/01/12 08:43:22 1.11
@@ -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)
106UPDATE_GEMSPEC= ../../lang/ruby/files/update-gemspec.rb 106UPDATE_GEMSPEC= ../../lang/ruby/files/update-gemspec.rb
107.endif 107.endif
108 108
109.if ${GEM_BUILD} == "rake" 109.if ${GEM_BUILD} == "rake"
110USE_RAKE= YES 110USE_RAKE= YES
111.endif 111.endif
112 112
113.if defined(RUBY_RAILS_SUPPORTED) 113.if defined(RUBY_RAILS_SUPPORTED)
114USE_TOOLS+= expr 114USE_TOOLS+= expr
115.endif 115.endif
116 116
 117# print-PLIST support
 118PRINT_PLIST_AWK+= /${GEM_NAME}\.(gem|gemspec)$$/ \
 119 { gsub(/${GEM_NAME}\.gem/, "$${GEM_NAME}.gem"); }
 120PRINT_PLIST_AWK+= /${GEM_NAME:S/./[.]/g}[.](gem|gemspec)$$/ \
 121 { gsub(/${PKGVERSION_NOREV:S|/|\\/|g}[.]gem/, "$${PKGVERSION}.gem"); }
 122PRINT_PLIST_AWK+= /^${GEM_LIBDIR:S|/|\\/|g}/ \
 123 { gsub(/${GEM_LIBDIR:S|/|\\/|g}/, "$${GEM_LIBDIR}"); print; next; }
 124PRINT_PLIST_AWK+= /^${GEM_DOCDIR:S|/|\\/|g}/ \
 125 { next; }
 126PRINT_PLIST_AWK+= /^${GEM_HOME:S|/|\\/|g}/ \
 127 { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); \
 128 print; next; }
 129PRINT_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#
198CHECK_INTERPRETER_SKIP+= ${GEM_LIBDIR}/* 214CHECK_INTERPRETER_SKIP+= ${GEM_LIBDIR}/*
199CHECK_PERMS_SKIP+= ${GEM_LIBDIR}/* 215CHECK_PERMS_SKIP+= ${GEM_LIBDIR}/*
200 216
201# RUBYGEM holds the path to RubyGems' gem command 217# RUBYGEM holds the path to RubyGems' gem command
202EVAL_PREFIX+= RUBYGEM_PREFIX=${RUBYGEM_NAME} 218EVAL_PREFIX+= RUBYGEM_PREFIX=${RUBYGEM_NAME}
203RUBYGEM= ${RUBYGEM_PREFIX}/bin/${RUBYGEM_NAME} 219RUBYGEM= ${RUBYGEM_PREFIX}/bin/${RUBYGEM_NAME}
204 220
205# PLIST support 221# PLIST support
206PLIST_SUBST+= GEM_NAME=${GEM_NAME} 222PLIST_SUBST+= GEM_NAME=${GEM_NAME}
207PLIST_SUBST+= GEM_LIBDIR=${GEM_LIBDIR} 223PLIST_SUBST+= GEM_LIBDIR=${GEM_LIBDIR}
208PLIST_SUBST+= GEM_DOCDIR=${GEM_DOCDIR} 224PLIST_SUBST+= GEM_DOCDIR=${GEM_DOCDIR}
209 225
210# print-PLIST support 
211PRINT_PLIST_AWK+= /${GEM_NAME}\.(gem|gemspec)$$/ \ 
212 { gsub(/${GEM_NAME}\.gem/, "$${GEM_NAME}.gem"); } 
213PRINT_PLIST_AWK+= /${GEM_NAME:S/./[.]/g}[.](gem|gemspec)$$/ \ 
214 { gsub(/${PKGVERSION_NOREV:S|/|\\/|g}[.]gem/, "$${PKGVERSION}.gem"); } 
215PRINT_PLIST_AWK+= /^${GEM_LIBDIR:S|/|\\/|g}/ \ 
216 { gsub(/${GEM_LIBDIR:S|/|\\/|g}/, "$${GEM_LIBDIR}"); print; next; } 
217PRINT_PLIST_AWK+= /^${GEM_DOCDIR:S|/|\\/|g}/ \ 
218 { next; } 
219PRINT_PLIST_AWK+= /^${GEM_HOME:S|/|\\/|g}/ \ 
220 { gsub(/${GEM_HOME:S|/|\\/|g}/, "$${GEM_HOME}"); \ 
221 print; next; } 
222PRINT_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###
233GEM_SPECFILE?= ${WRKDIR}/${DISTNAME}.gemspec 233GEM_SPECFILE?= ${WRKDIR}/${DISTNAME}.gemspec
234 234
235.PHONY: gem-extract 235.PHONY: gem-extract
236post-extract: gem-extract 236post-extract: gem-extract
237.if !target(gem-extract) 237.if !target(gem-extract)
238gem-extract: fake-home 238gem-extract: fake-home