# $FreeBSD: head/sysutils/coreutils/Makefile 363756 2014-08-01 19:36:55Z pi $

PORTNAME=	md5sum
PORTVERSION=	8.23
CATEGORIES=	sysutils textproc
MASTER_SITES=	GNU

DISTNAME=	coreutils-8.23

MAINTAINER=	takachan@running-dog.net
COMMENT=	Free Software Foundation core utilities (md5sum and sha?sum)

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/COPYING

CONFLICTS=	idutils-[0-9]* coreutils-*

MAKE_JOBS_UNSAFE=	yes

GNU_CONFIGURE=	yes
# A rather nasty hack to stop gnustat from conflicting with base gstat
# bugs.freebsd.org/160060
CONFIGURE_ARGS=	--program-transform-name=s/stat/nustat/
CONFIGURE_ENV=	FORCE_UNSAFE_CONFIGURE=1
CPPFLAGS+=	-I${LOCALBASE}/include
LIBS+=		-L${LOCALBASE}/lib

USES=		gmake iconv perl5 charsetfix tar:xz
USE_PERL5=	build	# build - required for tests and man page generation
USE_LDCONFIG=	yes

INFO=		coreutils

OPTIONS_DEFINE=	GMP NLS
OPTIONS_DEFAULT=NLS
OPTIONS_SUB=	yes
NLS_USES=	gettext
NLS_CONFIGURE_ENABLE=   nls
GMP_LIB_DEPENDS=	libgmp.so:${PORTSDIR}/math/gmp
GMP_CONFIGURE_WITH=	gmp

.include <bsd.port.options.mk>

.if ${OSVERSION} >= 800039
EXTRA_PATCHES=	${PATCHDIR}/extra-patch-stty.c
.endif

post-build:
	@${TOUCH} ${WRKSRC}/doc/coreutils.info

post-install:
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/md5sum \
		${STAGEDIR}${PREFIX}/bin/sha* \
		${STAGEDIR}${PREFIX}/libexec/coreutils/libstdbuf.so

#regression-test: build
#	(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} check)

.include <bsd.port.mk>
