| @@ -1,25 +1,31 @@ | | | @@ -1,25 +1,31 @@ |
1 | # $NetBSD: gem.mk,v 1.50 2022/12/18 14:52:08 taca Exp $ | | 1 | # $NetBSD: gem.mk,v 1.51 2022/12/20 02:53:10 taca 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 | # === User-settable variables === | | 6 | # === User-settable variables === |
7 | # | | 7 | # |
8 | # RUBYGEM_VERBOSE | | 8 | # RUBYGEM_VERBOSE |
9 | # Execute gem with verbose option. | | 9 | # Execute gem with verbose option. |
10 | # Possible values: Yes No | | 10 | # Possible values: Yes No |
11 | # Default: No | | 11 | # Default: No |
12 | # | | 12 | # |
| | | 13 | # RUBYGEM_USE_MANPAGES |
| | | 14 | # Enable man pages support to ruby gem. |
| | | 15 | # |
| | | 16 | # Possible values: Yes No |
| | | 17 | # Default: Yes |
| | | 18 | # |
13 | # === Package-settable variables === | | 19 | # === Package-settable variables === |
14 | # | | 20 | # |
15 | # OVERRIDE_GEMSPEC | | 21 | # OVERRIDE_GEMSPEC |
16 | # Fix version of depending gem or modify files in gemspec. | | 22 | # Fix version of depending gem or modify files in gemspec. |
17 | # | | 23 | # |
18 | # (1) Specify as gem and dependency pattern as usual pkgsrc format. | | 24 | # (1) Specify as gem and dependency pattern as usual pkgsrc format. |
19 | # | | 25 | # |
20 | # Example: | | 26 | # Example: |
21 | # When gemspec contains "json~>1.4.7" as a runtime dependency | | 27 | # When gemspec contains "json~>1.4.7" as a runtime dependency |
22 | # (i.e. json>=1.4.7<1.5) and if you want to relax it to | | 28 | # (i.e. json>=1.4.7<1.5) and if you want to relax it to |
23 | # "json>=1.4.6" then use: | | 29 | # "json>=1.4.6" then use: |
24 | # | | 30 | # |
25 | # OVERRIDE_GEMSPEC+= json>=1.4.6 | | 31 | # OVERRIDE_GEMSPEC+= json>=1.4.6 |
| @@ -100,27 +106,27 @@ | | | @@ -100,27 +106,27 @@ |
100 | # GEM_NAME | | 106 | # GEM_NAME |
101 | # The name of the gem to install. The default value is ${DISTNAME}. | | 107 | # The name of the gem to install. The default value is ${DISTNAME}. |
102 | # gem installed in the installation root. | | 108 | # gem installed in the installation root. |
103 | # | | 109 | # |
104 | # GEM_SPECFILE | | 110 | # GEM_SPECFILE |
105 | # The path to the gemspec file to use when building a gem using | | 111 | # The path to the gemspec file to use when building a gem using |
106 | # the ``gemspec'' GEM_BUILD method. It defaults to | | 112 | # the ``gemspec'' GEM_BUILD method. It defaults to |
107 | # ${WRKDIR}/${DISTNAME}.gemspec. | | 113 | # ${WRKDIR}/${DISTNAME}.gemspec. |
108 | # | | 114 | # |
109 | # RUBYGEM_OPTIONS | | 115 | # RUBYGEM_OPTIONS |
110 | # Optional parameter to pass to gem on install stage. | | 116 | # Optional parameter to pass to gem on install stage. |
111 | # | | 117 | # |
112 | # RUBYGEM_MANPAGES | | 118 | # RUBYGEM_MANPAGES |
113 | # Add man pages support to ruby gem. This is user-settable. | | 119 | # Add man pages support to ruby gem. |
114 | # | | 120 | # |
115 | # Possible values: Yes No | | 121 | # Possible values: Yes No |
116 | # Default: No | | 122 | # Default: No |
117 | # | | 123 | # |
118 | # === Variables defined in this file === | | 124 | # === Variables defined in this file === |
119 | # | | 125 | # |
120 | # GEM_DOCDIR | | 126 | # GEM_DOCDIR |
121 | # The relative path from PREFIX to the directory in the local gem | | 127 | # The relative path from PREFIX to the directory in the local gem |
122 | # repository that holds the documentation for the installed gem. | | 128 | # repository that holds the documentation for the installed gem. |
123 | # | | 129 | # |
124 | # GEM_LIBDIR | | 130 | # GEM_LIBDIR |
125 | # The relative path from PREFIX to the directory in the local gem | | 131 | # The relative path from PREFIX to the directory in the local gem |
126 | # repository that holds the contents of the installed gem. | | 132 | # repository that holds the contents of the installed gem. |
| @@ -154,37 +160,42 @@ OVERRIDE_GEMSPEC?= # default is empty | | | @@ -154,37 +160,42 @@ OVERRIDE_GEMSPEC?= # default is empty |
154 | | | 160 | |
155 | # | | 161 | # |
156 | .include "../../lang/ruby/gem-vars.mk" | | 162 | .include "../../lang/ruby/gem-vars.mk" |
157 | | | 163 | |
158 | CATEGORIES+= ruby | | 164 | CATEGORIES+= ruby |
159 | MASTER_SITES?= ${MASTER_SITE_RUBYGEMS} | | 165 | MASTER_SITES?= ${MASTER_SITE_RUBYGEMS} |
160 | | | 166 | |
161 | EXTRACT_SUFX?= .gem | | 167 | EXTRACT_SUFX?= .gem |
162 | DISTFILES?= ${DISTNAME}${EXTRACT_SUFX} | | 168 | DISTFILES?= ${DISTNAME}${EXTRACT_SUFX} |
163 | | | 169 | |
164 | # | | 170 | # |
165 | # Handling of ruby-manpages plugin. | | 171 | # Handling of ruby-manpages plugin. |
166 | # | | 172 | # |
| | | 173 | RUBYGEM_USE_MANPAGES?= yes |
167 | RUBYGEM_MANPAGES?= no | | 174 | RUBYGEM_MANPAGES?= no |
168 | PLIST_VARS+= rubygem_man | | 175 | PLIST_VARS+= rubygem_man |
169 | | | 176 | |
170 | .if ${RUBYGEM_MANPAGES:tl} == "no" | | 177 | .if ${RUBYGEM_USE_MANPAGES:tl} == "yes" |
171 | RUBY_MANPAGES_INSTALLED!= ${PKG_INFO} -e ${RUBY_PKGPREFIX}-manpages || ${TRUE} | | 178 | . if ${RUBYGEM_MANPAGES:tl} == "yes" |
172 | . if ${RUBY_MANPAGES_INSTALLED} | | | |
173 | PKG_SKIP_REASON+= "Please uninstall ${RUBY_PKGPREFIX}-manpages or set RUBYGEM_MANPAGES to yes." | | | |
174 | . endif | | | |
175 | .else | | | |
176 | BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-manpages>=0.6.1:../../misc/ruby-manpages | | 179 | BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-manpages>=0.6.1:../../misc/ruby-manpages |
177 | PLIST.rubygem_man= yes | | 180 | PLIST.rubygem_man= yes |
| | | 181 | . endif |
| | | 182 | .else |
| | | 183 | . if ${RUBYGEM_MANPAGES:tl} == "yes" |
| | | 184 | RUBY_MANPAGES_INSTALLED!= ${PKG_INFO} -e ${RUBY_PKGPREFIX}-manpages || ${TRUE} |
| | | 185 | . if ${RUBY_MANPAGES_INSTALLED} |
| | | 186 | PKG_SKIP_REASON+= "Please uninstall ${RUBY_PKGPREFIX}-manpages or set RUBYGEM_USE_MANPAGES to yes." |
| | | 187 | . endif |
| | | 188 | . endif |
178 | .endif | | 189 | .endif |
179 | | | 190 | |
180 | # If any of the DISTFILES are gems, then skip the normal do-extract actions | | 191 | # If any of the DISTFILES are gems, then skip the normal do-extract actions |
181 | # and extract them ourselves in gem-extract. | | 192 | # and extract them ourselves in gem-extract. |
182 | # | | 193 | # |
183 | .if !empty(DISTFILES:M*.gem) | | 194 | .if !empty(DISTFILES:M*.gem) |
184 | EXTRACT_ONLY?= # empty | | 195 | EXTRACT_ONLY?= # empty |
185 | .endif | | 196 | .endif |
186 | | | 197 | |
187 | # Directory for the Gem to install | | 198 | # Directory for the Gem to install |
188 | GEM_NAME?= ${DISTNAME} | | 199 | GEM_NAME?= ${DISTNAME} |
189 | GEM_CACHEDIR= ${GEM_HOME}/cache | | 200 | GEM_CACHEDIR= ${GEM_HOME}/cache |
190 | GEM_DOCDIR= ${GEM_HOME}/doc/${GEM_NAME} | | 201 | GEM_DOCDIR= ${GEM_HOME}/doc/${GEM_NAME} |