# $MidnightBSD: trunk/x11/rxvt/Makefile 17531 2014-09-27 02:15:14Z laffer1 $
# $FreeBSD: ports/x11/rxvt/Makefile,v 1.61 2006/12/09 05:06:13 rafan Exp $
#
# If possible, please consider updating the simple ports/x11-clocks/rclock
# (and maybe ports/chinese/rxvt) when you upgrade rxvt.  These ports all use
# the same distfile.

PORTNAME=	rxvt
PORTVERSION=	2.6.4
PORTREVISION=	9
CATEGORIES+=	x11
MASTER_SITES=	SF

MAINTAINER=	ports@MidnightBSD.org
COMMENT=	Low memory usage xterm replacement that supports color

LICENSE=	gpl2

USE_XORG=	xpm
GNU_CONFIGURE=	yes

OPTIONS_DEFINE=		BIG5 GB GREEK HALF_SHADOW KANJI MENUBAR NEXT \
			TRANSPARENCY XGETDEFAULT XIM XTERM
BIG5_DESC=		Build with BIG5 support
GB_DESC=		Build with GB support
GREEK_DESC=		Build with greek keyboard support
HALF_SHADOW_DESC=	Build with half shadows support
KANJI_DESC=		Build with Kanji support
MENUBAR_DESC=		Build with menubar support
NEXT_DESC=		Build with NeXT scrollbar
TRANSPARENCY_DESC=	Build with transparency support
XGETDEFAULT_DESC=	Build with XGetDefault() support
XIM_DESC=		Build with XIM support
XTERM_DESC=		Build with Xterm scrollbar

CONFIGURE_ARGS=	--enable-ttygid \
		--with-xpm --enable-xpm-background \
		--with-xpm-includes=${LOCALBASE}/include/X11 \
		--with-xpm-library=${LOCALBASE}/lib
PLIST_FILES=	bin/rxvt man/man1/${PORTNAME}.1.gz

BIG5_CONFIGURE_ON=	--enable-big5
GB_CONFIGURE_ON=	--enable-gb
GREEK_CONFIGURE_ON=	--enable-greek
# enable half width/height shadows scrollbar
HALF_SHADOW_CONFIGURE_ON=	--enable-half-shadow
KANJI_CONFIGURE_ON=	--enable-kanji
MENUBAR_CONFIGURE_ON=	--enable-menubar
NEXT_CONFIGURE_ON=	--enable-next-scroll
TRANSPARENCY_CONFIGURE_ON=	--enable-transparency
# make resources checking via XGetDefault()
XGETDEFAULT_CONFIGURE_ON=	--enable-xgetdefault
# XIM (X Input Method) protocol support
XIM_CONFIGURE_ON=	--enable-xim
XTERM_CONFIGURE_ON=	--enable-xterm-scroll

.include <bsd.port.pre.mk>

# fails to build with new utmpx
.if ${OSVERSION} > 4015
CONFIGURE_ARGS+=	--disable-utmp --disable-wtmp
.else
CONFIGURE_ARGS+=	--enable-utmp --enable-wtmp
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|getpt()|posix_openpt(0)|' ${WRKSRC}/configure

post-install:
	@${CHMOD} 4711 ${PREFIX}/bin/rxvt

.include <bsd.port.post.mk>
