# Created by: ijliao
# $FreeBSD: tags/RELEASE_12_0_0/comms/gsmlib/Makefile 473851 2018-07-03 19:11:51Z amdmi3 $

PORTNAME=	gsmlib
PORTVERSION=	1.10
PORTREVISION=	8
CATEGORIES=	comms
MASTER_SITES=	DEBIAN
#TODO: examine the Debian patches, and changes in the Mandrake
#gsmlib-1.11-0.2mdv2007.0.src.rpm, for use in this port
DISTFILES=	gsmlib_1.10.orig.tar.gz

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Library to access GSM mobile phones through GSM modems

LICENSE=	LGPL20
LICENSE_FILE=	${WRKSRC}/COPYING

USES=		gmake libtool
USE_LDCONFIG=	yes
GNU_CONFIGURE=	yes
INSTALL_TARGET=	install-strip

CPPFLAGS+=	-DBROKEN_STRFTIME -DHAVE_DECL_GETOPT
LDFLAGS+=	-lpthread
CXXFLAGS+=	-Wno-c++11-narrowing

OPTIONS_DEFINE=	NLS
OPTIONS_SUB=	yes

NLS_USES=	gettext localbase:ldflags
NLS_CONFIGURE_ENABLE=	nls

post-patch:
	@${GREP} -lR "<malloc.h>" ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} -e \
		's|<malloc\.h>|<stdlib.h>|g'

.include <bsd.port.mk>
