Sat Mar 12 14:07:14 2011 UTC ()
Add MULTI variable, and add it to BUILD_DEFS, to more easily find
variable settings affecting binary packages.

>From Aleksey Cheusov in PR 44695.


(wiz)
diff -r1.13 -r1.14 pkgsrc/lang/php/phpversion.mk
diff -r1.86 -r1.87 pkgsrc/lang/python/pyversion.mk
diff -r1.59 -r1.60 pkgsrc/lang/ruby/rubyversion.mk
diff -r1.25 -r1.26 pkgsrc/mk/apache.mk
diff -r1.1976 -r1.1977 pkgsrc/mk/bsd.pkg.mk

cvs diff -r1.13 -r1.14 pkgsrc/lang/php/phpversion.mk (expand / switch to unified diff)

--- pkgsrc/lang/php/phpversion.mk 2010/09/23 07:38:05 1.13
+++ pkgsrc/lang/php/phpversion.mk 2011/03/12 14:07:13 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: phpversion.mk,v 1.13 2010/09/23 07:38:05 taca Exp $ 1# $NetBSD: phpversion.mk,v 1.14 2011/03/12 14:07:13 wiz Exp $
2# 2#
3# This file selects a PHP version, based on the user's preferences and 3# This file selects a PHP version, based on the user's preferences and
4# the installed packages. It does not add a dependency on the PHP 4# the installed packages. It does not add a dependency on the PHP
5# package. 5# package.
6# 6#
7# === User-settable variables === 7# === User-settable variables ===
8# 8#
9# PHP_VERSION_DEFAULT 9# PHP_VERSION_DEFAULT
10# The PHP version to choose when more than one is acceptable to 10# The PHP version to choose when more than one is acceptable to
11# the package. '5' means any 5.*, 52 only 5.2.*, 53 only 5.3.* 11# the package. '5' means any 5.*, 52 only 5.2.*, 53 only 5.3.*
12# 12#
13# Possible: 5 52 53 13# Possible: 5 52 53
14# Default: 5 14# Default: 5
@@ -126,26 +126,30 @@ _PHP_VERSION_FIRSTACCEPTED?= ${pv} @@ -126,26 +126,30 @@ _PHP_VERSION_FIRSTACCEPTED?= ${pv}
126.endfor 126.endfor
127.endif 127.endif
128# if the default is OK for the addon pkg, take this 128# if the default is OK for the addon pkg, take this
129.if !defined(_PHP_VERSION) 129.if !defined(_PHP_VERSION)
130.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK) 130.if defined(_PHP_VERSION_${PHP_VERSION_DEFAULT}_OK)
131_PHP_VERSION= ${PHP_VERSION_DEFAULT} 131_PHP_VERSION= ${PHP_VERSION_DEFAULT}
132.endif 132.endif
133.endif 133.endif
134# take the first one accepted by the package 134# take the first one accepted by the package
135.if !defined(_PHP_VERSION) 135.if !defined(_PHP_VERSION)
136_PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED} 136_PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED}
137.endif 137.endif
138 138
 139#
 140# Variable assignment for multi-PHP packages
 141MULTI+= PHP_VERSION_REQD=${_PHP_VERSION}
 142
139# export some of internal variables 143# export some of internal variables
140PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//} 144PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//}
141PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/} 145PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
142 146
143# currently we have only PHP 5.x packages. 147# currently we have only PHP 5.x packages.
144PKG_PHP_MAJOR_VERS:= 5 148PKG_PHP_MAJOR_VERS:= 5
145 149
146# if installed PHP isn't compatible with required PHP, bail out 150# if installed PHP isn't compatible with required PHP, bail out
147.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED) 151.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED)
148PKG_SKIP_REASON+= "Package accepts ${PKG_PHP}, but different version is installed" 152PKG_SKIP_REASON+= "Package accepts ${PKG_PHP}, but different version is installed"
149.endif 153.endif
150 154
151MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ 155MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \

