aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/ruby-rdtool/Makefile
blob: a77facb4a8f8bc2cc028ed1704be776800e2f766 (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
70
71
# New ports collection makefile for:    Ruby-RDtool
# Date created:     7 Aug 2000
# Whom:         Akinori MUSHA aka knu <knu@idaemons.org>
#
# $FreeBSD$
#

PORTNAME=   rdtool
PORTVERSION=    0.6.14
CATEGORIES= textproc ruby
MASTER_SITES=   http://www2.pos.to/~tosh/ruby/rdtool/archive/
PKGNAMEPREFIX=  ${RUBY_PKGNAMEPREFIX}
DIST_SUBDIR=    ruby

MAINTAINER= knu@FreeBSD.org
COMMENT=    RD to HTML/man/etc. converter (RD is to Ruby as POD is to Perl)

BUILD_DEPENDS=  ${DEPEND_RUBY_AMSTD} \
        racc:${PORTSDIR}/devel/ruby-racc

USE_RUBY=   yes
USE_RUBY_FEATURES=  optparse strscan

RUBY_MODNAME=   rd

RUBY_SHEBANG_FILES=  ${WRKSRC}/rmi2html.rb

EMACSLISPDIR=   ${PREFIX}/share/emacs/site-lisp
XEMACSLISPDIR=  ${PREFIX}/lib/xemacs/site-lisp

DOCS_EN=    README.html doc/rd-draft.rd     doc/rd-draft.html
DOCS_JA=    README.ja.html  doc/rd-draft.rd.ja  doc/rd-draft.ja.html

do-configure:
    @cd ${WRKSRC}; \
    ${SETENV} ${CONFIGURE_ENV} ${RUBY} rdtoolconf.rb

post-patch:
    ${RUBY} -i -pe 'gsub %r"/usr/local\b", "${PREFIX}"' ${WRKSRC}/utils/rdswap.rb

pre-build:
    @cd ${WRKSRC}; \
    ${LN} -s missing/strscan.rb

.if !defined(NOPORTDOCS)
post-build:
.for f in README.rd.ja doc/rd-draft.rd doc/rd-draft.rd.ja
    cd ${WRKSRC}; ${RUBY} -I. rd2 -r rd/rd2html-lib.rb ${f} \
        > ${f:S/.rd.ja$/.ja.html/:S/.rd$/.html/}
.endfor
.endif

post-install:
    ${INSTALL_SCRIPT} ${WRKSRC}/rmi2html.rb ${PREFIX}/bin/
    ${LN} -sf rmi2html.rb ${PREFIX}/bin/rmi2html
    ${INSTALL_DATA} ${WRKSRC}/rd/rd2rmi-lib.rb ${RUBY_SITELIBDIR}/rd/
    ${INSTALL_SCRIPT} ${WRKSRC}/utils/rdswap.rb ${PREFIX}/bin/rdswap
.if !defined(NOPORTDOCS)
    ${MKDIR} ${RUBY_MODEXAMPLESDIR}
    ${INSTALL_DATA} ${WRKSRC}/rd/dot.rd2rc ${RUBY_MODEXAMPLESDIR}/
    ${MKDIR} ${RUBY_MODDOCDIR}/ja
.for f in ${DOCS_EN}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/
.endfor
.for f in ${DOCS_JA}
    ${INSTALL_DATA} ${WRKSRC}/${f} ${RUBY_MODDOCDIR}/ja/
.endfor
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>