# New ports collection makefile for:   aria
# Date created:        30 March 2001
# Whom:                Yukihiro Nakai <nakai@FreeBSD.org>
#
# $FreeBSD: ports/www/aria/Makefile,v 1.39 2011/12/28 07:03:22 linimon Exp $
#

PORTNAME=	aria
PORTVERSION=	1.0.0
PORTREVISION=	5
CATEGORIES=	www
MASTER_SITES=	SF/${PORTNAME}-rpm/Aria%20Sources/${PORTVERSION}-official

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Yet another download tool

MAKE_JOBS_SAFE=  yes

USE_BZIP2=	yes
.if !defined(WITHOUT_NLS)
USE_GETTEXT=	yes
PLIST_SUB+=	NLS=""
.else
CONFIGURE_ARGS+=	--disable-nls
PLIST_SUB+=	NLS="@comment "
.endif
USE_GNOME=	gtk12
USE_OPENSSL=	yes
USE_GMAKE=	yes
GNU_CONFIGURE=	yes
PORTDOCS=	README README.euc

CPPFLAGS+=	-I${LOCALBASE}/include -DHAVE_DECL_GETOPT
LDFLAGS+=	-L${LOCALBASE}/lib

post-extract:
	@${RM} -f ${WRKSRC}/src/getopt*

post-patch:
	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g ; \
		s|-lssl|-lcrypto -lssl|g ; \
		s|DATADIRNAME=lib|DATADIRNAME=share|g' ${WRKSRC}/configure
	@${REINPLACE_CMD} -e 's| -O2 -Wall | @CXXFLAGS@ |g ; \
		s|getopt.c getopt1.c getopt.h||g ; \
		s|getopt.o getopt1.o||g ; \
		s|\.deps/getopt.P ||g ; \
		s|\.deps/getopt1.P ||g' ${WRKSRC}/src/Makefile.in
	@${REINPLACE_CMD} -e 's| -O2 -Wall | @CXXFLAGS@ |g' \
		${WRKSRC}/src/Makefile.in
	@${REINPLACE_CMD} -e 's|"getopt.h"|<getopt.h>|g' \
		${WRKSRC}/src/main.cc

post-install:
.if !defined(NOPORTDOCS)
	@${INSTALL} -d ${DOCSDIR}
	@cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif

.include <bsd.port.pre.mk>

.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
BROKEN=		Does not compile on ia64, powerpc, or sparc64: just hangs
.endif

.include <bsd.port.post.mk>