cvs diff -r1.86 -r1.87 pkgsrc/lang/python/pyversion.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/pyversion.mk 2011/02/25 09:47:24 1.86
+++ pkgsrc/lang/python/pyversion.mk 2011/03/12 14:07:13 1.87
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: pyversion.mk,v 1.86 2011/02/25 09:47:24 wiz Exp $ 1# $NetBSD: pyversion.mk,v 1.87 2011/03/12 14:07:13 wiz Exp $
2 2
3# This file determines which Python version is used as a dependency for 3# This file determines which Python version is used as a dependency for
4# a package. 4# a package.
5# 5#
6# === User-settable variables === 6# === User-settable variables ===
7# 7#
8# PYTHON_VERSION_DEFAULT 8# PYTHON_VERSION_DEFAULT
9# The preferred Python version to use. 9# The preferred Python version to use.
10# 10#
11# Possible values: 24 25 26 27 11# Possible values: 24 25 26 27
12# Default: 26 12# Default: 26
13# 13#
14# === Package-settable variables === 14# === Package-settable variables ===
@@ -102,26 +102,30 @@ _PYTHON_VERSION= ${PYTHON_VERSION_REQD} @@ -102,26 +102,30 @@ _PYTHON_VERSION= ${PYTHON_VERSION_REQD}
102_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT} 102_PYTHON_VERSION= ${PYTHON_VERSION_DEFAULT}
103. endif 103. endif
104. endif 104. endif
105# prefer an already installed version, in order of "accepted" 105# prefer an already installed version, in order of "accepted"
106. if !defined(_PYTHON_VERSION) 106. if !defined(_PYTHON_VERSION)
107. for pv in ${PYTHON_VERSIONS_ACCEPTED} 107. for pv in ${PYTHON_VERSIONS_ACCEPTED}
108. if defined(_PYTHON_VERSION_${pv}_OK) 108. if defined(_PYTHON_VERSION_${pv}_OK)
109_PYTHON_VERSION?= ${pv} 109_PYTHON_VERSION?= ${pv}
110. endif 110. endif
111. endfor 111. endfor
112. endif 112. endif
113.endif 113.endif
114 114
 115#
 116# Variable assignment for multi-python packages
 117MULTI+= PYTHON_VERSION_REQD=${_PYTHON_VERSION}
 118
115# No supported version found, annotate to simplify statements below. 119# No supported version found, annotate to simplify statements below.
116.if !defined(_PYTHON_VERSION) 120.if !defined(_PYTHON_VERSION)
117_PYTHON_VERSION= none 121_PYTHON_VERSION= none
118.endif 122.endif
119 123
120.if ${_PYTHON_VERSION} == "27" 124.if ${_PYTHON_VERSION} == "27"
121PYPKGSRCDIR= ../../lang/python27 125PYPKGSRCDIR= ../../lang/python27
122PYDEPENDENCY= ${BUILDLINK_API_DEPENDS.python27}:${PYPKGSRCDIR} 126PYDEPENDENCY= ${BUILDLINK_API_DEPENDS.python27}:${PYPKGSRCDIR}
123PYPACKAGE= python27 127PYPACKAGE= python27
124PYVERSSUFFIX= 2.7 128PYVERSSUFFIX= 2.7
125PYPKGPREFIX= py27 129PYPKGPREFIX= py27
126PYDISTUTILS_CREATES_EGGFILES= yes 130PYDISTUTILS_CREATES_EGGFILES= yes
127.elif ${_PYTHON_VERSION} == "26" 131.elif ${_PYTHON_VERSION} == "26"

cvs diff -r1.59 -r1.60 pkgsrc/lang/ruby/rubyversion.mk (expand / switch to unified diff)

