summaryrefslogtreecommitdiffstats
path: root/www/w3m/Makefile
blob: 63e690e449c43fa51d06c7ef1183e4c57ce27856 (plain)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# New ports collection makefile for:   w3m
# Date Created:			7 Oct 1999
# Whom:				MANTANI Nobutaka <nobutaka@nobutaka.com>
#
# $FreeBSD$
#

PORTNAME=	w3m
PORTVERSION=	0.5.3
PORTREVISION=	1
CATEGORIES+=	www ipv6
MASTER_SITES=	SF/w3m/w3m/w3m-${PORTVERSION}

MAINTAINER?=	nobutaka@FreeBSD.org
COMMENT?=	A pager/text-based WWW browser

USE_OPENSSL=	yes
LIB_DEPENDS=	gc.1:${PORTSDIR}/devel/boehm-gc

MAKE_JOBS_UNSAFE=	yes

CONFLICTS?=	ja-w3m-0.5.* ja-w3m-img-0.5.* w3m-m17n-0.5.* w3m-img-0.5.* w3m-m17n-img-0.5.*
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--with-gc=${LOCALBASE}

MAN1=		w3m.1 w3mman.1
MANLANG=	"" ja

DOCS=		FAQ.html HISTORY MANUAL.html README \
		README.dict README.func STORY.html keymap.default \
		keymap.lynx menu.default menu.submenu

.if !defined(MASTERDIR)
OPTIONS=	M17N "Multilingualization support" off \
		JAPANESE "Japanese messages and migemo support" off \
		INLINE_IMAGE "Inline image support" off \
		KEY_LYNX "Keymap like lynx browser" off

.include <bsd.port.options.mk>
.endif

.if defined(WITH_M17N)
CONFIGURE_ARGS+=	--enable-m17n
PLIST_SUB+=	M17N=""
.else
.if !defined(WITH_JAPANESE)
CONFIGURE_ARGS+=	--disable-m17n
PLIST_SUB+=	M17N="@comment "
.endif
.endif

.if defined(WITH_JAPANESE)
USE_GETTEXT=		yes
CONFIGURE_ARGS+=	--enable-m17n --enable-japanese=E --with-migemo=yes gt_cv_func_gnugettext1_libintl=yes
DOCS_JP=	${DOCS} README.SSL README.cookie README.keymap README.mailcap \
		README.menu README.migemo

PLIST_SUB+=	JAPANESE="" M17N=""
.else
CONFIGURE_ARGS+=	--disable-nls
PLIST_SUB+=	JAPANESE="@comment "
.endif

.if defined(WITH_INLINE_IMAGE)
USE_GNOME=	gtk20
CONFIGURE_ARGS+=	--with-imagelib=gtk2 --enable-image=fb,x11

DOCS+=		README.img
DOCS_JP+=	README.img
PLIST_SUB+=	INLINE_IMAGE=""

PKGMESSAGE=	${MASTERDIR}/pkg-message
.else
CONFIGURE_ARGS+=	--enable-image=no
PLIST_SUB+=	INLINE_IMAGE="@comment "

# Don't use pkg-message
PKGMESSAGE=	${NONEXISTENT}
.endif

.if defined(WITH_KEY_LYNX)
CONFIGURE_ARGS+=	--enable-keymap=lynx
.endif

CONFIGURE_ENV=	DEFS="-I${LOCALBASE}/include"

post-patch:
	@${REINPLACE_CMD} -e \
		's|\`\(expr\) \(.*\) : \(.*\)`|`\1 \\( \2 : \3 \\)`|' \
		-e 's|/usr/local|${LOCALBASE}|g' \
		${WRKSRC}/configure
	@${FIND} ${WRKSRC}/doc* -type f \! -name HISTORY \
		-exec ${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' {} +

post-install:
.if !defined(NOPORTDOCS)
.if defined(WITH_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; \
	${MKDIR} ${PREFIX}/share/doc/w3m/; \
	for i in ${DOCS} ; do \
		${INSTALL_DATA} $$i ${PREFIX}/share/doc/w3m/ ; \
	done
.if defined(WITH_M17N) || defined(WITH_JAPANESE)
	@${INSTALL_DATA} ${WRKSRC}/doc/README.m17n ${PREFIX}/share/doc/w3m
.endif
.endif
	@${INSTALL_MAN} ${WRKSRC}/scripts/w3mman/w3mman.1 ${PREFIX}/man/ja/man1
.if defined(WITH_INLINE_IMAGE)
	@${CAT} ${PKGMESSAGE}
.endif

.include <bsd.port.mk>
OpenPOWER on IntegriCloud