summaryrefslogtreecommitdiff
path: root/www/zope/zopeversion.mk
blob: f461dc5404c5b55a88d8e9732511963db91f7dbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# $NetBSD: zopeversion.mk,v 1.11 2009/06/14 22:58:11 joerg Exp $
#

.if !defined(_ZOPEVERSION_MK)
_ZOPEVERSION_MK=	# defined

.include "../../mk/bsd.prefs.mk"

# The following variables may be set by the pkgsrc user in mk.conf:
#
# ZOPE_VERSION_DEFAULT
#	The preferred Zope version to use.
#	Possible value: (all)
#
# ZOPE_VERSION_ACCEPTED
#	The Zope version that are acceptable for the package.
#	The order of the entries matters.
#
# ZOPE_VERSION_REQD
#	The specific Zope version that are acceptable for the package.
#
# ZOPE_USER
#	Default Zope running user.
#
# ZOPE_GROUP
#	Default Zope running group.
#

# The following variables may not be set by the pkgsrc user in mk.conf:
#
# ZOPE_VERSION_SUPPORTED
#	Known Zope release which we support.
#
# ZOPE_PKG
#	Short name for each Zope major release; zope29, zope210 and
#	hopefully zope3.
#
# ZOPE_USE_PYPKGPREFIX
#	Bool variable which enable prefix Zope based package with
#	${ZOPE_PKG}.  (Experimental)
#
# ZOPE_COMMON
#	Basename of directory to install Zope.
#
# ZOPE_PRODUCTS_BASE
#	Basename of directory for Zope extention packages.
#	
# ZOPE_DOC_BASE
#	Documentation directory for Zope packages.
#
#

ZOPE_VERSION_SUPPORTED=	29 210 211 # 33 34

ZOPE_VERSION_DEFAULT?=	29
ZOPE_VERSION_ACCEPTED?=	${ZOPE_VERSION_SUPPORTED}

# current Zope version
ZOPE29_VERSION=		2.9.10
ZOPE210_VERSION=	2.10.7
ZOPE211_VERSION=	2.11.2
#ZOPE33_VERSION= 	3.3.1
#ZOPE34_VERSION= 	3.4.0

ZOPE_USER?=		zope
ZOPE_GROUP?=		zope

ZOPE_USE_PYPKGPREFIX?=	no

.if !empty(ZOPE_USE_PYPKGPREFIX:M[Yy][Ee][Ss])
BUILDLINK_API_DEPENDS.zope29?=		${PYPKGPREFIX}-zope29>=2.9.7
BUILDLINK_API_DEPENDS.zope210?=		${PYPKGPREFIX}-zope210>=2.10.3
BUILDLINK_API_DEPENDS.zope211?=		${PYPKGPREFIX}-zope211>=2.11.0
#BUILDLINK_API_DEPENDS.zope33?=		${PYPKGPREFIX}-zope33>=3.3.1
#BUILDLINK_API_DEPENDS.zope34?=		${PYPKGPREFIX}-zope34>=3.4.0
.else
BUILDLINK_API_DEPENDS.zope29?=		zope29>=2.9.7
BUILDLINK_API_DEPENDS.zope210?=		zope210>=2.10.3
BUILDLINK_API_DEPENDS.zope211?=		zope210>=2.11.0
#BUILDLINK_API_DEPENDS.zope33?=		zope33>=3.3.1
#BUILDLINK_API_DEPENDS.zope34?=		zope34>=3.4.0
.endif

ZOPE_COMMON?=		zope
ZOPE_BASE=		${ZOPE_COMMON}/${ZOPE_PKG}
ZOPE_DOC_BASE?=		share/doc/${ZOPE_PKG}
ZOPE_PRODUCTS_BASE=	${ZOPE_BASE}/Products

ZOPE_DIR=		${PREFIX}/${ZOPE_BASE}
ZOPE_DOC_DIR=		${PREFIX}/${ZOPE_DOC_BASE}
ZOPE_PRODUCTS_DIR=	${PREFIX}/${ZOPE_PRODUCTS_BASE}

# transform the list into individual variables
.for zv in ${ZOPE_VERSION_ACCEPTED}
_ZOPE_VERSION_${zv}_OK=	yes
.endfor

# check what is installed
.for zv in ${ZOPE_VERSION_SUPPORTED}
.if exists(${LOCALBASE}/${ZOPE_COMMON}/zope${zv})
_ZOPE_VERSION_${zv}_INSTALLED=	yes
.endif
.endfor

# if a version is explicitly required, take it
.if defined(ZOPE_VERSION_REQD)
_ZOPE_VERSION=	${ZOPE_VERSION_REQD}
.endif

#if a default is already installed, it is first choice
.if !defined(_ZOPE_VERSION)
.if defined(_ZOPE_VERSION_${ZOPE_VERSION_DEFAULT}_OK)
.if defined(_ZOPE_VERSION_${ZOPE_VERSION_DEFAULT}_INSTALLED)
_ZOPE_VERSION=	${ZOPE_VERSION_DEFAULT}
.endif
.endif
.endif
# prefer an already installed version, in order of "accepted"
.if !defined(_ZOPE_VERSION)
.for zv in ${ZOPE_VERSION_ACCEPTED}
.if defined(_ZOPE_VERSION_${zv}_INSTALLED)
_ZOPE_VERSION?=	${zv}
.else
# keep information as last resort - see below
_ZOPE_VERSION_FIRSTACCEPTED?=	${zv}
.endif
.endfor
.endif
# if the default is OK for the addon pkg, take this
.if !defined(_ZOPE_VERSION)
.if defined(_ZOPE_VERSION_${ZOPE_VERSION_DEFAULT}_OK)
_ZOPE_VERSION=   ${ZOPE_VERSION_DEFAULT}
.endif
.endif
# take the first one accepted by the package
.if !defined(_ZOPE_VERSION)
_ZOPE_VERSION=   ${_ZOPE_VERSION_FIRSTACCEPTED}
.endif