--- pkgsrc/lang/ruby/rubyversion.mk 2011/02/21 15:00:34 1.59
+++ pkgsrc/lang/ruby/rubyversion.mk 2011/03/12 14:07:13 1.60
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: rubyversion.mk,v 1.59 2011/02/21 15:00:34 taca Exp $ 1# $NetBSD: rubyversion.mk,v 1.60 2011/03/12 14:07:13 wiz Exp $
2# 2#
3 3
4.if !defined(_RUBYVERSION_MK) 4.if !defined(_RUBYVERSION_MK)
5_RUBYVERSION_MK= # defined 5_RUBYVERSION_MK= # defined
6 6
7.include "../../mk/bsd.prefs.mk" 7.include "../../mk/bsd.prefs.mk"
8 8
9# current supported Ruby's version 9# current supported Ruby's version
10RUBY18_VERSION= 1.8.7 10RUBY18_VERSION= 1.8.7
11RUBY19_VERSION= 1.9.2 11RUBY19_VERSION= 1.9.2
12 12
13# patch 13# patch
14RUBY18_PATCHLEVEL= pl334 14RUBY18_PATCHLEVEL= pl334
@@ -51,26 +51,30 @@ RUBY_VERSION?= ${RUBY18_VERSION} @@ -51,26 +51,30 @@ RUBY_VERSION?= ${RUBY18_VERSION}
51 51
52RUBY_PATCH_LEVEL= ${RUBY${RUBY_VER}_PATCHLEVEL} 52RUBY_PATCH_LEVEL= ${RUBY${RUBY_VER}_PATCHLEVEL}
53 53
54.if ${RUBY_VERSION} == ${RUBY18_VERSION} 54.if ${RUBY_VERSION} == ${RUBY18_VERSION}
55RUBY_API_VERSION= ${RUBY18_API_VERSION} 55RUBY_API_VERSION= ${RUBY18_API_VERSION}
56RUBY_VERSION_SUFFIX= ${RUBY_VERSION}${RUBY_PATCH_LEVEL:S/pl/./} 56RUBY_VERSION_SUFFIX= ${RUBY_VERSION}${RUBY_PATCH_LEVEL:S/pl/./}
57RUBY_ABI_VERSION= ${RUBY_VERSION_SUFFIX} 57RUBY_ABI_VERSION= ${RUBY_VERSION_SUFFIX}
58.elif ${RUBY_VERSION} == ${RUBY19_VERSION} 58.elif ${RUBY_VERSION} == ${RUBY19_VERSION}
59RUBY_API_VERSION= ${RUBY19_API_VERSION} 59RUBY_API_VERSION= ${RUBY19_API_VERSION}
60RUBY_VERSION_SUFFIX= ${RUBY_VERSION}${RUBY_PATCH_LEVEL} 60RUBY_VERSION_SUFFIX= ${RUBY_VERSION}${RUBY_PATCH_LEVEL}
61RUBY_ABI_VERSION= ${RUBY19_API_VERSION} 61RUBY_ABI_VERSION= ${RUBY19_API_VERSION}
62.endif 62.endif
63 63
 64#
 65# Variable assignment for multi-ruby packages
 66MULTI+= RUBY_VERSION_REQD=${RUBY_VERSION_REQD:U${_RUBY_VERSION_DEFAULT}}
 67
64# RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is 68# RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is
65# supported by the package. It should be defined by the packages 69# supported by the package. It should be defined by the packages
66# for specific Ruby versions. 70# for specific Ruby versions.
67# 71#
68RUBY_VERSION_SUPPORTED?= 18 19 72RUBY_VERSION_SUPPORTED?= 18 19
69 73
70# RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to 74# RUBY_VERSION_LIST defines the list of ${RUBY_VER} which is known to
71# this framework. 75# this framework.
72# 76#
73RUBY_VERSION_LIST= 18 19 77RUBY_VERSION_LIST= 18 19
74 78
75# RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on 79# RUBY_NOVERSION should be set to "Yes" if the package dosen't depend on
76# any specific version of ruby command. In this case, package's 80# any specific version of ruby command. In this case, package's

cvs diff -r1.25 -r1.26 pkgsrc/mk/apache.mk (expand / switch to unified diff)

--- pkgsrc/mk/apache.mk 2007/12/17 22:09:58 1.25
+++ pkgsrc/mk/apache.mk 2011/03/12 14:07:13 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: apache.mk,v 1.25 2007/12/17 22:09:58 tron Exp $ 1# $NetBSD: apache.mk,v 1.26 2011/03/12 14:07:13 wiz Exp $
2# 2#
3# This file is meant to be included by packages that require an apache 3# This file is meant to be included by packages that require an apache
4# web server. 4# web server.
5# 5#
6# User-settable variables: 6# User-settable variables:
7# 7#
8# PKG_APACHE_DEFAULT 8# PKG_APACHE_DEFAULT
9# The default apache server to use and install. If there already 9# The default apache server to use and install. If there already
10# is an apache installed, this will have no effect. 10# is an apache installed, this will have no effect.
11# 11#
12# Possible values: apache13 apache2 apache22 12# Possible values: apache13 apache2 apache22
13# 13#
14# Package-settable variables: 14# Package-settable variables:
@@ -125,14 +125,18 @@ PKG_APACHE?= ${ap} @@ -125,14 +125,18 @@ PKG_APACHE?= ${ap}
125PKG_FAIL_REASON+= "[apache.mk] No acceptable apache package found." 125PKG_FAIL_REASON+= "[apache.mk] No acceptable apache package found."
126PKG_APACHE= none 126PKG_APACHE= none
127.endif 127.endif
128 128
129APACHE_PKG_PREFIX= ${_APACHE_PKG_PREFIX.${PKG_APACHE}} 129APACHE_PKG_PREFIX= ${_APACHE_PKG_PREFIX.${PKG_APACHE}}
130 130
131.if (${PKG_APACHE} == "apache2") && !empty(USE_APR:M[yY][eE][sS]) 131.if (${PKG_APACHE} == "apache2") && !empty(USE_APR:M[yY][eE][sS])
132. include "../../devel/apr0/buildlink3.mk" 132. include "../../devel/apr0/buildlink3.mk"
133.elif (${PKG_APACHE} == "apache22") && !empty(USE_APR:M[Yy][Ee][Ss]) 133.elif (${PKG_APACHE} == "apache22") && !empty(USE_APR:M[Yy][Ee][Ss])
134. include "../../devel/apr/buildlink3.mk" 134. include "../../devel/apr/buildlink3.mk"
135. include "../../devel/apr-util/buildlink3.mk" 135. include "../../devel/apr-util/buildlink3.mk"
136.endif 136.endif
137 137
 138#
 139# Variable assignment for multi-apache packages
 140MULTI+= PKG_APACHE=${PKG_APACHE}
 141
