aboutsummaryrefslogtreecommitdiffstats
path: root/databases/mongodb32/Makefile
blob: f96aa6bcd182214e19a692f357ba5be91bf9dd58 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Created by: Brendan Molloy <brendan+freebsd@bbqsrc.net>
# $FreeBSD$

PORTNAME=   mongodb32
PORTVERSION=    3.2.4
DISTVERSIONPREFIX=  r
CATEGORIES= databases net
MASTER_SITES=   https://fastdl.mongodb.org/src/ \
        http://fastdl.mongodb.org/src/ \
        http://download.mongodb.org/src/
DISTNAME=   mongodb-src-${DISTVERSIONPREFIX}${PORTVERSION}

MAINTAINER= brendan+freebsd@bbqsrc.net
COMMENT=    Distributed document-oriented "NoSQL" database

# mongodb is AGPLv3, C++ driver is APACHE20
LICENSE=    AGPLv3 APACHE20
LICENSE_COMB=   multi

# Bugs when compiled with < Clang 3.7
#  - https://jira.mongodb.org/browse/SERVER-21217
#  - https://jira.mongodb.org/browse/SERVER-22740
BUILD_DEPENDS=  ${LOCALBASE}/bin/clang37:${PORTSDIR}/lang/clang37
LIB_DEPENDS=    libpcre.so:${PORTSDIR}/devel/pcre \
        libsnappy.so:${PORTSDIR}/archivers/snappy
TEST_DEPENDS=   ${PYTHON_PKGNAMEPREFIX}yaml>=3.11:${PORTSDIR}/devel/py-yaml \
        ${PYTHON_PKGNAMEPREFIX}pymongo>=3.0:${PORTSDIR}/databases/pymongo

CPP=    ${LOCALBASE}/bin/clang-cpp37
CC= ${LOCALBASE}/bin/clang37
CXX=    ${LOCALBASE}/bin/clang++37
CHOSEN_COMPILER_TYPE=   clang

ONLY_FOR_ARCHS= amd64
ONLY_FOR_ARCHS_REASON=  "Only supported on amd64 (i386 deprecated in v3)"

CONFLICTS_BUILD=    mongo-cxx-driver
OPTIONS_DEFINE=     SASL SSL
OPTIONS_DEFAULT=    SASL SSL

SASL_LIB_DEPENDS=   libsasl2.so:${PORTSDIR}/security/cyrus-sasl2
SASL_MAKE_ARGS=     --use-sasl-client

SSL_USE=    openssl=yes
SSL_MAKE_ARGS=  --ssl

USES=       cpe execinfo python:build scons

MAKE_ARGS=  --prefix=${STAGEDIR}${PREFIX} \
        --use-system-pcre --use-system-snappy \
        --release

USERS=  mongodb
GROUPS= mongodb

USE_RC_SUBR=    mongod

ALL_TARGET= core
TEST_TARGET=    unittests

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 1000000
# Cannot be built
IGNORE= unsupported on FreeBSD 9 or older
.endif

post-install:
.for f in mongo mongod mongoperf mongos mongosniff
    ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${f}
.endfor
    ${CP} ${WRKSRC}/rpm/mongod.conf ${STAGEDIR}${PREFIX}/etc/mongodb.conf.sample

do-test:
    @cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} \
        ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} ${TEST_TARGET} &&\
        ${PYTHON_CMD} ${BUILD_WRKSRC}/buildscripts/resmoke.py\
        --suites=unittests --jobs=${MAKE_JOBS_NUMBER}

PORTSCOUT=  limitw:1,even

CPE_PRODUCT=    mongodb

.include <bsd.port.post.mk>