aboutsummaryrefslogtreecommitdiffstats
path: root/devel/ruby-gems/Makefile
blob: b1cd1adfeefc448dc736d632af3932aa84ef06c1 (plain) (blame)
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
# Created by: Alexander Novitsky <alecn2002@yandex.ru>
# $FreeBSD$

PORTNAME=   gems
# Do not forget to update the following gemspec patches:
# - security/rubygem-ezcrypto/files/patch-gemspec
# - www/rubygem-gitlab-grack/files/patch-gemspec
PORTVERSION=    2.7.6
CATEGORIES= devel ruby
MASTER_SITES=   http://production.cf.rubygems.org/rubygems/
PKGNAMEPREFIX=  ${RUBY_PKGNAMEPREFIX}
DISTNAME=   ruby${PORTNAME}-${PORTVERSION}
DIST_SUBDIR=    ruby

MAINTAINER= ruby@FreeBSD.org
COMMENT=    Package management framework for the Ruby language

LICENSE=    MIT RUBY
LICENSE_COMB=   dual
LICENSE_FILE_MIT=   ${WRKSRC}/MIT.txt
LICENSE_FILE_RUBY=  ${WRKSRC}/LICENSE.txt

NO_ARCH=    yes
NO_BUILD=   yes
USE_RUBY=   yes
RUBY_SETUP= setup.rb
USES=       tar:tgz

GEMS_BASE_DIR=      lib/ruby/gems
GEMS_BASE_DIR_P=    ${GEMS_BASE_DIR}
GEMS_VER_DIR=       ${GEMS_BASE_DIR}/${RUBY_VER}
GEMS_VER_DIR_P=     ${GEMS_BASE_DIR_P}/%%RUBY_VER%%
GEMS_DOC_BASE_DIR=  ${GEMS_VER_DIR}/doc
GEMS_DOC_BASE_DIR_P=    ${GEMS_VER_DIR_P}/doc
GEMS_DOC_DIR=       ${GEMS_DOC_BASE_DIR}/${DISTNAME}
GEMS_DOC_DIR_P=     ${GEMS_DOC_BASE_DIR_P}/%%DISTNAME%%
GEMS_ENV=       DONT_USE_BUNDLER_FOR_GEMDEPS=true GEM_HOME=${STAGEDIR}${PREFIX}/${GEMS_VER_DIR}
RUBY_SETUP_OPTIONS= --destdir=${STAGEDIR} --no-regenerate-binstubs
RUBY_VER_SHORT=     ${RUBY_VER:S/.//}

GEMS_DIR=       ${GEMS_VER_DIR}/gems
DOC_DIR=        ${GEMS_VER_DIR}/doc
CACHE_DIR=      ${GEMS_VER_DIR}/cache
SPEC_DIR=       ${GEMS_VER_DIR}/specifications
EXT_DIR=        ${GEMS_VER_DIR}/extensions

PLIST_SUB=  DISTNAME="${DISTNAME}" \
        RUBY_VER_SHORT="${RUBY_VER_SHORT}" \
        GEMS_DIR="${GEMS_DIR}" \
        DOC_DIR="${DOC_DIR}" \
        CACHE_DIR="${CACHE_DIR}" \
        SPEC_DIR="${SPEC_DIR}" \
        EXT_DIR="${EXT_DIR}"

OPTIONS_DEFINE= DOCS

DOCS_VARS_OFF=  RUBY_SETUP_OPTIONS+="--no-ri --no-rdoc"

do-install:
    cd ${WRKSRC}/ && ${SETENV} ${GEMS_ENV} ${RUBY} ${RUBY_SETUP} ${RUBY_SETUP_OPTIONS}
    ${LN} -sf gem${RUBY_VER_SHORT} ${STAGEDIR}${PREFIX}/bin/gem

#
# Find all RDOC and RI files
#
post-install-DOCS-on:
    cd ${STAGEDIR}${PREFIX}/ && ${FIND} -ds ${GEMS_DOC_DIR}/ ! -type d >> ${TMPPLIST}

.include <bsd.port.mk>