#
ZOPE_VERSION?=	${_ZOPE_VERSION}
ZOPE_PKG:=	zope${ZOPE_VERSION}

# force the selected ZOPE version for recursive builds
ZOPE_VERSION_REQD:=	${ZOPE_VERSION}

ZOPE_PKGSRC_DIR=	../../www/${ZOPE_PKG}
.if !empty(ZOPE_USE_PYPKGPREFIX:M[Yy][Ee][Ss])
ZOPE_PKG_PREFIX=	${PYPKGPREFIX}-${ZOPE_PKG}
.else
ZOPE_PKG_PREFIX=	${ZOPE_PKG}
.endif

.if ${_ZOPE_VERSION} == "29"
ZOPE_FULL_VERSION=	${ZOPE29_VERSION}
ZOPE_DEPENDENCY=	${BUILDLINK_API_DEPENDS.zope29}:${ZOPE_PKGSRC_DIR}
EVAL_PREFIX+=		BUILDLINK_PREFIX.zope29=${ZOPE_PKG}
BUILDLINK_PREFIX.zope29_DEFAULT= ${LOCALBASE}
.elif ${_ZOPE_VERSION} == "210"
ZOPE_FULL_VERSION=	${ZOPE210_VERSION}
ZOPE_DEPENDENCY=	${BUILDLINK_API_DEPENDS.zope210}:${ZOPE_PKGSRC_DIR}
EVAL_PREFIX+=		BUILDLINK_PREFIX.zope210=${ZOPE_PKG}
BUILDLINK_PREFIX.zope211_DEFAULT= ${LOCALBASE}
.elif ${_ZOPE_VERSION} == "211"
ZOPE_FULL_VERSION=	${ZOPE211_VERSION}
ZOPE_DEPENDENCY=	${BUILDLINK_API_DEPENDS.zope211}:${ZOPE_PKGSRC_DIR}
EVAL_PREFIX+=		BUILDLINK_PREFIX.zope211=${ZOPE_PKG}
BUILDLINK_PREFIX.zope211_DEFAULT= ${LOCALBASE}
#.elif ${_ZOPE_VERSION} == "33"
#ZOPE_FULL_VERSION=	${ZOPE33_VERSION}
#ZOPE_DEPENDENCY=	${BUILDLINK_API_DEPENDS.zope33}:${ZOPE_PKGSRC_DIR}
#EVAL_PREFIX+=		BUILDLINK_PREFIX.zope33=${ZOPE_PKG}
#BUILDLINK_PREFIX.zope33_DEFAULT= ${LOCALBASE}
#.elif ${_ZOPE_VERSION} == "34"
#ZOPE_FULL_VERSION=	${ZOPE34_VERSION}
#ZOPE_DEPENDENCY=	${BUILDLINK_API_DEPENDS.zope34}:${ZOPE_PKGSRC_DIR}
#EVAL_PREFIX+=		BUILDLINK_PREFIX.zope34=${ZOPE_PKG}
#BUILDLINK_PREFIX.zope34_DEFAULT= ${LOCALBASE}
.else
PKG_SKIP_REASON+=	"No valid Zope version"
.endif

BUILD_DEFS+=		ZOPE_VERSION
BUILD_DEFS_EFFECTS+=	ZOPE_PKG

FILES_SUBST+=	ZOPE_PKG=${ZOPE_PKG} ZOPE_VERSION=${ZOPE_VERSION} \
		ZOPE_FULL_VERSION=${ZOPE_FULL_VERSION}

MESSAGE_SUBST+=	ZOPE_VERSION=${ZOPE_VERSION} \
		ZOPE_COMMON=${ZOPE_COMMON} \
		ZOPE_PKG=${ZOPE_PKG} \
		ZOPE_DIR=${ZOPE_DIR} \
		ZOPE_PRODUCTS_DIR=${ZOPE_PRODUCTS_DIR} \
		ZOPE_GROUP=${ZOPE_GROUP:Q} \
		ZOPE_USER=${ZOPE_USER:Q}

PLIST_SUBST+=	ZOPE_VERSION=${ZOPE_VERSION} \
		ZOPE_BASE=${ZOPE_BASE} \
		ZOPE_COMMON=${ZOPE_COMMON} \
		ZOPE_DOC_BASE=${ZOPE_DOC_BASE} \
		ZOPE_PRODUCTS_BASE=${ZOPE_PRODUCTS_BASE}

PRINT_PLIST_AWK+=	/^${ZOPE_BASE:S|/|\\/|g}/ \
		{ gsub(/${ZOPE_BASE:S|/|\\/|g}/, "$${ZOPE_BASE}"); \
		print; next; }

#
ZOPE_PY_COMPILE= ${PYTHONBIN} ${ZOPE_DIR}/bin/compilezpy.py
PY_COMPILE_ALL= \
	${PYTHONBIN} ${PREFIX}/lib/python${PYVERSSUFFIX}/compileall.py -q

.endif