# $MidnightBSD: trunk/comms/libimobiledevice/Makefile 17218 2014-09-15 03:11:43Z laffer1 $

PORTNAME=	libimobiledevice
PORTVERSION=	1.1.5
PORTREVISION?=	0
CATEGORIES?=	comms
MASTER_SITES=	http://www.${PORTNAME}.org/downloads/

MAINTAINER?=	ports@MidnightBSD.org
COMMENT?=	Library to communicate with Apple iOS devices

LICENSE?=	lgpl2.1

SLAVE_PORT?=	no

USES=		pkgconfig tar:bzip2
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	openssl_LIBS=-lssl
CFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

.if ${SLAVE_PORT} == "no"

LIB_DEPENDS=	gnutls:${PORTSDIR}/security/gnutls \
		tasn1:${PORTSDIR}/security/libtasn1 \
		gcrypt:${PORTSDIR}/security/libgcrypt \
		plist:${PORTSDIR}/devel/libplist \
		usbmuxd:${PORTSDIR}/comms/usbmuxd

USE_GNOME=	glib20
CONFIGURE_ARGS+=--without-cython
USE_CSTD=	gnu89
USE_LDCONFIG=	yes

PORTDOCS=	AUTHORS NEWS README

.include <bsd.mport.options.mk>

post-patch:
	@${REINPLACE_CMD} -e 's, *@ssl_requires@,,' \
		${WRKSRC}/${PORTNAME}*.pc.in
	@${REINPLACE_CMD} -e 's,$$(libdir)/pkgconfig,${PREFIX}/libdata/pkgconfig,g' \
		${WRKSRC}/Makefile.in

post-install:
.if ${PORT_OPTIONS:MDOCS}
	@${MKDIR} ${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}
.endif

.endif # ${SLAVE_PORT} == "no"

.include <bsd.port.mk>
