# Created by: Sergei Kolobov <sergei@kolobov.com>
# $FreeBSD: branches/RELENG_9_1_0/misc/getopt/Makefile 306204 2012-10-20 16:35:47Z eadler $

PORTNAME=	getopt
PORTVERSION=	1.1.4
PORTREVISION=	2
CATEGORIES=	misc
MASTER_SITES=	http://software.frodo.looijaard.name/getopt/files/

MAINTAINER=	eadler@FreeBSD.org
COMMENT=	A getopt(1) replacement that supports GNU-style long options

USE_GETTEXT=		yes
USE_GMAKE=		yes

CFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib -lintl
MAKE_ENV=	LIBCGETOPT=0

MAN1=		getopt.1
DOCS=		Changelog README

.include <bsd.port.options.mk>

post-patch:
	@${REINPLACE_CMD} -e 's|CC=gcc|CC=${CC}|' ${WRKSRC}/Makefile

.if ${PORT_OPTIONS:MDOCS}
post-install:
	@${MKDIR} ${DOCSDIR}
	@cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif

.include <bsd.port.mk>
