Fixup fromcvs/togit conversion
[pkgsrcv2.git] / lang / ruby193-base / Makefile
1 # $NetBSD: Makefile,v 1.16 2012/09/04 02:02:48 dholland Exp $
2 #
3
4 DISTNAME=       ${RUBY_DISTNAME}
5 PKGNAME=        ${RUBY_PKGPREFIX}-base-${RUBY_VERSION_FULL}
6 PKGREVISION=    2
7 CATEGORIES=     lang ruby
8 MASTER_SITES=   ${MASTER_SITE_RUBY}
9 DIST_SUBDIR=    ruby193-base-201202170
10
11 MAINTAINER=     taca@NetBSD.org
12 HOMEPAGE=       ${RUBY_HOMEPAGE}
13 COMMENT=        Ruby ${RUBY_VERSION} release minimum base package
14 LICENSE=        ${RUBY_LICENSE}
15
16 RUBY_VERSION_SUPPORTED= 193
17
18 PKG_DESTDIR_SUPPORT=    user-destdir
19
20 MAKE_JOBS_SAFE=         no
21 USE_LANGUAGES=          c
22 USE_TOOLS+=             pax yacc
23 GNU_CONFIGURE=          yes
24 TEST_TARGET=            test
25 CONFIGURE_ARGS+=        --enable-shared
26 WRKSRC=                 ${RUBY_WRKSRC}
27
28 MAKE_DIRS=              ${RUBY_SITEARCHLIB} ${RUBY_VENDORARCHLIB}
29
30 #
31 # Don't refrect pkgsrc's INSTALL macro since Ruby expect it could
32 # execute by unprivileged user.
33 #
34 CONFIGURE_ENV+=         INSTALL="${INSTALL} ${COPY}" \
35                         INSTALL_DATA= INSTALL_PROGRAM= INSTALL_SCRIPT=
36
37 .include "../../mk/compiler.mk"
38
39 .if !empty(PKGSRC_COMPILER:Msunpro)
40 LIBS.SunOS+=    -B static -lsunmath -B dynamic -lm
41 LDFLAGS.SunOS+= -L${SUNWSPROBASE}/lib -Wl,-R${SUNWSPROBASE}/lib
42 CONFIGURE_ENV+= LDSHARED="${CC} -G"
43 .else
44 LIBS.SunOS+=    -lm
45 .endif
46
47 .if ${OPSYS} == "SunOS"
48 CONFIGURE_ENV+= OBJCOPY=:
49 CONFIGURE_ENV+= ac_cv_prog_PKG_CONFIG=""
50 .endif
51
52 .if ${OPSYS} == "MirBSD"
53 # if present, an unsupported sysconf call is used
54 CONFIGURE_ENV+= ac_cv_func_getgrnam_r=no
55 .endif
56
57 # Ruby build process depends on config.status's content
58 CONFIG_STATUS_OVERRIDE= # empty
59
60 MAKE_DIRS+=     ${RUBY_SITERIDIR}
61 FILES_SUBST+=   DATE=${DATE:Q}
62
63 REQD_DIRS+=     ${GEM_HOME}/cache
64 REQD_DIRS+=     ${GEM_HOME}/doc
65
66 SUBST_CLASSES+=         conf
67 SUBST_STAGE.conf=       pre-install
68 SUBST_FILES.conf=       lib/rubygems/config_file.rb
69 SUBST_SED.conf=         -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
70 SUBST_MESSAGE.conf=     Fixing configuration files.
71
72 .include "options.mk"
73
74 .include "../../lang/ruby/rubyversion.mk"
75
76 .if !empty(RUBY_SUFFIX)
77 CONFIGURE_ARGS+=        --program-suffix=${RUBY_SUFFIX}
78 CONFIGURE_ARGS+=        --with-soname=${RUBY_NAME}
79 CONFIGURE_ARGS+=        --with-sitedir=${PREFIX}/${RUBY_SITELIB_BASE}
80 CONFIGURE_ARGS+=        --with-vendordir=${PREFIX}/${RUBY_VENDORLIB_BASE}
81 CONFIGURE_ARGS+=        --with-ruby-version=${RUBY_VERSION}
82 .endif
83
84 #
85 # IRIX work around which should be fixed.
86 #
87 PLIST_VARS+=    io
88 .if ${OPSYS} != "IRIX"
89 PLIST.io=       yes
90 .endif
91
92 #
93 # Work around for getucontext(3)
94 #
95 .if ${OPSYS} == "DragonFly" && ${OS_VERSION} == "1.8.0"
96 CONFIGURE_ENV+= ac_cv_header_ucontext_h=no
97 .endif
98
99 #
100 # work around for Linux
101 #
102 .if ${OPSYS} == "Linux"
103 CONFIGURE_ENV+= MKDIR_P=${MKDIR:Q}
104 .endif
105
106 DOCS=           COPYING COPYING.ja ChangeLog NEWS README \
107                 README.EXT README.EXT.ja README.ja ToDo \
108                 doc/ChangeLog-1.8.0 doc/ChangeLog-YARV doc/NEWS-1.8.7 \
109                 doc/forwardable.rd doc/forwardable.rd.ja \
110                 doc/irb/irb-tools.rd.ja doc/irb/irb.rd doc/irb/irb.rd.ja \
111                 doc/shell.rd doc/shell.rd.ja
112 EXT_DOCS=       bigdecimal/bigdecimal_en.html bigdecimal/bigdecimal_ja.html \
113                 syslog/syslog.txt
114
115 BIGDECIMAL_EXAMPLES=    linear.rb nlsolve.rb pi.rb
116 OPENSSL_EXAMPLES=       c_rehash.rb cert2text.rb certstore.rb cipher.rb \
117                         crlstore.rb echo_cli.rb echo_svr.rb gen_csr.rb \
118                         smime_read.rb smime_write.rb wget.rb
119
120 REPLACE_RUBY=           bin/erb bin/gem bin/irb bin/rake bin/rdoc \
121                         bin/ri bin/testrb
122 REPLACE_RUBY_DIRS=      ext lib sample
123 INSTALLATION_DIRS=      bin ${PKGMANDIR}/man1 \
124                         ${RUBY_DOC}/irb ${RUBY_DOC}/ripper ${RUBY_DOC}/stringio \
125                         ${RUBY_EG}/bigdecimal ${RUBY_EG}/pty
126 # ${RUBY_ARCHINC} ${RUBY_ARCHLIB}
127 EMPTY_DIRS=             generator/template markup/simple_markup
128
129 pre-configure:
130         ${RM} -f ${WRKSRC}/ext/curses/extconf.rb
131         ${RM} -f ${WRKSRC}/ext/gdbm/extconf.rb
132         ${RM} -f ${WRKSRC}/ext/fiddle/extconf.rb
133         ${RM} -f ${WRKSRC}/ext/readline/extconf.rb
134         ${RM} -f ${WRKSRC}/ext/tk/extconf.rb
135
136 pre-install:
137         cd ${WRKSRC}/bin; for f in *; do ${LN} -f $$f $${f}${RUBY_VER}; done
138         cd ${WRKSRC}/lib; \
139                 ${FIND} . \( -name '*.orig' -o -name '*.orig_dist' \) \
140                 -exec ${RM} -f {} \;
141 .for f in ${EMPTY_DIRS}
142         ${RMDIR} ${WRKSRC}/lib/rdoc/${f} 2>/dev/null || ${TRUE}
143 .endfor
144
145 post-install:
146 .for f in ${DOCS}
147         ${INSTALL_DATA} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}/${f:C/^doc\///}
148 .endfor
149 .for f in ${EXT_DOCS}
150         ${INSTALL_DATA} ${WRKSRC}/ext/${f} ${DESTDIR}${PREFIX}/${RUBY_DOC}
151 .endfor
152         cd ${WRKSRC}/ext/ripper; ${PAX} -rw README ${DESTDIR}${PREFIX}/${RUBY_DOC}/ripper
153         cd ${WRKSRC}/ext/stringio; ${PAX} -rw README ${DESTDIR}${PREFIX}/${RUBY_DOC}/stringio
154         cd ${WRKSRC}/sample; ${PAX} -rw . ${DESTDIR}${PREFIX}/${RUBY_EG}
155 .for f in ${BIGDECIMAL_EXAMPLES}
156         ${INSTALL_DATA} ${RUBY_WRKSRC}/ext/bigdecimal/sample/${f} \
157                 ${DESTDIR}${PREFIX}/${RUBY_EG}/bigdecimal
158 .endfor
159 .for f in ${OPENSSL_EXAMPLES}
160         ${INSTALL_DATA} ${RUBY_WRKSRC}/sample/openssl/${f} \
161                 ${DESTDIR}${PREFIX}/${RUBY_EG}/openssl
162 .endfor
163         ${RUBY_GENERATE_PLIST}
164
165 .include "../../mk/bdb.buildlink3.mk"
166 .include "../../converters/libiconv/buildlink3.mk"
167 .include "../../devel/zlib/buildlink3.mk"
168 .include "../../security/openssl/buildlink3.mk"
169 .include "../../textproc/libyaml/buildlink3.mk"
170 .include "../../lang/ruby/Makefile.common"
171 .include "../../mk/bsd.pkg.mk"