aboutsummaryrefslogtreecommitdiffstats
path: root/math/calctool/Makefile
blob: fa0f5ed66a48768a6bc24166ece951262fefdff7 (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
# Created by: nsayer@quack.kfu.com
# $FreeBSD$

PORTNAME=   calctool
PORTVERSION=    2.4.13
PORTREVISION=   5
CATEGORIES= math
MASTER_SITES=   LOCAL/nsayer
DISTNAME=   calctool-2.4pl13

MAINTAINER= ports@FreeBSD.org
COMMENT=    Multi-GUI (terminal, X, XView) calculator program

USE_LDCONFIG=   yes

OPTIONS_DEFINE= X11 TTY XVIEW
OPTIONS_DEFAULT=    X11 TTY
OPTIONS_SUB=    yes
X11_DESC=   Build X11 version of calctool
TTY_DESC=   Build tty version of calctool
XVIEW_DESC= Build tty version of calctool
TTY_USES=   ncurses

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MX11}
USE_XORG=   x11
BINARIES+=  xcalctool
.endif

.if ${PORT_OPTIONS:MTTY}
BINARIES+=  tty_calctool
.endif

.if ${PORT_OPTIONS:MXVIEW}
BINARIES+=  xv_calctool
LIB_DEPENDS+=   libxview.so:${PORTSDIR}/x11-toolkits/xview
.endif

.if ${ARCH} == "sparc64"
FPIC=   -fPIC
.else
FPIC=   -fpic
.endif

post-patch:
    @${REINPLACE_CMD}   -e "s#%%FPIC%%#${FPIC}#g" \
                -e "s#%%LOCALBASE%%#${LOCALBASE}#g" \
                -e "s#%%BINARIES%%#${BINARIES}#g" \
                -e "s#%%DATADIR%%#${DATADIR}#g" \
                -e 's|-ltermcap|$${LDFLAGS} -lncurses|g' \
                ${WRKSRC}/Makefile

do-install:
    ${MKDIR} ${STAGEDIR}${DATADIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/libcalctool.so.1 ${STAGEDIR}${PREFIX}/lib
    @(cd ${STAGEDIR}${PREFIX}/lib; ${LN} -sf libcalctool.so.1 libcalctool.so)
.for BIN in ${BINARIES}
    ${INSTALL_PROGRAM} ${WRKSRC}/${BIN} ${STAGEDIR}${PREFIX}/bin
.endfor
    ${INSTALL_MAN} ${WRKSRC}/calctool.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
    ${INSTALL_DATA} ${WRKSRC}/calctool.help ${STAGEDIR}${DATADIR}

.include <bsd.port.mk>