2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"). You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2017 Alexander Pyhalov
13 # Copyright 2018 Michal Nowak
14 # Copyright 2021 Andreas Grueninger, Grueninger GmbH, (grueni). All rights reserved.
15 # Copyright 2021 erwinlem
18 # if gcc11 is available use openssl 1.1 and remove OPENSSL* from BUILD_ARGS
24 include ..
/..
/..
/make-rules
/shared-macros.mk
26 COMPONENT_NAME
= mongodb
27 COMPONENT_MAJOR_VERSION
= 4.4
28 COMPONENT_MINOR_VERSION
= 15
29 COMPONENT_VERSION
= $(COMPONENT_MAJOR_VERSION
).
$(COMPONENT_MINOR_VERSION
)
30 COMPONENT_SUMMARY
= MongoDB distributed document-oriented database
31 COMPONENT_PROJECT_URL
= https
://www.mongodb.com
/
32 COMPONENT_FMRI
= database
/mongodb-44
33 COMPONENT_CLASSIFICATION
= System
/Databases
34 COMPONENT_SRC
= $(COMPONENT_NAME
)-src-r
$(COMPONENT_VERSION
)
35 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
36 COMPONENT_ARCHIVE_URL
= https
://fastdl.mongodb.org
/src
/$(COMPONENT_ARCHIVE
)
37 COMPONENT_ARCHIVE_HASH
= sha256
:fb7ef14e2539df0addc1e350ad2a0fdb7dd078a60d49ab15d9932f193ea1da33
38 COMPONENT_LICENSE
= SSPL
39 COMPONENT_LICENSE_FILE
= LICENSE-Community.txt
41 include $(WS_MAKE_RULES
)/common.mk
43 BUILD_DIR_TOOLS
= $(BUILD_DIR
)/tools
44 BUILD_TOOLS
= $(BUILD_DIR_TOOLS
)/.built
45 INSTALL_TOOLS
= $(BUILD_DIR_TOOLS
)/.installed
47 MONGO_PREFIX
=$(USRDIR
)/$(COMPONENT_NAME
)/$(COMPONENT_MAJOR_VERSION
)
51 GMAKE
= scons VERBOSE
=1
52 CORES
= $(shell psrinfo
-t
)
53 GOROOT
= $(shell go env | grep GOROOT | awk
-F
= '{ print $$2 }' | tr
-d
'"')
57 COMPONENT_BUILD_ARGS
+= LIBPATH
="$(OPENSSL_PREFIX)/lib/$(MACH64):$(USRLIBDIR.$(BITS))"
58 COMPONENT_BUILD_ARGS
+= CPPPATH
="$(OPENSSL_PREFIX)/include"
59 COMPONENT_BUILD_ARGS
+= DESTDIR
=$(PROTO_DIR
)
60 COMPONENT_BUILD_ARGS
+= PREFIX
=$(MONGO_PREFIX
)
61 COMPONENT_BUILD_ARGS
+= TARGET_ARCH
=x86_64
62 COMPONENT_BUILD_ARGS
+= CC
="$(CC)"
63 COMPONENT_BUILD_ARGS
+= CXX
="$(CXX)"
64 COMPONENT_BUILD_ARGS
+= CFLAGS
="$(CFLAGS)"
65 COMPONENT_BUILD_ARGS
+= CXXFLAGS
="$(CXXFLAGS) -fpermissive"
66 COMPONENT_BUILD_ARGS
+= LINKFLAGS
="$(LDFLAGS) -lkstat"
67 COMPONENT_BUILD_ARGS
+= AR
=/usr
/bin
/gar
68 COMPONENT_BUILD_ARGS
+= CCFLAGS
="-I$(USRINCDIR)/pcre -DSOLARIS"
69 COMPONENT_BUILD_ARGS
+= --js-engine
=mozjs
70 COMPONENT_BUILD_ARGS
+= --use-system-pcre
71 COMPONENT_BUILD_ARGS
+= --use-system-zlib
72 COMPONENT_BUILD_ARGS
+= --server-js
=on
73 COMPONENT_BUILD_ARGS
+= --ssl
74 COMPONENT_BUILD_ARGS
+= --release
75 COMPONENT_BUILD_ARGS
+= --disable-ggdb
76 COMPONENT_BUILD_ARGS
+= --disable-warnings-as-errors
77 COMPONENT_BUILD_ARGS
+= -j
$(CORES
)
79 COMPONENT_INSTALL_ARGS
= $(COMPONENT_BUILD_ARGS
)
81 COMPONENT_BUILD_TARGETS
= install-core
83 # just a dummy for scons
84 COMPONENT_INSTALL_TARGETS
= --version
88 TEST_SUITES
+= dur_jscore_passthrough
89 TEST_SUITES
+= jstestfuzz
90 TEST_SUITES
+= jstestfuzz_replication
91 TEST_SUITES
+= jstestfuzz_sharded
92 TEST_SUITES
+= replica_sets_jscore_passthrough
93 TEST_SUITES
+= unittests
95 # patches must be done before cloney
96 COMPONENT_PREP_ACTION
+= \
97 $(CP
) -r
$(COMPONENT_DIR
)/files
/mozjs-60
/solaris
$(SOURCE_DIR
)/src
/third_party
/mozjs-60
/platform
/x86_64
/; \
98 cd
$(SOURCE_DIR
)/src
/third_party
/mozjs-60
/extract
; \
99 $(GPATCH
) $(GPATCH_FLAGS
) < $(COMPONENT_DIR
)/files
/0-gc-memory.patch
; \
100 $(GPATCH
) $(GPATCH_FLAGS
) < $(COMPONENT_DIR
)/files
/0-old-configure.patch
; \
101 $(GPATCH
) $(GPATCH_FLAGS
) < $(COMPONENT_DIR
)/files
/0-wasm-WasmSignalHandlers.patch
;
103 COMPONENT_PRE_BUILD_ACTION
+= \
104 ($(PYTHON
) -m pip
install -r
$(@D
)/etc
/pip
/compile-requirements.txt
)
106 COMPONENT_POST_INSTALL_ACTION
+= ( \
107 $(MKDIR
) $(PROTO_DIR
)$(MONGO_PREFIX
)/man
/man1
; \
108 $(CP
) $(BUILD_DIR_64
)/debian
/*.1 $(PROTO_DIR
)$(MONGO_PREFIX
)/man
/man1
/; \
109 $(CP
) $(BUILD_DIR_64
)/debian
/mongo
{,d
,s
,ldap
,kerberos
}.1 $(PROTO_DIR
)$(MONGO_PREFIX
)/man
/man1
/; )
111 $(BUILD_TOOLS
): $(BUILD_64
)
112 ($(MKDIR
) $(BUILD_DIR_TOOLS
)/src
/github.com
/mongodb
; \
113 cd
$(BUILD_DIR_TOOLS
)/src
/github.com
/mongodb
; \
114 git clone https
://github.com
/mongodb
/mongo-tools
; \
116 git checkout
100.3.1; \
117 $(GPATCH
) $(GPATCH_FLAGS
) < $(COMPONENT_DIR
)/files
/13-mongotools.patch
; \
118 GOROOT
=$(GOROOT
) .
/make build
)
121 $(INSTALL_TOOLS
): $(BUILD_TOOLS
) $(INSTALL_64
)
122 $(MKDIR
) $(PROTO_DIR
)$(MONGO_PREFIX
)/bin
123 $(CP
) $(BUILD_DIR_TOOLS
)/src
/github.com
/mongodb
/mongo-tools
/bin
/* $(PROTO_DIR
)$(MONGO_PREFIX
)/bin
126 # A bit of magic to replace spaces with commas
129 space
:= $(empty
) $(empty
)
131 COMPONENT_TEST_CMD
= $(PYTHON
) buildscripts
/resmoke.py \
132 --continueOnFailure \
133 --dbpathPrefix
=/tmp
/db \
134 --suites
=$(subst $(space
),$(comma
),$(TEST_SUITES
))
136 COMPONENT_TEST_TARGETS
=
138 COMPONENT_TEST_TRANSFORMS
+= '-e "s/\[resmoke\][ -+0-9T:\.\-]*//"' \
139 '-e "s/\s\s*[0-9][0-9]*\.[0-9][0-9]* seconds/ SEC seconds/"' \
141 '-e "/Summary of all suites/,\\$$p"'
143 # Not strictly necessary
144 $(TEST_64
): $(INSTALL_64
) $(INSTALL_TOOLS
)
146 build
: $(BUILD_64
) $(BUILD_TOOLS
)
148 install: $(INSTALL_TOOLS
)
153 REQUIRED_PACKAGES
+= library
/python
/urllib3-39
156 REQUIRED_PACKAGES
+= developer
/gcc-10
157 REQUIRED_PACKAGES
+= developer
/build
/scons
158 REQUIRED_PACKAGES
+= developer
/golang
159 REQUIRED_PACKAGES
+= library
/python
/psutil
160 REQUIRED_PACKAGES
+= library
/python
/typing
162 # Auto-generated dependencies via `gmake GMAKE=gmake REQUIRED_PACKAGES`
163 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
164 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
165 REQUIRED_PACKAGES
+= SUNWcs
166 REQUIRED_PACKAGES
+= library
/security
/openssl
167 REQUIRED_PACKAGES
+= library
/pcre
168 REQUIRED_PACKAGES
+= library
/zlib
169 REQUIRED_PACKAGES
+= system
/library
170 REQUIRED_PACKAGES
+= system
/library
/boost
171 REQUIRED_PACKAGES
+= system
/library
/libpcap
172 REQUIRED_PACKAGES
+= system
/library
/math
173 REQUIRED_PACKAGES
+= web
/curl