summaryrefslogtreecommitdiff
path: root/lang/ruby/rdoc.mk
blob: 6fd1f48f6ab08f1dfc2e355e2c8faa6456f65f2b (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
# $NetBSD: rdoc.mk,v 1.15 2013/06/11 15:00:18 taca Exp $

.if !defined(_RUBY_RDOC_MK)
_RUBY_RDOC_MK=	# defined

#
# === Package-settable variables ===
#
# RUBY_RDOC_REQD
#	Specify later version of rdoc.  Ruby base packages contain:
#
#		ruby18-base:	rdoc 1.0.1 - 20041108
#		ruby193-base:	rdoc 3.9.4
#		ruby200-base:	rdoc 4.0.0
#
#	If a package has a trouble with these version, please specify the
#	version of rdoc to RDOC_REQD.
#

#
# current rdoc versions.
#
RUBY_RDOC_VERSION=	4.0.1

.if !empty(RUBY_RDOC_REQD)

RUBY18_RDOC_VERS=	1.0.1
RUBY193_RDOC_VERS=	3.9.4
RUBY200_RDOC_VERS=	4.0.0

_RDOC_REQD_MAJOR=	${RUBY_RDOC_REQD:C/\.[0-9\.]+$//}
_RDOC_REQD_MINORS=	${RUBY_RDOC_REQD:C/^([0-9]+)\.*//}

. if ${RUBY_VER} == "18"
_RUBY_RDOC_MAJOR=	${RUBY18_RDOC_VERS:C/\.[0-9\.]+$//}
_RUBY_RDOC_MINORS=	${RUBY18_RDOC_VERS:C/^([0-9]+)\.*//}
.elif ${RUBY_VER} == "193"
_RUBY_RDOC_MAJOR=	${RUBY193_RDOC_VERS:C/\.[0-9\.]+$//}
_RUBY_RDOC_MINORS=	${RUBY193_RDOC_VERS:C/^([0-9]+)\.*//}
.elif ${RUBY_VER} == "200"
_RUBY_RDOC_MAJOR=	${RUBY200_RDOC_VERS:C/\.[0-9\.]+$//}
_RUBY_RDOC_MINORS=	${RUBY200_RDOC_VERS:C/^([0-9]+)\.*//}
.else
PKG_FAIL_REASON+= "Unknown Ruby version specified: ${RUBY_VER}."
. endif

_RUBY_RDOC_REQD=	NO

. if ${_RDOC_REQD_MAJOR} > ${_RUBY_RDOC_MAJOR}
_RUBY_RDOC_REQD=	YES
. elif ${_RDOC_REQD_MAJOR} == ${_RUBY_RDOC_MAJOR}
.  if !empty(_RUBY_RDOC_MINORS) && ${_RDOC_REQD_MINORS} > ${_RUBY_RDOC_MINORS}
_RUBY_RDOC_REQD=	YES
.  endif
. endif

. if empty(_RUBY_RDOC_REQD:M[nN][oO])
RDOC=			${PREFIX}/bin/rdoc
.  if empty(RUBY_BUILD_RI:M[nN][oO]) && empty(RUBY_BUILD_RDOC:M[nN][oO])
# rdoc will be required at runtime, too.
DEPENDS+= ${RUBY_PKGPREFIX}-rdoc>=${RUBY_RDOC_REQD}:../../devel/ruby-rdoc
.  endif
. endif

.endif
.endif