138.endif # APACHE_MK 142.endif # APACHE_MK

cvs diff -r1.1976 -r1.1977 pkgsrc/mk/bsd.pkg.mk (expand / switch to unified diff)

--- pkgsrc/mk/bsd.pkg.mk 2011/02/07 10:32:32 1.1976
+++ pkgsrc/mk/bsd.pkg.mk 2011/03/12 14:07:13 1.1977
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.pkg.mk,v 1.1976 2011/02/07 10:32:32 wiz Exp $ 1# $NetBSD: bsd.pkg.mk,v 1.1977 2011/03/12 14:07:13 wiz Exp $
2# 2#
3# This file is in the public domain. 3# This file is in the public domain.
4# 4#
5# Please see the pkgsrc/doc/guide manual for details on the 5# Please see the pkgsrc/doc/guide manual for details on the
6# variables used in this make file template. 6# variables used in this make file template.
7# 7#
8# Default sequence for "all" is: 8# Default sequence for "all" is:
9# 9#
10# bootstrap-depends 10# bootstrap-depends
11# fetch 11# fetch
12# checksum 12# checksum
13# depends 13# depends
14# tools 14# tools
@@ -195,26 +195,33 @@ _BUILD_DEFS+= PKGMANDIR @@ -195,26 +195,33 @@ _BUILD_DEFS+= PKGMANDIR
195_BUILD_DEFS+= _USE_DESTDIR 195_BUILD_DEFS+= _USE_DESTDIR
196 196
197# Store the result in the +BUILD_INFO file so we can query for the build 197# Store the result in the +BUILD_INFO file so we can query for the build
198# options using "pkg_info -Q PKG_OPTIONS <pkg>". 198# options using "pkg_info -Q PKG_OPTIONS <pkg>".
199# 199#
200.if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS) 200.if defined(PKG_SUPPORTED_OPTIONS) && defined(PKG_OPTIONS)
201_BUILD_DEFS+= PKG_OPTIONS 201_BUILD_DEFS+= PKG_OPTIONS
202.endif 202.endif
203 203
204.if empty(DEPOT_SUBDIR) 204.if empty(DEPOT_SUBDIR)
205PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty." 205PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty."
206.endif 206.endif
207 207
 208# Store the build options for multi-packages, i.e. packages that can
 209# be built with multiple versions of Apache, Python, Ruby, PHP etc.
 210#
 211.if defined(MULTI)
 212_BUILD_DEFS+= MULTI
 213.endif
 214
208# ZERO_FILESIZE_P exits with a successful return code if the given file 215# ZERO_FILESIZE_P exits with a successful return code if the given file
209# has zero length. 216# has zero length.
210# NONZERO_FILESIZE_P exits with a successful return code if the given file 217# NONZERO_FILESIZE_P exits with a successful return code if the given file
211# has nonzero length. 218# has nonzero length.
212# 219#
213_ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }' 220_ZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 1 : 0; }'
214_NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }' 221_NONZERO_FILESIZE_P= ${AWK} 'END { exit (NR > 0) ? 0 : 1; }'
215 222
216# Automatically increase process limit where necessary for building. 223# Automatically increase process limit where necessary for building.
217_ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}};@} 224_ULIMIT_CMD= ${UNLIMIT_RESOURCES:@_lim_@${ULIMIT_CMD_${_lim_}};@}
218 225
219_NULL_COOKIE= ${WRKDIR}/.null 226_NULL_COOKIE= ${WRKDIR}/.null
220 227