# New ports collection makefile for:	kyotocabinet-ruby
# Date created:		28 April 2010
# Whom:			Akinori MUSHA aka knu <knu@idaemons.org>
#
# $FreeBSD: ports/databases/ruby-kyotocabinet/Makefile,v 1.9 2010/12/12 04:56:43 pgollucci Exp $
#

PORTNAME=	kyotocabinet
PORTVERSION=	1.11
CATEGORIES=	databases ruby
MASTER_SITES=	http://fallabs.com/kyotocabinet/rubypkg/
PKGNAMEPREFIX=	${RUBY_PKGNAMEPREFIX}
DISTNAME=	${PORTNAME}-ruby-${PORTVERSION}
DIST_SUBDIR=	ruby

MAINTAINER=	knu@FreeBSD.org
COMMENT=	Ruby (1.9.1+) binding to Kyoto Cabinet

LIB_DEPENDS=	kyotocabinet.4:${PORTSDIR}/databases/kyotocabinet

BROKEN=	does not compile

RUBY_VER=	1.9
USE_RUBY=	yes
USE_RUBY_EXTCONF=	yes

NO_PACKAGE=	GPL3 incompatibility with Ruby

CONFIGURE_ARGS=	--with-kyotocabinet-dir="${LOCALBASE}" \
		--with-bindir="${LOCALBASE}/bin"

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 700042
BROKEN=		requires gcc 4.2+ and ruby built with the same compiler
.endif

PLIST_FILES=	%%RUBY_SITEARCHLIBDIR%%/kyotocabinet.so

.if !defined(NOPORTDOCS)
DOCSDIR=	${RUBY_MODDOCDIR}
PORTDOCS=	*
.endif
.if !defined(NOPORTEXAMPLES)
EXAMPLESDIR=	${RUBY_MODEXAMPLESDIR}
PORTEXAMPLES=	*
.endif

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR}/
.endif
.if !defined(NOPORTEXAMPLES)
	${MKDIR} ${EXAMPLESDIR}
	cd ${WRKSRC}/example && ${COPYTREE_SHARE} . ${EXAMPLESDIR}
.endif

check:
	cd ${BUILD_WRKSRC} && ${SETENV} RUBYLIB=. ${RUBY} test.rb

.include <bsd.port.post.mk>
