aboutsummaryrefslogtreecommitdiffstats
path: root/www/w3m/Makefile
blob: da03df24cc45d51740db847f961c7b073200df24 (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
# New ports collection makefile for:   w3m
# Version required:     0.1.7
# Date Created:         7 Oct 1999
# Whom:             MANTANI Nobutaka <nobutaka@nobutaka.com>
#
# $FreeBSD$
#

DISTNAME=   w3m-${W3M_VER}
W3M_VER=    0.1.7
CATEGORIES?=    www ipv6
MASTER_SITES=   ftp://ei5nazha.yz.yamagata-u.ac.jp/w3m/dev/ \
        ftp://ftp.firedrake.org/w3m/dev/ \
        http://www.instinct.org/~pgl/w3m/dev/ \
        http://grilli.net/mirrors/w3m/download/dev/

MAINTAINER= nobutaka@nobutaka.com

RESTRICTED=     "Contains cryptography"

BUILD_DEPENDS=  ${LOCALBASE}/lib/libgc.a:${PORTSDIR}/devel/boehm-gc

WRKSRC=     ${WRKDIR}/w3m
MAN1=       w3m.1
MANLANG=    ""

TARGET=     ${WRKSRC}/config.h
DOCS=       FAQ.html HISTORY MANUAL.html README \
        README.dict README.func STORY.html keymap.default \
        keymap.lynx menu.default menu.submenu
SED_CMD=    -e "s,%%PREFIX%%,${PREFIX},g" \
        -e "s,%%LOCALBASE%%,${LOCALBASE},g"

.include <bsd.port.pre.mk>

.if ${OSVERSION} >= 400014
SED_CMD+=   -e "s,undef INET6,define INET6,g"
.endif

.if defined(JAPANESE)
SED_CMD+=   -e "s,undef JAPANESE,define JAPANESE,g" \
        -e "s,w3mhelp_en.html,w3mhelp_ja.html,g"
MANLANG+=   ja
DOCS_JP=    ${DOCS} HISTORY HISTORY.kokb README.keymap README.kokb \
        README.menu
.endif

.if defined(USE_SSL)
LIB_DEPENDS+=   crypto.1:${PORTSDIR}/security/openssl \
        ssl.1:${PORTSDIR}/security/openssl

SSL_CFLAGS= -I${LOCALBASE}/include/openssl
SSL_LIBS=   -lssl -lcrypto
.if defined(USA_RESIDENT) && ${USA_RESIDENT} == YES
EXTRA_SSL_LIBS= -lRSAglue -lrsaref
.endif

SED_CMD+=   -e "s,undef USE_SSL,define USE_SSL,g"
.endif

MAKE_FLAGS+=    DEFS="-I${LOCALBASE}/include ${SSL_CFLAGS}" \
        LIBS="-L${LOCALBASE}/lib ${SSL_LIBS} ${EXTRA_SSL_LIBS}"

post-configure:
    @${CP} ${TARGET} ${TARGET}.in
    @${SED} ${SED_CMD} < ${TARGET}.in > ${TARGET}

post-install:
.if !defined(NOPORTDOCS)
.if defined(JAPANESE)
    @${MKDIR} ${PREFIX}/share/doc/ja/w3m
    @(cd ${WRKSRC}/doc-jp; \
    for i in ${DOCS_JP} ; do \
        ${INSTALL_DATA} $$i ${PREFIX}/share/doc/ja/w3m/ ; \
    done)
.endif
    @(cd ${WRKSRC}/doc; \
    for i in ${DOCS} ; do \
        ${INSTALL_DATA} $$i ${PREFIX}/share/doc/w3m/ ; \
    done)
.endif
    @${INSTALL_MAN} ${WRKSRC}/doc/w3m.1 ${PREFIX}/man/man1
.if defined(JAPANESE)
    @${INSTALL_MAN} ${WRKSRC}/doc-jp/w3m.1 ${PREFIX}/man/ja/man1
.endif

.include <bsd.port.post.mk>