aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/yodl/Makefile
blob: c288bbd110ea3ab5b99adacff19b850fed7eb37d (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
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
# Created by: Donald Burr <dburr@FreeBSD.org>
# $FreeBSD$

PORTNAME=   yodl
PORTVERSION=    3.05.01
CATEGORIES= textproc
MASTER_SITES=   SF
DISTNAME=   ${PORTNAME}_${PORTVERSION}
EXTRACT_SUFX=   .orig.tar.gz

MAINTAINER= bofh@FreeBSD.org
COMMENT=    Easy to use but powerful document formatting/preparation language

LICENSE=    GPLv3

RUN_DEPENDS=    bash:shells/bash \
        ${LOCALBASE}/bin/getopt:misc/getopt
BUILD_DEPENDS=  icmake:devel/icmake \
        bash:shells/bash \
        gsed:textproc/gsed

USES=       perl5 shebangfix compiler:c++11-lib
USE_PERL5=  build

SHEBANG_LANG=   icmake
icmake_OLD_CMD= /usr/bin/icmake
icmake_CMD= ${LOCALBASE}/bin/icmake

SHEBANG_FILES=  ${WRKSRC}/macros/rawmacros/create \
        ${WRKSRC}/macros/rawmacros/keepdiff \
        ${WRKSRC}/macros/rawmacros/makeyoin \
        ${WRKSRC}/macros/rawmacros/repairs \
        ${WRKSRC}/macros/rawmacros/separator \
        ${WRKSRC}/macros/rawmacros/separator.pl \
        ${WRKSRC}/macros/rawmacros/startdoc \
        ${WRKSRC}/macros/rawmacros/startdoc.pl \
        ${WRKSRC}/contrib/build.pl \
        ${WRKSRC}/src/yodl/replace \
        ${WRKSRC}/scripts/configreplacements \
        ${WRKSRC}/scripts/macroseparator.pl \
        ${WRKSRC}/scripts/stdmacros \
        ${WRKSRC}/scripts/yodl2whatever.in \
        ${WRKSRC}/build

DOCSDIR=    ${PREFIX}/share/doc/${PORTNAME}-${PORTVERSION}
PORTDOCS=   *

PLIST_SUB+= PORTVERSION="${PORTVERSION}"

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}

OPTIONS_DEFINE= DOCS

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
USE_TEX=    latex:build dvipsk:build
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|"/usr"|"${PREFIX}"| ; \
        s|"/share/yodl"|"/share/${PORTNAME}-${PORTVERSION}"| ; \
        s|"/share/man"|"/man"| ; \
        s|"/share/doc/yodl"|"/share/doc/${PORTNAME}-${PORTVERSION}"| ; \
        s|"/share/doc/yodl-doc"|"/share/doc/${PORTNAME}-${PORTVERSION}/doc"| ; \
        s|"gcc"|"${CC}"| ; \
        s|"g++"|"${CXX}"|' \
        ${WRKSRC}/INSTALL.im
    @${REINPLACE_CMD} -e 's|yodlconverters.1|yodlconverters.1.gz| ; \
        s|".1"|".1.gz"|' \
        ${WRKSRC}/icmake/install
    @${REINPLACE_CMD} -e 's|#!/usr/bin/icmake|#!${LOCALBASE}/bin/icmake| ; \
        s|"-O2 -Wall"|"-Wall ${CFLAGS}"|' \
        ${WRKSRC}/build
    @${REINPLACE_CMD} -e 's|sed |${LOCALBASE}/bin/gsed | ; \
        s|getopt |${LOCALBASE}/bin/getopt |' \
        ${WRKSRC}/scripts/configreplacements \
        ${WRKSRC}/scripts/yodl2whatever.in \
        ${WRKSRC}/scripts/yodlstriproff \
        ${WRKSRC}/macros/rawmacros/repairs

do-build:
    @cd ${WRKSRC} && ./build programs strip
    @cd ${WRKSRC} && ./build macros
    @cd ${WRKSRC} && ./build man
.if ${PORT_OPTIONS:MDOCS}
    @cd ${WRKSRC} && ./build manual
.endif

do-install:
    @cd ${WRKSRC} && ./build install programs ${STAGEDIR}
    @cd ${WRKSRC} && ./build install macros ${STAGEDIR}
    @cd ${WRKSRC} && ./build install man ${STAGEDIR}
.if ${PORT_OPTIONS:MDOCS}
    @cd ${WRKSRC} && ./build install manual ${STAGEDIR}
    @cd ${WRKSRC} && ./build install docs ${STAGEDIR}
.endif

.include <bsd.port.mk>