Overview

Request 5247 (accepted)

MongoDB is removed from official repository since it changed license to SSPL, which forbid Amazon and Microsoft to use MongoDB in cloud platform.

Submit package home:guoyunhe / mongodb to package Extra / mongodb

mongodb.changes Added
x
 
1
@@ -0,0 +1,869 @@
2
+-------------------------------------------------------------------
3
+Thu Jan  9 22:23:46 UTC 2020 - Jan Zerebecki <jzerebecki@suse.com>
4
+
5
+- This is now unmantained as it is not possible to comply with upstreams new
6
+  license for later versions (SSPL 1.0) on most hardware.
7
+- BuildRequire libboost_system to fix build
8
+- Add patch to fix build failure with newer OpenSSL
9
+- Add patch to fix abi not declared error (problem wasn't there yet with Leap
10
+  15.2)
11
+
12
+-------------------------------------------------------------------
13
+Sun Jan 20 20:03:32 UTC 2019 - astieger@suse.com
14
+
15
+- mongodb 3.6.8 (the last version licensed under AGPL-3.0):
16
+  * Fix tailable cursor fail on getMore against a sharded cluster
17
+  * Fix incorrect result from covered index with collated field
18
+    when collation not involved in match or sort
19
+  * Fix failure to drop a collection with long index names via
20
+    rename under MMAPv1
21
+  * Fix privileges on setFCV virtual namespace.
22
+- includes changes from 3.6.7:
23
+  * Use batch insert when migrating chunks
24
+  * Fix error on aggregation with $out when Auditing is enabled
25
+  * Fix mongoreplay tool thar always replayed to secondary  
26
+- includes changes from 3.6.6:
27
+  * Fix UUIDCatalog inconsistencies when using mapReduce “replace”
28
+    on a sharded output collection
29
+  * Add syncSourceHost field to replSetGetStatus output
30
+- includes changes from 3.6.5:
31
+  * Fis segmentation fault when shard is started with --shardsvr
32
+    before being added to a shard
33
+  * Fix collMod interruption may cause invariant failure
34
+  * Fix server crash on $changeStream with invalid resume token
35
+- includes changes from 3.6.4:
36
+  * Add sharding metadata refresh metrics section to serverStatus.
37
+  * Fix segmentation fault converting ReplicaSet to Replicated
38
+    Shard Cluster
39
+  * Fix 3.6 drivers failing to communicate with 3.6 sharded
40
+    clusters running at FCV 3.4.
41
+  * SLES11 support removed
42
+  * Fix currentOp output no longer returning threadId field
43
+- includes changes from 3.6.3:
44
+  * fix mongod crash on find with index and nested $and/$or.
45
+  * fix CappedPositionLost failure when tailing oplog on secondary
46
+  * fix "address already in use" when using --bind_ip localhost
47
+- add mongodb-3.6.8-fix-syntax.patch fixing syntax in build scripts
48
+- change mongo-src-3.6.2-python3.patch to
49
+  mongo-src-3.6.8-python3.patch to include more python 3 fixes,
50
+  including those only triggered when building with system libs
51
+- Build with the system versions of the following libraries:
52
+  boost, pcre, snappy, yaml, zlib
53
+
54
+-------------------------------------------------------------------
55
+Wed Jun  6 12:35:26 UTC 2018 - mpluskal@suse.com
56
+
57
+- Remove useless comment
58
+
59
+-------------------------------------------------------------------
60
+Mon Apr  9 08:24:22 UTC 2018 - mardnh@gmx.de
61
+
62
+- Adjust gcc-c++ BuildRequires. Leap15/SLE15 don't ship gcc6
63
+- Run spec-cleaner
64
+
65
+-------------------------------------------------------------------
66
+Fri Apr 06 00:06:49 UTC 2018 - boris@steki.net
67
+
68
+- re-enable wiredtiger backend on aarch64 (bnc#1087307)
69
+
70
+-------------------------------------------------------------------
71
+Fri Mar 30 11:34:49 UTC 2018 - boris@steki.net
72
+
73
+- enable mmapv1 build on non x86_64 architectures (bnc#1087307)
74
+
75
+-------------------------------------------------------------------
76
+Fri Feb 23 03:40:49 UTC 2018 - jacobwinski@gmail.com
77
+
78
+- Update to version 3.6.2:
79
+  * Security
80
+    + The contents of {USER} needs to be escaped when querying for the groups using LDAP server
81
+  * Sharding
82
+    + Cleanup mongos write commands execution
83
+    + Shard does not call config commit chunk migration command with majority writeConcern nor checks for writeConcern errors.
84
+    + Do not clear the cached sharding filtering information on replication state changes
85
+    + UUIDs may be absent from shard secondary local collections
86
+    + Remove CatalogCache retrieval methods, which take StringData
87
+    + Requiring replSet for shards breaks Queryable Backup
88
+  * Replication
89
+    + Remove TopologyCoordinator interface
90
+    + CollectionCloner fails if collection is dropped between getMore calls
91
+    + QueryPlanKilled (operation exceeded time limit) in $changeStream with updateLookup
92
+    + Clarify the reason temporary unique collection names are made
93
+    + Disallow operations on drop-pending collections through applyOps
94
+    + initial_sync_drop_collection.js should wait for system to stablize after restarting node
95
+    + Disable chaining in initial_sync_drop_collection.js
96
+  * Aggregation
97
+    + Aggregation text search returns text score even if it wasn’t requested when targeting multiple shards in a sharded cluster
98
+    + DocumentSourceSort sorts array documents incorrectly if there is a non-simple collation
99
+  * Storage
100
+    + Libraries db/db_raii and db/s/sharding are directly cyclic
101
+    + Always log renameCollections in our tests
102
+    + Fix race in CompatibleFirstStress lock manager test
103
+    + Remove IndexObserver
104
+  * Operations
105
+    + mongo shell failed to connect with 3.6 connection string SRV
106
+  * Build and Packaging
107
+    + Fix long link times on OS X by passing -no_deduplicate to the linker
108
+    + MongoDB msi installer for Compass contains a typo
109
+  * Internals
110
+    + check that oplogTruncateAfterPoint is correct in PeriodicKillSecondaries hook
111
+    + Reduce the number of iterations for the toggle_feature_compatibility.js workload
112
+    + Add additional unittesting for CompatibleFirst policy
113
+    + Powercycle - remove mongod.lock file for MMAPV1 test
114
+    + Avoid dropping lock before cleaning up DocumentSourceCursor’s PlanExecutor
115
+    + PID file permission on v3.6 make it not not monitorable using pid file
116
+    + implicitly_retry_on_database_drop_pending.js calls tojson() inside of a loop
117
+    + Disable the sharding Evergreen task on the Enterprise OS X 10.10 MMAPv1 builder
118
+- Include changes from 3.6.1:
119
+  * Sharding
120
+    + Invariant failure on config server when inserting tag into config.tags
121
+    + Force the recipient shard to refresh its metadata after migration commit
122
+    + Primary queries using maxTimeMS cause temporary shard write unavailability if ExceededTimeLimit
123
+    + Remove all usages of the default constructor of ScopedCollectionMetadata outside of MetadataManager
124
+    + ShardingTest.checkUUIDsConsistentAcrossCluster can fail to see collection in config.cache.collections
125
+    + setFCV on config server should only generate UUIDs for non-dropped sharded collections
126
+    + A migration will simply report “Data transfer error” when we have rich error details on the destination shard that are logged but not returned to the user
127
+    + Disallow users from creating new indexes in config.transactions
128
+    + Improve multi thread performance for retryable writes
129
+    + Enable sign range optimization for clusterTime
130
+    + ShardingCatalogManager::getDatabasesForShard should check if query was successful
131
+    + Mongos crashes on bulk inserts which size are slightly bigger than maxBsonObjectSize
132
+    + “CommandNotFound: no such command” in mongodb logs on 3.6
133
+  * Replication
134
+    + Cancel catchup takeover if primary caught up according to heartbeats
135
+    + Rollback can abort on long collection names.
136
+    + $changeStream reports incorrect documentKey for unsharded collections that become sharded
137
+    + Delete unused rollback code
138
+    + ChangeStreams lookup_post_image.js test makes assumptions that don’t hold up in secondary read passthrough
139
+    + fix typo in sync_tail.cpp fillWriterVectorsAndLastestSessionRecords()
140
+    + do a second majority write on oldPrimary before committed read in read_committed_after_rollback.js
141
+    + Do not use IDL on oldest oplog entry
142
+  * Query
143
+    + Add an invariant that DocumentSourceCloseCursor does not execute on a mongod for a sharded $changeStream
144
+    + Arrays of certain NumberDecimals can trigger an invariant failure
145
+    + $rename does not update value if existing “to” field has the same numeric value but different type.
146
+    + Add deprecation warning to “snapshot” option on queries
147
+  * Write Operations
148
+    + Deprecate $atomic/isolated update option
149
+    + Updates using a numeric path component may cause index entries not to be created
150
+  * Aggregation
151
+    + Test that mongos accepts a –timeZoneInfo parameter, and can correctly execute expressions using time zones
152
+    + changeStream cursor is not returned on a mongos when the database does not exist.
153
+  * Storage
154
+    + remove SnapshotName class
155
+    + Test that applyOps can clone admin.system.version preserving its UUID
156
+    + return error if collMod provides a UUID that does not match the UUID of the collection specified
157
+    + allow enableMajorityReadConcern=false to work
158
+    + applyOps view creation should not assign UUID
159
+    + oldest_timestamp should track the last applied time, during initial sync
160
+  * Operations
161
+    + Disallow removing the featureCompatibilityVersion document
162
+  * Build and Packaging
163
+    + install_compass experience on OSX needs improvement
164
+    + Remove Type=forking from Debian SystemD service file
165
+  * Tools
166
+    + qa-dump-restore-archiving oplog_rollover_test.js
167
+  * Internals
168
+    + system_perf.yml: Use new DSI interface and cleanup
169
+    + Add a version of retryable_writes_jscore_passthrough.yml with stepdowns
170
+    + The mongod process forks before listening for connections
171
+    + Bring BSONObj parsers back for IDL generated commands
172
+    + UUIDs should be added to local collections for replica sets only on clean startup
173
+    + HostAndPort for replSetInitiate() no longer finds hostname for localhost
174
+    + WT performance regression with write retryability enabled
175
+    + applyOps command with UUID containing op must require granular privileges
176
+    + explain3.js should assert that its writes succeed
177
+    + Improve signal given by list_local_sessions.js
178
+    + Run test stage of sys-perf and mongo-perf failures should lead to red evergreen boxes
179
+    + Require shard servers and config servers to be started with –replSet or ‘replSetName’
180
+    + Migration of txn oplog entries can trigger fassert in secondary replication
181
+    + Shell SRV implementation does not allow authSource from TXT records to be used
182
+    + Revert erroneous high error codes
183
+    + Evergreen tests broken in master
184
+    + Implement Initial DNS Seedlist discovery spec
185
+    + build.sh script doesn’t abort on error
186
+    + qa-tests-unstable force_table_scan.js
187
+    + qa-tests-unstable no_primary_error_code.js
188
+    + qa-tests-unstable no_sharded_secondary_reads.js
189
+    + Make sure eviction visits all trees
190
+    + Cursor remove operation unpins page too early
191
+    + Transactions with timestamps should read their writes
192
+- Rebase existing python3 patch so it applies cleanly to 3.6.2:
193
+  mongo-src-3.6.2-python3.patch
194
+
195
+-------------------------------------------------------------------
196
+Thu Feb 22 17:07:27 UTC 2018 - jacobwinski@gmail.com
197
+
198
+- Remove mongo-tools files, it is a seperate project
199
+  here & upstream since 2015.
200
+- Update _constraints make hardware memory 8G, fixes compile failure
201
+
202
+-------------------------------------------------------------------
203
+Mon Dec 25 09:21:49 UTC 2017 - boris@steki.net
204
+
205
+- on "older (supported...)" distribution scons is too old,
206
+  use bundled version to make it build correct
207
+
208
+-------------------------------------------------------------------
209
+Fri Dec 22 20:56:16 UTC 2017 - boris@steki.net
210
+
211
+- updated to release 3.6.0 
212
+
213
+-------------------------------------------------------------------
214
+Tue Dec  5 00:21:10 UTC 2017 - boris@steki.net
215
+
216
+- initial python3 port 
217
+
218
+-------------------------------------------------------------------
219
+Thu Nov 16 10:04:35 UTC 2017 - fcrozat@suse.com
220
+
221
+- Add TasksMax and TasksAccounting to systemd service, based on
222
+  upstream recommendation.
223
+
224
+-------------------------------------------------------------------
225
+Mon Nov 13 16:03:39 UTC 2017 - fcrozat@suse.com
226
+
227
+- Add tmpfiles file to create /var/run/mongodb at startup and use
228
+  this directory to store PID file created by mongodb server. This
229
+  ensure systemd forking monitor works as designed.
230
+
231
+-------------------------------------------------------------------
232
+Wed Nov  1 19:41:56 UTC 2017 - astieger@suse.com
233
+
234
+- MongoDB 3.4.10:
235
+  * The networkMessageCompressors configuration setting (aka wire
236
+    protocol compression), which is disabled by default, exposed a
237
+    vulnerability when enabled that could be exploited by a
238
+    malicious attacker to deny service or modify memory.
239
+    CVE-2017-15535 bsc#1065956
240
+  * Avoid G_X lock for rename_collection within database
241
+  * View with collation doesn’t work as expected in sharded cluster
242
+  * Calling shardCollection after enableSharding may fail if
243
+    executed against different mongos
244
+- includes changes from 3.4.9:
245
+  * Sharding an existing small collection results in large number
246
+    of chunks
247
+  * Reduce calls to allocator for large $in expressions
248
+  * RangeDeleter holds WT transaction open while waiting for
249
+    majority
250
+  * Range deleter assert failed because of replication lag
251
+- includes changes from 3.4.7:
252
+  * BSON Document Size can be exceeded when grouping inserts on
253
+    SECONDARY nodes
254
+  * Enable configuration of OpenSSL cipher suite via setParameter
255
+  * Optimize incremental update performance of ChunkManager and
256
+    CollectionMetadata
257
+- includes changrs from 3.4.6:
258
+  * Only close idle cached cursors on the WiredTiger ident that
259
+    is busy.
260
+  * $geoWithin in aggregation pipeline after $lookup and $unwind
261
+    returns incorrect results.
262
+  * Cursor opens should never block for the duration of a checkpoint.
263
+- includes changes from 3.4.5:
264
+  * Multikey indexes should not be eligible for DISTINCT_SCAN if
265
+    distinct key is an array component.
266
+  * GlobalLock with timeout can still block indefinitely.
267
+  * mongos can segfault in getMore on views with find batchSize of
268
+    0.
269
+- includes changes from 3.4.4:
270
+  * Add an aggregation operator $objectToArray to convert an object
271
+    to an array of key, value pairs.
272
+  * Add an aggregation operator $arrayToObject to convert an array
273
+    of pairs to an object.
274
+  * ChunkManager refresh can occasionally cause a full reload.
275
+
276
+-------------------------------------------------------------------
277
+Wed Apr 26 09:21:18 UTC 2017 - idonmez@suse.com
278
+
279
+- Use gcc6 on SLE >= 12SP2 and enable s390x port 
280
+
281
+-------------------------------------------------------------------
282
+Fri Apr  7 21:11:10 UTC 2017 - jengelh@inai.de
283
+
284
+- Replace buzzword-rich description by something meaningful.
285
+- Drop unused -devel subpackage.
286
+
287
+-------------------------------------------------------------------
288
+Thu Apr  6 08:44:32 UTC 2017 - guoyunhebrave@gmail.com
289
+
290
+- Exclude i586 build architecture.
291
+
292
+-------------------------------------------------------------------
293
+Wed Mar 29 22:52:07 UTC 2017 - guoyunhebrave@gmail.com
294
+
295
+- Update to version 3.4.3. Change log at https://docs.mongodb.com/manual/release-notes/3.4-changelog/
296
+
297
+-------------------------------------------------------------------
298
+Mon Dec 12 02:44:42 UTC 2016 - plinnell@opensuse.org
299
+
300
+- update to 3.2.11
301
+  + detailed change log:
302
+  https://docs.mongodb.com/manual/release-notes/3.2-changelog
303
+
304
+-------------------------------------------------------------------
305
+Thu Dec  1 03:34:13 UTC 2016 - plinnell@suse.com
306
+
307
+- add  Requires:  shadow - fixes build on SuseStudio
308
+
309
+-------------------------------------------------------------------
310
+Sat Sep 17 17:19:36 UTC 2016 - rpm@fthiessen.de
311
+
312
+- spec file cleanup
313
+- Update to version 3.2.9
314
+
315
+-------------------------------------------------------------------
316
+Sat Jun  4 04:55:07 UTC 2016 - jacobwinski@gmail.com
317
+
318
+- Update to version 3.0.12:
319
+  * Background index build may result in extra index key entries that do not correspond to indexed documents: SERVER-22970
320
+  * Documents that contain embedded null characters can be created: SERVER-7005
321
+  * IX GlobalLock being held while waiting for WiredTiger cache eviction: SERVER-22964
322
+- Update to version 3.0.11:
323
+  * For MongoDB 3.0.9 and MongoDB 3.0.10, during chunk migration, insert and update operations to documents in the migrating chunk are not reflected in the destination shard: SERVER-23425
324
+- Update to version 3.0.10:
325
+  * Read preference of secondaryPreferred can end up using unversioned connections: SERVER-18671
326
+  * For MMAPv1 journaling, the “last sequence number” file (lsn file) may be ahead of what is synced to the data files: SERVER-22261.
327
+  * Data size change for oplog deletes can overflow 32-bit int: SERVER-22634
328
+  * High fragmentation on WiredTiger databases under write workloads: SERVER-22898.
329
+- Update to version 3.0.9:
330
+  * Queries which specify sort and batch size can return results out of order if documents are concurrently updated. SERVER-19996
331
+  * Large amounts of create and drop collections can cause listDatabases to be slow under WiredTiger. SERVER-20961
332
+  * Authentication failure message includes server IP address instead of the client IP address. SERVER-22054
333
+- Updates to version 3.0.8:
334
+  * findAndModify on mongos can upsert to the wrong shard. SERVER-20407.
335
+  * WiredTiger commit visibility caused document not found. SERVER-21275.
336
+  * The oplog can grow to 3x configured size. SERVER-21553
337
+- Updates to version 3.0.7:
338
+  * WiredTiger memory handling and performance issues: SERVER-20159, SERVER-20204, SERVER-20091, and SERVER-20176.
339
+  * Reconfig during a pending step down may prevent a primary from stepping down: SERVER-20262.
340
+  * Built-in roles requires additional privileges: SERVER-19131, SERVER-15893, and SERVER-13647.
341
+- Updates to version 3.0.6:
342
+  * WiredTiger Stability issues: SERVER-19751, SERVER-19673, and SERVER-19573.
343
+  * Interaction between SSL and Auditing: SERVER-19538.
344
+  * Aggregation $sort on sharded systems SERVER-19464.
345
+- Update requirements to reflect upstream.
346
+- Add proper Source file with URL.
347
+- Cleanup spec file.
348
+
349
+-------------------------------------------------------------------
350
+Tue Aug  4 19:26:48 UTC 2015 - jacobwinski@gmail.com
351
+
352
+- Update to version 3.0.5.
353
+- Drop mongodb-ssl-FIPS_mode_set.patch: fixed upstream.
354
+- Drop most of mongo-tools, they are not a seperate project.
355
+- Update spec file to reflect build, compilation and package requirements.
356
+- Update mongodb.conf file to reflect new filetype:
357
+  * all existing defaults were ported over to the new mongodb.conf
358
+  * mongodb.conf file was based on the default upstream
359
+  * old style conf file is still supported by MongoDB 3.0.5, 
360
+    but migration is recommended.
361
+- Drop mongodb-2.4.11-ppc_patch_based_on_mongo_ibmsoe.patch due to incompatibilities:
362
+  * MongoDB now uses the new WiredTiger storage engine. Newest IBM Power8 (PPC) patch:
363
+    1) has not been updated for MongoDB 3.0.5
364
+   2) pre-dates WiredTiger support
365
+   3) upstream has already started to incorporate PPC64 support based on the IBM patchset
366
+  * Therefore, to avoid major issues like data corruption and conflicts resulting from
367
+    upstream already incorporating partial PPC64 supprt, this patch set has been dropped.
368
+  * PPC64 is enabled using upstream code.
369
+  * WARNING: quoting upstream: "Please note that MongoDB does no testing on Power8
370
+    at this time, so this is definitely not a supported configuration."
371
+- Drop mongodb-src-r2.4.12-no-werror.patch: no longer applies.
372
+- Drop mongodb_2_4_10_add_js_engine_v8_3_14_option.patch: no longer valid
373
+  as upstream now provides its own newer version of v8_3.XX
374
+- Drop mongodb_2_4_10_import_v8_3_14_5_JS2C_Python_scripts.patch: no longer valid
375
+  as upstream now provides its own Python scripts matching provided v8_3.XX
376
+- Drop mongodb_2_4_10_update_v8_3_14_SConscript_for_ppc.patch: v8_3.14 no longer used.
377
+- Enable WiredTiger on supported architectures:
378
+  * quoting upstream: "WiredTiger as embedded in the MongoDB source tree
379
+    does not currently support PPC64."
380
+- Use upstream gperftool when possible:
381
+  * "Changed in version 3.0.0: MongoDB uses a customized built-in version of tcmalloc 
382
+    to achieve significant performance gains. Building with --use-system-tcmalloc
383
+    produces binaries that lack these performance gains."
384
+- Update "ulimit" settings to recommended upstream in sysv & systemd files
385
+
386
+-------------------------------------------------------------------
387
+Wed Jun 24 11:51:05 UTC 2015 - aplanas@suse.com
388
+
389
+- Update to mongodb-2.4.14
390
+  * Init script sets process ulimit to different value compared to
391
+    documentation SERVER-17780
392
+  * Compute BinData length in v8 SERVER-17647
393
+  * Upgrade PCRE Version from 8.30 to Latest SERVER-17252
394
+
395
+-------------------------------------------------------------------
396
+Sun Jun 21 11:47:24 UTC 2015 - bwiedemann@suse.com
397
+
398
+- Enable IPv6 in default config (bnc#930566)
399
+
400
+-------------------------------------------------------------------
401
+Thu May 21 08:37:51 UTC 2015 - aplanas@suse.com
402
+
403
+- Remove `void_return.patch`
404
+  * This patch is used only in SLE11 because a boost problem. Now
405
+    mongodb is using a local copy of boost.
406
+  * Also this patch avoid the deletion and repair of the database
407
+    (bnc#738050)
408
+
409
+-------------------------------------------------------------------
410
+Wed Mar 04 09:00:00 UTC 2015 - Led <ledest@gmail.com>
411
+
412
+- update patches:
413
+  * mongodb-2.4.11-ppc_patch_based_on_mongo_ibmsoe.patch
414
+
415
+-------------------------------------------------------------------
416
+Tue Mar 03 13:52:00 UTC 2015 - Led <ledest@gmail.com>
417
+
418
+- update version 2.4.13:
419
+  * Security: Enforce BSON BinData length validation (SERVER-17278)
420
+  * Security: Disable SSLv3 ciphers (SERVER-15673)
421
+  * Networking: Improve BSON validation (SERVER-17264)
422
+    (bnc#921759, CVE-2015-1609)
423
+
424
+-------------------------------------------------------------------
425
+Mon Mar 02 19:23:00 UTC 2015 - Led <ledest@gmail.com>
426
+
427
+- fix typo in changelog
428
+
429
+-------------------------------------------------------------------
430
+Sun Mar 01 01:30:00 UTC 2015 - Led <ledest@gmail.com>
431
+
432
+- fix typo is spec
433
+
434
+-------------------------------------------------------------------
435
+Sat Feb 28 23:30:00 UTC 2015 - Led <ledest@gmail.com>
436
+
437
+- Use systemd for openSUSE > 12.2
438
+
439
+-------------------------------------------------------------------
440
+Wed Feb 25 15:27:00 UTC 2015 - Led <ledest@gmail.com>
441
+
442
+- update version 2.4.12
443
+- 2.4.12:
444
+  * Sharding: Sharded connection cleanup on setup error can crash mongos
445
+  * Sharding: "type 7" (OID) error when acquiring distributed lock
446
+    for first time
447
+  * Storage: explicitly zero .ns files on creation
448
+  * Storage: partially written journal last section causes recovery to fail
449
+- 2.4.11:
450
+  * Indexes: Fixed issue that can cause index corruption when building
451
+    indexes concurrently
452
+  * Indexes: Fixed issue that can cause index corruption when shutting
453
+    down secondary node during index build
454
+  * Indexes: Mongod now recognizes incompatible "future" text and geo
455
+    index versions and exits gracefully
456
+  * Indexes: Fixed issue that can cause secondaries to fail replication
457
+    when building the same index multiple times concurrently
458
+  * Indexes: Fixed issue that can cause index corruption on the tenth
459
+    index in a collection if the index build fails
460
+  * Indexes: Introduced versioning for text and geo indexes to ensure
461
+    backwards compatibility
462
+  * Indexes: Disallowed building indexes on the system.indexes
463
+    collection, which can lead to initial sync failure on secondaries
464
+  * Sharding: Avoid frequent immediate balancer retries when config
465
+    servers are out of sync
466
+  * Sharding: Add indexes to locks collection on config servers to
467
+    avoid long queries in case of large numbers of collections
468
+  * Sharding: Fixed issue that can corrupt the config metadata cache
469
+    when sharding collections concurrently
470
+  * Sharding: Don’t move chunks created on collections with a hashed
471
+    shard key if the collection already contains data
472
+  * Replication: Fixed issue where node appears to be down in a replica
473
+    set during a compact operation
474
+  * Replication: Fixed issue that could cause delays in elections
475
+    when a node is not vetoing an election
476
+  * Replication: Step down all primaries if multiple primaries are
477
+    detected in replica set to ensure correct election result
478
+  * Replication: Upon clock skew detection, secondaries will switch
479
+    to sync directly from the primary to avoid sync cycles
480
+  * Runtime: The SIGXCPU signal is now caught and mongod writes a log
481
+    message and exits gracefully
482
+  * Runtime: Fixed issue where mongod fails to start on Linux when
483
+    /sys/dev/block directory is not readable
484
+  * GridFS: Chunk size is decreased to 255 KB (from 256 KB) to avoid
485
+    overhead with usePowerOf2Sizes option
486
+  * SNMP: Fixed MIB file validation under smilint
487
+  * Shell: Fixed issue in V8 memory allocation that could cause
488
+    long-running shell commands to crash
489
+  * Shell: Fixed memory leak in the md5sumFile shell utility method
490
+- remove patches:
491
+  * mongodb-no-werror.patch
492
+- add patches:
493
+  * mongodb-src-r2.4.12-no-werror.patch
494
+
495
+-------------------------------------------------------------------
496
+Wed Feb 11 08:48:23 UTC 2015 - normand@linux.vnet.ibm.com
497
+- Add V8 3.14 in src/third_part/v8-3.14 used for opensuse >=13.2
498
+- Add PowerPC specific patches based on two git trees:
499
+  (only for ppc64 and ppc64le, not ppc)
500
+    * https://github.com/ibmsoe/mongo
501
+    * https://github.com/andrewlow/v8ppc
502
+
503
+-------------------------------------------------------------------
504
+Mon May  5 14:57:49 UTC 2014 - bwiedemann@suse.com
505
+
506
+- avoid hitting virtual memory limits with mmaps (bnc#876326)
507
+
508
+-------------------------------------------------------------------
509
+Mon Apr 21 02:48:56 UTC 2014 - i@marguerite.su
510
+
511
+- update version 2.4.10
512
+  * Performs fast file allocation on Windows when available
513
+  * Start elections if more than one primary is detected
514
+  * Changes to allow safe downgrading from v2.6 to v2.4
515
+  * Fixes for edge cases in index creation
516
+- drop patch: mongodb-2.4.3-mongodb_scons-full-flag.patch, upstreamed
517
+
518
+-------------------------------------------------------------------
519
+Fri Feb 21 13:45:07 UTC 2014 - speilicke@suse.com
520
+
521
+- Fixed mongodb-2.4.3-mongodb_scons-full-flag.patch: i586 build broken
522
+  due to path issues
523
+
524
+-------------------------------------------------------------------
525
+Thu Feb 13 10:00:07 CET 2014 - jsuchome@suse.cz
526
+
527
+- tell logrotate about log file ownership (bnc#863719)  
528
+
529
+-------------------------------------------------------------------
530
+Tue Oct 29 08:00:12 UTC 2013 - speilicke@suse.com
531
+
532
+- Simplify chmod'ing include headers
533
+- Drop old include dirs from devel package
534
+
535
+-------------------------------------------------------------------
536
+Mon Oct 28 13:20:35 UTC 2013 - speilicke@suse.com
537
+
538
+- Disable -Werror where appropriate
539
+- Build with system libraries: boost, pcre
540
+- Drop v8 build conditional, it never had any effect anyway since this was the default
541
+- Use in-tree v8 for now until someone wants to fix the fallout from
542
+  different distro versions
543
+
544
+-------------------------------------------------------------------
545
+Wed Oct 16 12:49:41 UTC 2013 - speilicke@suse.com
546
+
547
+- Don't build with "-Wall", there far to many errors which just don't
548
+  make sense to fix
549
+
550
+-------------------------------------------------------------------
551
+Mon Sep 16 12:32:10 UTC 2013 - speilicke@suse.com
552
+
553
+- Require scons >= 1.1.0, build will fail otherwise
554
+
555
+-------------------------------------------------------------------
556
+Wed Aug 21 14:46:36 UTC 2013 - dvaleev@suse.com
557
+
558
+- Disable building for BigEndian platforms 
559
+
560
+-------------------------------------------------------------------
561
+Wed Aug 21 14:42:09 UTC 2013 - dvaleev@suse.com
562
+
563
+- don't enable service by default. It is up to user whether he 
564
+  wants to start the service automatically 
565
+
566
+-------------------------------------------------------------------
567
+Fri May 24 17:05:08 UTC 2013 - i@marguerite.su
568
+
569
+- New upstream release 2.4.3
570
+  * see http://docs.mongodb.org/manual/release-notes/2.4/
571
+
572
+-------------------------------------------------------------------
573
+Tue Apr 30 09:34:38 UTC 2013 - dmueller@suse.com
574
+
575
+- remove -o flag from useradd
576
+  * useradd: -o flag is only allowed with the -u flag
577
+
578
+-------------------------------------------------------------------
579
+Fri Dec 21 14:59:38 UTC 2012 - fcastelli@suse.com
580
+
581
+- Ensure mongodb is started properly on NUMA machines
582
+  (http://docs.mongodb.org/manual/administration/production-notes/#production-numa)
583
+
584
+-------------------------------------------------------------------
585
+Fri Nov 23 01:39:13 UTC 2012 - mrueckert@suse.de
586
+
587
+- use _home_dir define in the sed line
588
+
589
+-------------------------------------------------------------------
590
+Sat Sep 22 19:59:47 UTC 2012 - i@marguerite.su
591
+
592
+- New upstream release 2.2.0
593
+  * see http://docs.mongodb.org/manual/release-notes/2.2/
594
+- Remove deprecated_boost_functions.patch (Patch0)
595
+  * upstream changed it as a warning.
596
+- Regenerate void_return.patch (Patch1)
597
+  * seems it aims to deal with the strange boost::filesystem::remove
598
+- Drop mongodb-third_party.sm.py.patch (Patch2)
599
+  * upstream rewrote its code, no its cpp instead of py. 
600
+- Drop mongodb-2.0.0_no_stupid_chmod.patch (Patch3)
601
+  * no such code in SConstruct.
602
+- Drop mongodb-src-r2.0.4_link_ssl.patch (Patch4)
603
+  * upstream fixed.
604
+- Drop mongodb_cxxflags.patch (Patch5)
605
+  * not used at all.
606
+- Fix i586 build.
607
+  * mongodb-2.2.0-mongodb_scons-full-flag.patch
608
+  * https://jira.mongodb.org/browse/SERVER-5575
609
+
610
+-------------------------------------------------------------------
611
+Fri Jul 20 02:44:09 UTC 2012 - jengelh@inai.de
612
+
613
+- Package /var/{lib,log}/mongodb, as they are needed for proper
614
+  operation of the daemon which would otherwise refuse to start.
615
+- Remove redundant sections from specfile
616
+
617
+-------------------------------------------------------------------
618
+Wed Apr 11 07:30:24 UTC 2012 - simone.tolotti@gmail.com
619
+
620
+- New upstream release 2.0.4
621
+- Fixes (https://jira.mongodb.org/browse/SERVER/fixforversion/11107):
622
+ * SERVER-5135 Journal compression ratio reporting is incorrect
623
+ * SERVER-5177 fetching of docs in initial sync can assert
624
+ * SERVER-5069 ~ScopedDBConnection is vague and somewhat misleading
625
+
626
+-------------------------------------------------------------------
627
+Thu Nov 17 17:44:02 UTC 2011 - mrueckert@suse.de
628
+
629
+- add back mongodb_cxxflags.patch
630
+
631
+-------------------------------------------------------------------
632
+Thu Nov 17 17:23:45 UTC 2011 - mrueckert@suse.de
633
+
634
+- added mongodb-src-r2.0.1_link_ssl.patch:
635
+  Fix linking on factory. We need libcrypto in the library list
636
+  there.
637
+
638
+-------------------------------------------------------------------
639
+Thu Nov 17 17:03:21 UTC 2011 - mrueckert@suse.de
640
+
641
+- fix build on sles. it didnt like some of our scons parameters
642
+
643
+-------------------------------------------------------------------
644
+Thu Nov 17 15:11:49 UTC 2011 - mrueckert@suse.de
645
+
646
+- update to 2.0.1
647
+  - SERVER-3961 Segmentation Fault when creating new indexes
648
+  - SERVER-4020 bad serverID set in setShardVersion 
649
+  - SERVER-3889 Possible for setShardVersion to never be set on
650
+    mongod after multiple StaleConfigExceptions due to reset
651
+    metadata
652
+  - SERVER-3572 authenticate shouldn't use a write lock
653
+  - SERVER-4091 rs.reconfig(...) on 1.8.4_rc0 causes server to exit
654
+  - SERVER-3058 make sure distributed locks are thread-safe to
655
+    acquire
656
+  - SERVER-3683 Possible for setShardVersion to never be set on
657
+    mongod after multiple StaleConfigExceptions due to
658
+    stale/missing mongod metadata
659
+  - SERVER-3594 new crash in 1.9.1: couldn't make room for new
660
+    record (len: 135548) in capped ns <database>.system.profile
661
+  - SERVER-3650 ReplicaSet rollback should use slaveOk
662
+  - SERVER-3705 mongos not closing connections, filling up disk
663
+    with logs
664
+  - SERVER-3729 --ssl for tools
665
+  - SERVER-3750 Need to limit size of backfilled elements when
666
+    creating an array
667
+  - SERVER-3619 mongostat can't authenticate to mongos using -u -p
668
+    or the long name equivalents 
669
+  - SERVER-3605 After node is restarted it may not be set to ok
670
+    state in mongos
671
+  - SERVER-3666 mongod --auth must disable __system access
672
+  - SERVER-3539 mongos returns duplicate "ns" element when you run
673
+    db.xyz.stats() 
674
+  - SERVER-1097 mongoimport / export should adhere to CSV spec
675
+  - SERVER-3462 slaveOk queries don't distribute to all secondaries
676
+    when using a mongos
677
+  - SERVER-2710 Running replSetReconfig while writing to a
678
+    collection causes secondaries and arbiters to segfault.
679
+  - SERVER-2976 add a pure JS mode to map reduce to get improved
680
+    performance for light jobs
681
+  - SERVER-3086 mongoexport only exports one shard's worth of data
682
+  - SERVER-2872 mongos client/lasterror instability
683
+  - SERVER-2792 replace readline with linenoise
684
+  - SERVER-1503 rs priorities other than 0 and 1 not supported yet
685
+  - SERVER-4196 Count command on mongos can get into infinite loop
686
+  - SERVER-3683 Possible for setShardVersion to never be set on
687
+    mongod after multiple StaleConfigExceptions due to
688
+    stale/missing mongod metadata
689
+  - SERVER-3529 Sharded map reduce using merge stalls recreating
690
+    indexes on the output collection.
691
+  - SERVER-3996 Backport fix for SERVER-3002 to v1.8 branch
692
+- added optional switch to use libv8
693
+- added mongodb-2.0.0_no_stupid_chmod.patch:
694
+  dont do useless chmods
695
+- minor spec file rework
696
+
697
+-------------------------------------------------------------------
698
+Mon Nov  7 15:33:05 UTC 2011 - jmassaguerpla@suse.de
699
+
700
+- added glibc-locale as a dependency 
701
+
702
+-------------------------------------------------------------------
703
+Sun Nov  6 18:38:32 UTC 2011 - jmassaguerpla@suse.de
704
+
705
+- patched third-party/sm.py because of this bug
706
+  http://scons.tigris.org/issues/show_bug.cgi?id=2800
707
+ 
708
+
709
+-------------------------------------------------------------------
710
+Thu Nov  3 17:35:45 UTC 2011 - fcastelli@suse.com
711
+
712
+- require libjs 1.7.0
713
+
714
+-------------------------------------------------------------------
715
+Fri Sep 30 15:30:57 UTC 2011 - jw@suse.com
716
+
717
+- made available also for SLE-11-SP1
718
+
719
+-------------------------------------------------------------------
720
+Wed Sep  7 16:24:25 UTC 2011 - mrueckert@suse.de
721
+
722
+- update to 1.8.3
723
+  - [SERVER-3205] Dropping sharded database leads to errors with
724
+    dbnames which are prefixes of dropped name
725
+  - [SERVER-2707] make default stack size lower on linux
726
+  - [SERVER-3507] Changing hostname in Replica Set configuration,
727
+    does not affect rs.status(), until a server restart.
728
+
729
+-------------------------------------------------------------------
730
+Wed Sep  7 15:42:52 UTC 2011 - mrueckert@suse.de
731
+
732
+- added mongodb_werror.patch: drop -Werror from CFLAGS for building
733
+  on older boost versions
734
+
735
+-------------------------------------------------------------------
736
+Wed Sep  7 15:41:23 UTC 2011 - mrueckert@suse.de
737
+
738
+- added b1ec2058673f8ca582a490c2dd4a8405698221ae.patch:
739
+  patch taken from upstream git. adds detection code for linux3
740
+
741
+-------------------------------------------------------------------
742
+Wed Sep  7 14:07:57 UTC 2011 - mrueckert@suse.de
743
+
744
+- dont use PCH: it breaks build on SLE 11
745
+
746
+-------------------------------------------------------------------
747
+Wed Aug 17 19:08:34 EEST 2011 - koprok@nand.bg
748
+
749
+- Do not build libmongoclient.so shared library
750
+
751
+-------------------------------------------------------------------
752
+Mon Aug 15 11:16:17 EEST 2011 - koprok@nand.bg
753
+
754
+- Added -devel package with headers and static libraries
755
+
756
+-------------------------------------------------------------------
757
+Thu Aug 11 21:24:24 UTC 2011 - mrueckert@suse.de
758
+
759
+- update to 1.8.2
760
+  - [SERVER-3188] CLONE - mongos crash with "Received signal 6"
761
+  - [SERVER-1742] Assertion failure on mapreduce with geo query
762
+  - [SERVER-3196] Segmentation Fault at startup on NUMA-Architecture
763
+
764
+-------------------------------------------------------------------
765
+Fri Apr 15 18:46:12 UTC 2011 - mrueckert@suse.de
766
+
767
+- update to 1.8.1
768
+  - [SERVER-2324] compilation error with boost filesystem v3
769
+  - [SERVER-2662] seg fault equivalent when query plan cannot
770
+    recover from yield, does not assert, and is yielded again
771
+  - [SERVER-2698] mongos seems to swallow 'No matching object
772
+    found' errors when running findAndModify on a sharded
773
+    collection.
774
+  - [SERVER-2714] RS hidden setting should treat 1 as true
775
+  - [SERVER-2719] mongod running as a service on Windows does not
776
+    restart correctly after a reboot
777
+  - [SERVER-2737] Large rollback fails (DR102 too much data written
778
+    uncommitted) (after "rollback 6")
779
+  - [SERVER-2762] backtrace of mongos crash
780
+  - [SERVER-2787] Upgrading to 1.8.0 and enabling journaling
781
+    causing cryptic "_a != -1" error
782
+  - [SERVER-2791] missing write intent while initializing
783
+    background index build job
784
+  - [SERVER-2797] SEGV at BtreeCursor9prettyKey
785
+  - [SERVER-2809] assertion in count / userquery op nscanned after
786
+    failed yield recovery
787
+  - [SERVER-2810] yield explain seg fault when accessing
788
+    unprotected scan and order pointer
789
+  - [SERVER-2815] DR102 on index creation w/dropDups + --journal
790
+  - [SERVER-2853] Missing commitIfNeeded in background index build
791
+  - [SERVER-2854] Unsafe to assert inside of CommitJob::note
792
+  - [SERVER-2868] replica set connection gets confused about msater
793
+  - [SERVER-2872] mongos client/lasterror instability
794
+  - [SERVER-2808] when we get a seg fault (or similar) signal we
795
+    should print the faulting address
796
+- for the changes before see http://bit.ly/ga0jeH
797
+- add /usr/sbin/usermod to the prereq
798
+- respin mongodb_cxxflags.patch
799
+
800
+-------------------------------------------------------------------
801
+Tue Jan 18 15:04:58 CET 2011 - mhrusecky@suse.cz
802
+
803
+- fixed build for openSUSE 11.2 (directory permissions)
804
+
805
+-------------------------------------------------------------------
806
+Tue Jan 18 11:29:11 UTC 2011 - asn@cryptomilk.org
807
+
808
+- Added missing build requirements for SLE
809
+
810
+-------------------------------------------------------------------
811
+Wed Jan 12 17:26:26 UTC 2011 - asn@cryptomilk.org
812
+
813
+- Added shared library to make binaries smaller.
814
+- Added more comments to mongodb.conf
815
+- Added support for CPPFLAGS.
816
+- Don't strip the binaries for debuginfo packages.
817
+
818
+-------------------------------------------------------------------
819
+Mon Jan 10 17:56:58 CET 2011 - mhrusecky@suse.cz
820
+
821
+- Using /etc/mongodb.conf instead of sysconfig
822
+- Fixed init to run db as non-root
823
+- Creating log and database directories in init script
824
+- Added man pages
825
+
826
+-------------------------------------------------------------------
827
+Mon Jan  3 20:44:20 CET 2011 - asn@cynapses.org
828
+
829
+- Added additional options
830
+
831
+-------------------------------------------------------------------
832
+Wed Dec 22 22:24:33 CET 2010 - asn@cynapses.org
833
+
834
+- Fixed typo in mongodb init script.
835
+
836
+-------------------------------------------------------------------
837
+Wed Dec 22 18:46:49 CET 2010 - asn@cynapses.org
838
+
839
+- Added a mongodb sysconfig file.
840
+- Added localhost bind on startup.
841
+- Added auth requirement on startup.
842
+
843
+-------------------------------------------------------------------
844
+Tue Dec 21 22:35:31 CET 2010 - asn@cynapses.org
845
+
846
+- Silence mongodb daemon on startup.
847
+
848
+-------------------------------------------------------------------
849
+Tue Dec 21 20:53:48 CET 2010 - asn@cynapses.org
850
+
851
+- Fixed logrotate requirement.
852
+- Fixed the Group
853
+
854
+-------------------------------------------------------------------
855
+Tue Dec 21 19:23:56 CET 2010 - asn@cynapses.org
856
+
857
+- Update to version 1.6.5
858
+  * Attach a unique ID to moveChunk changelog entries
859
+  * Check chunk boundaries of delete operations during chunk migration
860
+  * Data loss after $set
861
+  * replica sets connection safety
862
+  * mongos doesn't pass mixed-case findAndModify
863
+- Added a new working init script.
864
+- Fixed directory permissions.
865
+- Fixed spec file.
866
+-------------------------------------------------------------------
867
+Mon Oct 24 17:41:00 UTC 2001 - jordimassaguerpla@gmail.com
868
+
869
+- upgraded to mongodb 2.0.1
870
+
871
mongodb.spec Added
385
 
1
@@ -0,0 +1,383 @@
2
+#
3
+# spec file for package mongodb
4
+#
5
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
6
+#
7
+# All modifications and additions to the file contributed by third parties
8
+# remain the property of their copyright owners, unless otherwise agreed
9
+# upon. The license for this file, and modifications and additions to the
10
+# file, is the same license as for the pristine package itself (unless the
11
+# license for the pristine package is not an Open Source License, in which
12
+# case the license is the MIT License). An "Open Source License" is a
13
+# license that conforms to the Open Source Definition (Version 1.9)
14
+# published by the Open Source Initiative.
15
+
16
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
17
+#
18
+
19
+
20
+%define _home_dir       %{_var}/lib/%{name}
21
+%define _mongodb_user     %{name}
22
+%define _mongodb_group    %{name}
23
+%if 0%{?suse_version} > 1220
24
+    %bcond_without systemd
25
+%else
26
+    %bcond_with systemd
27
+%endif
28
+%if %{?suse_version} >= 1500
29
+%define scons_bin %{_bindir}/scons
30
+%else
31
+%define scons_bin buildscripts/scons.py
32
+%endif
33
+Name:           mongodb
34
+Version:        3.6.8
35
+Release:        0
36
+Summary:        The MongoDB document-oriented database system (metapackage)
37
+License:        AGPL-3.0-only
38
+Group:          Productivity/Databases/Servers
39
+URL:            http://www.mongodb.org
40
+Source0:        https://fastdl.mongodb.org/src/mongodb-src-r%{version}.tar.gz
41
+Source1:        mongodb.init
42
+Source2:        mongodb.logrotate
43
+Source3:        mongodb.conf
44
+Source4:        mongodb.service
45
+Source5:        mongodb-tmpfile
46
+Patch0:         mongo-src-3.6.8-python3.patch
47
+Patch1:         mongodb-3.6.8-fix-syntax.patch
48
+# from https://sources.debian.org/patches/mongodb/1:3.4.18-2/fix-ftbfs-with-openssl-1.1.1.patch/
49
+Patch2:         fix-ftbfs-with-openssl-1.1.1.patch
50
+Patch3:         fix-abi-not-declared.patch
51
+BuildRequires:  glibc-devel
52
+BuildRequires:  libpcap-devel
53
+BuildRequires:  openssl-devel
54
+BuildRequires:  pcre-devel
55
+BuildRequires:  pkgconfig
56
+BuildRequires:  scons >= 2.3
57
+BuildRequires:  snappy-devel
58
+BuildRequires:  zlib-devel
59
+BuildRequires:  pkgconfig(yaml-cpp)
60
+BuildRequires:  libboost_system-devel
61
+Requires:       logrotate
62
+Requires:       mongodb-mongoperf = %{version}
63
+Requires:       mongodb-mongos = %{version}
64
+Requires:       mongodb-server = %{version}
65
+Requires:       mongodb-shell = %{version}
66
+Requires(pre):  %{_sbindir}/groupadd
67
+Requires(pre):  %{_sbindir}/useradd
68
+Conflicts:      mongo-10gen-enterprise
69
+Conflicts:      mongodb-enterprise
70
+Conflicts:      mongodb-enterprise-unstable
71
+Conflicts:      mongodb-org
72
+Conflicts:      mongodb-org-unstable
73
+ExcludeArch:    i586 ppc
74
+# MongoDB (upstream) does NOT support PPC, PPC64 or PPC64LE
75
+# on the 3.0.X series.
76
+#
77
+# MongoDB specifically recommends NOT
78
+# building and using mongodb on PPC, including
79
+# PPC64 and PPC64LE because it may, among
80
+# other things, corrupt data. Compiling pure upstream
81
+# mongodb also fails on PPC, PPC64 and PPC64LE.
82
+#
83
+# MongoDB is working and plans to support PPC64 and PPC64LE
84
+# in the future.
85
+#
86
+# Leave PPC lines in spec file to make it (much) easier to enable
87
+# PPC building when updating mongodb to newer version
88
+# since they have been known to work and have been suggested by upstream
89
+ExcludeArch:    ppc64 ppc64le
90
+%if 0%{?suse_version} >= 1500
91
+BuildRequires:  libboost_filesystem-devel
92
+BuildRequires:  libboost_iostreams-devel
93
+BuildRequires:  libboost_program_options-devel
94
+%endif
95
+%if 0%{?sle_version} == 120200 || 0%{?sle_version} == 120300
96
+BuildRequires:  gcc6
97
+BuildRequires:  gcc6-c++
98
+%else
99
+BuildRequires:  gcc-c++ >= 5.3
100
+%endif
101
+%if 0%{?suse_version} >= 1500
102
+BuildRequires:  python3-Cheetah3
103
+BuildRequires:  python3-PyYAML
104
+BuildRequires:  python3-regex
105
+BuildRequires:  python3-setuptools
106
+%else
107
+BuildRequires:  python-Cheetah
108
+BuildRequires:  python-PyYAML
109
+BuildRequires:  python-regex
110
+BuildRequires:  python-setuptools
111
+BuildRequires:  python-typing
112
+%endif
113
+%ifarch ppc64 ppc64le
114
+BuildRequires:  gperftools-devel
115
+%endif
116
+%if %{with systemd}
117
+BuildRequires:  systemd
118
+%{?systemd_requires}
119
+%else
120
+Requires(post): %insserv_prereq
121
+Requires(pre):  %fillup_prereq
122
+Requires(pre):  %insserv_prereq
123
+%endif
124
+
125
+%description
126
+MongoDB is a document-oriented database program. Classified as a
127
+NoSQL database program, MongoDB uses JSON-like documents with
128
+schemas. It has auto-sharding, built-in replication, TTL indexes,
129
+text search as well as an aggregation framework and native MapReduce.
130
+
131
+This metapackage will install the mongo shell, import/export tools,
132
+other client utilities, server software, default configuration, and
133
+init.d scripts.
134
+
135
+%package server
136
+Summary:        Document-oriented database server
137
+Group:          Productivity/Databases/Servers
138
+Requires:       openssl
139
+Requires:       shadow
140
+Conflicts:      mongo-10gen-enterprise-server
141
+Conflicts:      mongodb-enterprise-server
142
+Conflicts:      mongodb-enterprise-unstable-server
143
+Conflicts:      mongodb-org-server
144
+Conflicts:      mongodb-org-unstable-server
145
+
146
+%description server
147
+MongoDB is a document-oriented database program. Classified as a
148
+NoSQL database program, MongoDB uses JSON-like documents with
149
+schemas. It has auto-sharding, built-in replication, TTL indexes,
150
+text search as well as an aggregation framework and native MapReduce.
151
+
152
+This package contains the MongoDB server software, default
153
+configuration files, and service scripts.
154
+
155
+%package shell
156
+Summary:        MongoDB shell client
157
+Group:          Productivity/Databases/Clients
158
+Requires:       mongodb-server = %{version}
159
+Requires:       openssl
160
+Conflicts:      mongo-10gen-enterprise-shell
161
+Conflicts:      mongodb-enterprise-shell
162
+Conflicts:      mongodb-enterprise-unstable-shell
163
+Conflicts:      mongodb-org-shell
164
+Conflicts:      mongodb-org-unstable-shell
165
+
166
+%description shell
167
+MongoDB is a document-oriented database program. Classified as a
168
+NoSQL database program, MongoDB uses JSON-like documents with
169
+schemas. It has auto-sharding, built-in replication, TTL indexes,
170
+text search as well as an aggregation framework and native MapReduce.
171
+
172
+This package contains the mongo shell.
173
+
174
+%package mongos
175
+Summary:        MongoDB sharded cluster query router
176
+Group:          Productivity/Databases/Tools
177
+Conflicts:      mongo-10gen-enterprise-mongos
178
+Conflicts:      mongodb-enterprise-mongos
179
+Conflicts:      mongodb-enterprise-unstable-mongos
180
+Conflicts:      mongodb-org-mongos
181
+Conflicts:      mongodb-org-unstable-mongos
182
+
183
+%description mongos
184
+MongoDB is a document-oriented database program. Classified as a
185
+NoSQL database program, MongoDB uses JSON-like documents with
186
+schemas. It has auto-sharding, built-in replication, TTL indexes,
187
+text search as well as an aggregation framework and native MapReduce.
188
+
189
+This package contains mongos, the MongoDB sharded cluster query router.
190
+
191
+%package mongoperf
192
+Summary:        MongoDB utility to check disk I/O performance
193
+Group:          Productivity/Databases/Tools
194
+Conflicts:      mongo-10gen-enterprise-mongoperf
195
+Conflicts:      mongodb-enterprise-mongoperf
196
+Conflicts:      mongodb-enterprise-unstable-mongoperf
197
+Conflicts:      mongodb-org-mongoperf
198
+Conflicts:      mongodb-org-unstable-mongoperf
199
+
200
+%description mongoperf
201
+MongoDB is a document-oriented database program. Classified as a
202
+NoSQL database program, MongoDB uses JSON-like documents with
203
+schemas. It has auto-sharding, built-in replication, TTL indexes,
204
+text search as well as an aggregation framework and native MapReduce.
205
+
206
+This package contains mongoperf.
207
+
208
+%prep
209
+%setup -q -n mongodb-src-r%{version}
210
+%if %{?suse_version} >= 1500
211
+%patch0 -p1
212
+%endif
213
+%patch1 -p1
214
+%patch2 -p1
215
+%patch3 -p1
216
+
217
+# change default database path to reflect the default database user directory
218
+sed -i 's|/data/db/|%{_home_dir}/|' src/mongo/db/storage/storage_options.cpp
219
+
220
+%build
221
+%{scons_bin} \
222
+%ifarch aarch64
223
+    CCFLAGS="-march=armv8-a+crc" \
224
+%endif
225
+%if 0%{?sle_version} == 120200 || 0%{?sle_version} == 120300
226
+    CC=%{_bindir}/gcc-6 CXX=%{_bindir}/g++-6 \
227
+%endif
228
+    core \
229
+    %{?_smp_mflags} \
230
+    --disable-warnings-as-errors \
231
+    --nostrip \
232
+    --ssl \
233
+%ifarch x86_64  aarch64
234
+    --wiredtiger=on \
235
+%else
236
+    --wiredtiger=off \
237
+    --mmapv1=on \
238
+%endif
239
+%ifarch ppc64 ppc64le
240
+    --js-engine=none \
241
+    --allocator=system \
242
+%endif
243
+%if 0%{?suse_version} >= 1500
244
+    --use-system-boost \
245
+%endif
246
+    --use-system-pcre \
247
+    --use-system-snappy \
248
+    --use-system-yaml \
249
+    --use-system-zlib \
250
+
251
+%install
252
+%{scons_bin} \
253
+%ifarch aarch64
254
+    CCFLAGS="-march=armv8-a+crc" \
255
+%endif
256
+%if 0%{?sle_version} == 120200 || 0%{?sle_version} == 120300
257
+    CC=%{_bindir}/gcc-6 CXX=%{_bindir}/g++-6 \
258
+%endif
259
+    install --prefix=%{buildroot}%{_prefix} \
260
+    --disable-warnings-as-errors \
261
+    --nostrip \
262
+    --ssl \
263
+%ifarch x86_64  aarch64
264
+    --wiredtiger=on \
265
+%else
266
+    --wiredtiger=off \
267
+    --mmapv1=on \
268
+%endif
269
+%ifarch ppc64 ppc64le
270
+    --js-engine=none \
271
+    --allocator=system \
272
+%endif
273
+%if 0%{?suse_version} >= 1500
274
+    --use-system-boost \
275
+%endif
276
+    --use-system-pcre \
277
+    --use-system-snappy \
278
+    --use-system-yaml \
279
+    --use-system-zlib \
280
+
281
+mkdir -p %{buildroot}%{_sbindir}
282
+mv %{buildroot}%{_bindir}/mongod %{buildroot}%{_sbindir}/mongod
283
+mv %{buildroot}%{_bindir}/mongos %{buildroot}%{_sbindir}/mongos
284
+
285
+mkdir -p %{buildroot}%{_var}/log/mongodb
286
+mkdir -p %{buildroot}%{_var}/lib/mongodb
287
+
288
+%if %{with systemd}
289
+    install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}.service
290
+    install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_sbindir}/rc%{name}
291
+    install -d -m 0755 %{buildroot}%{_tmpfilesdir}/
292
+    install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf
293
+%else
294
+    install -D -p -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/%{name}
295
+    ln -sf %{_initddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}
296
+    mkdir -p %{buildroot}/run/%{pkg_name}
297
+%endif
298
+
299
+install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
300
+install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}.conf
301
+
302
+mkdir -p %{buildroot}%{_mandir}/man1/
303
+install -p -m 0644 debian/mongod.1 %{buildroot}%{_mandir}/man1/
304
+install -p -m 0644 debian/mongoperf.1 %{buildroot}%{_mandir}/man1/
305
+install -p -m 0644 debian/mongos.1 %{buildroot}%{_mandir}/man1/
306
+install -p -m 0644 debian/mongo.1 %{buildroot}%{_mandir}/man1/
307
+
308
+%pre server
309
+if ! %{_bindir}/id -g %{_mongodb_group} &>/dev/null; then
310
+    %{_sbindir}/groupadd -r %{_mongodb_group}
311
+fi
312
+if ! %{_bindir}/id %{_mongodb_user} &>/dev/null; then
313
+    %{_sbindir}/useradd -M -r -g %{_mongodb_group} \
314
+        -d %{_home_dir} -s /bin/false \
315
+        -c "MongoDB database admin" %{_mongodb_user} > /dev/null 2>&1
316
+fi
317
+
318
+%if %{with systemd}
319
+    %{service_add_pre %{name}.service}
320
+%endif
321
+
322
+%post server
323
+/sbin/ldconfig
324
+%if %{with systemd}
325
+    %tmpfiles_create %{_tmpfilesdir}/%{name}.conf
326
+    %{service_add_post %{name}.service}
327
+%else
328
+    %{fillup_and_insserv -f %{name}}
329
+%endif
330
+
331
+%preun server
332
+%if %{with systemd}
333
+    %{service_del_preun %{name}.service}
334
+%else
335
+    %{stop_on_removal %{name}}
336
+%endif
337
+
338
+%postun server
339
+/sbin/ldconfig
340
+%if %{with systemd}
341
+    %{service_del_postun %{name}.service}
342
+%else
343
+    %{restart_on_update %{name}}
344
+    %insserv_cleanup
345
+%endif
346
+
347
+%files
348
+
349
+%files server
350
+%{_sbindir}/mongod
351
+%config(noreplace) %{_sysconfdir}/%{name}.conf
352
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
353
+%{_sbindir}/rc%{name}
354
+%{_mandir}/man1/mongod.1%{?ext_man}
355
+
356
+%if %{with systemd}
357
+%{_unitdir}/%{name}.service
358
+%{_tmpfilesdir}/%{name}.conf
359
+%ghost %dir /run/%{name}
360
+%else
361
+%{_sysconfdir}/init.d/%{name}
362
+%endif
363
+%attr(0750,mongodb,mongodb) %{_var}/log/%{name}
364
+%attr(0750,mongodb,mongodb) %{_var}/lib/%{name}
365
+
366
+%files shell
367
+%{_bindir}/mongo
368
+%{_bindir}/install_compass
369
+%{_mandir}/man1/mongo.1%{?ext_man}
370
+
371
+%files mongos
372
+%{_sbindir}/mongos
373
+%{_mandir}/man1/mongos.1%{?ext_man}
374
+
375
+%files mongoperf
376
+%{_bindir}/mongoperf
377
+%{_mandir}/man1/mongoperf.1%{?ext_man}
378
+
379
+# TODO:
380
+# * /var/lib/[mongodb] is NOT a subvolume in default BTRFS setup,
381
+# which means system snapper snapshots will include mongodb database files!
382
+# this is an issue with any database that's not PostgreSQL
383
+
384
+%changelog
385
fix-abi-not-declared.patch Added
14
 
1
@@ -0,0 +1,12 @@
2
+diff -ur mongodb-src-r3.6.8_orig/src/mongo/util/heap_profiler.cpp mongodb-src-r3.6.8/src/mongo/util/heap_profiler.cpp
3
+--- mongodb-src-r3.6.8_orig/src/mongo/util/heap_profiler.cpp   2018-09-10 17:44:07.000000000 +0200
4
++++ mongodb-src-r3.6.8/src/mongo/util/heap_profiler.cpp    2020-01-10 01:33:59.753473568 +0100
5
+@@ -47,6 +47,8 @@
6
+ #include <dlfcn.h>
7
+ #include <execinfo.h>
8
+ 
9
++#include <cxxabi.h>
10
++
11
+ //
12
+ // Sampling heap profiler
13
+ //
14
fix-ftbfs-with-openssl-1.1.1.patch Added
33
 
1
@@ -0,0 +1,31 @@
2
+From fb645a7072959db77be0aa5f792ef5a6038ffb0e Mon Sep 17 00:00:00 2001
3
+From: Apollon Oikonomopoulos <apoikos@debian.org>
4
+Date: Mon, 3 Dec 2018 21:18:52 +0200
5
+Subject: [PATCH] Do not attempt to track TLS1.3
6
+
7
+Commit 5abce331 introduced support for tracking TLS versions, however
8
+the cherry-picked changes rely on TLS1.3 support which was not
9
+backported from master. This causes build failures on systems with
10
+OpenSSL 1.1.1, where TLS1_3_VERSION is defined but
11
+mongo::TLSVersionCounts lacks the tls13 field.
12
+
13
+Fix this by disabling TLS1.3 tracking altogether.
14
+---
15
+ src/mongo/util/net/ssl_manager.cpp | 2 +-
16
+ 1 file changed, 1 insertion(+), 1 deletion(-)
17
+
18
+diff -ur mongodb-src-r3.6.8_orig/src/mongo/util/net/ssl_manager.cpp mongodb-src-r3.6.8/src/mongo/util/net/ssl_manager.cpp
19
+--- mongodb-src-r3.6.8_orig/src/mongo/util/net/ssl_manager.cpp 2018-09-10 17:44:07.000000000 +0200
20
++++ mongodb-src-r3.6.8/src/mongo/util/net/ssl_manager.cpp  2020-01-09 23:58:23.559086038 +0100
21
+@@ -1494,7 +1494,7 @@
22
+         case TLS1_2_VERSION:
23
+             counts.tls12.addAndFetch(1);
24
+             break;
25
+-#ifdef TLS1_3_VERSION
26
++#if 0
27
+         case TLS1_3_VERSION:
28
+             counts.tls13.addAndFetch(1);
29
+             break;
30
+-- 
31
+2.18.0
32
+
33
mongo-src-3.6.8-python3.patch Added
1859
 
1
@@ -0,0 +1,1857 @@
2
+Index: mongodb-src-r3.6.8/buildscripts/aggregate_tracefiles.py
3
+===================================================================
4
+--- mongodb-src-r3.6.8.orig/buildscripts/aggregate_tracefiles.py
5
++++ mongodb-src-r3.6.8/buildscripts/aggregate_tracefiles.py
6
+@@ -16,7 +16,7 @@ def aggregate(inputs, output):
7
+ 
8
+     args += ['-o', output]
9
+ 
10
+-    print ' '.join(args)
11
++    print(' '.join(args))
12
+     
13
+     return subprocess.call(args)  
14
+ 
15
+Index: mongodb-src-r3.6.8/buildscripts/burn_in_tests.py
16
+===================================================================
17
+--- mongodb-src-r3.6.8.orig/buildscripts/burn_in_tests.py
18
++++ mongodb-src-r3.6.8/buildscripts/burn_in_tests.py
19
+@@ -161,7 +161,7 @@ def find_changed_tests(branch_name, base
20
+             # commit among 'revs_to_check' that's been activated in Evergreen. We handle this by
21
+             # only considering tests changed in the current commit.
22
+             last_activated = "HEAD"
23
+-        print "Comparing current branch against", last_activated
24
++        print("Comparing current branch against", last_activated)
25
+         revisions = callo(["git", "rev-list", base_commit + "..." + last_activated]).splitlines()
26
+         base_commit = last_activated
27
+     else:
28
+@@ -169,10 +169,10 @@ def find_changed_tests(branch_name, base
29
+ 
30
+     revision_count = len(revisions)
31
+     if revision_count > max_revisions:
32
+-        print "There are too many revisions included (%d)." % revision_count, \
33
++        print("There are too many revisions included (%d)." % revision_count, \
34
+               "This is likely because your base branch is not " + branch_name + ".", \
35
+               "You can allow us to review more than 25 revisions by using", \
36
+-              "the --maxRevisions option."
37
++              "the --maxRevisions option.")
38
+         return changed_tests
39
+ 
40
+     changed_files = callo(["git", "diff", "--name-only", base_commit]).splitlines()
41
+@@ -279,7 +279,7 @@ def create_task_list(evergreen_conf, bui
42
+ 
43
+     evg_buildvariant = evergreen_conf.get_variant(buildvariant)
44
+     if not evg_buildvariant:
45
+-        print "Buildvariant", buildvariant, "not found in", evergreen_conf.path
46
++        print("Buildvariant", buildvariant, "not found in", evergreen_conf.path)
47
+         sys.exit(1)
48
+ 
49
+     # Find all the buildvariant task's resmoke_args.
50
+@@ -366,9 +366,9 @@ def main():
51
+         evergreen_conf = evergreen.EvergreenProjectConfig(values.evergreen_file)
52
+ 
53
+         if values.buildvariant is None:
54
+-            print "Option buildVariant must be specified to find changed tests.\n", \
55
++            print("Option buildVariant must be specified to find changed tests.\n", \
56
+                   "Select from the following: \n" \
57
+-                  "\t", "\n\t".join(sorted(evergreen_conf.variant_names))
58
++                  "\t", "\n\t".join(sorted(evergreen_conf.variant_names)))
59
+             sys.exit(1)
60
+ 
61
+         changed_tests = find_changed_tests(values.branch,
62
+@@ -380,7 +380,7 @@ def main():
63
+         changed_tests = filter_tests(changed_tests, exclude_tests)
64
+         # If there are no changed tests, exit cleanly.
65
+         if not changed_tests:
66
+-            print "No new or modified tests found."
67
++            print("No new or modified tests found.")
68
+             _write_report_file({}, values.test_list_outfile)
69
+             sys.exit(0)
70
+         suites = resmokelib.parser.get_suites(values, changed_tests)
71
+@@ -403,7 +403,7 @@ def main():
72
+             try:
73
+                 subprocess.check_call(resmoke_cmd, shell=False)
74
+             except subprocess.CalledProcessError as err:
75
+-                print "Resmoke returned an error with task:", task
76
++                print("Resmoke returned an error with task:", task)
77
+                 _save_report_data(test_results, values.report_file, task)
78
+                 _write_report_file(test_results, values.report_file)
79
+                 sys.exit(err.returncode)
80
+Index: mongodb-src-r3.6.8/buildscripts/cleanbb.py
81
+===================================================================
82
+--- mongodb-src-r3.6.8.orig/buildscripts/cleanbb.py
83
++++ mongodb-src-r3.6.8/buildscripts/cleanbb.py
84
+@@ -79,7 +79,7 @@ def tryToRemove(path):
85
+ 
86
+ def cleanup( root , nokill ):
87
+     if nokill:
88
+-        print "nokill requested, not killing anybody"
89
++        print("nokill requested, not killing anybody")
90
+     else:
91
+         if killprocs( root=root ) > 0:
92
+             time.sleep(3)
93
+Index: mongodb-src-r3.6.8/buildscripts/errorcodes.py
94
+===================================================================
95
+--- mongodb-src-r3.6.8.orig/buildscripts/errorcodes.py
96
++++ mongodb-src-r3.6.8/buildscripts/errorcodes.py
97
+@@ -9,7 +9,7 @@ Optionally replaces zero codes in source
98
+ import bisect
99
+ import os
100
+ import sys
101
+-import utils
102
++from . import utils
103
+ from collections import defaultdict, namedtuple
104
+ from optparse import OptionParser
105
+ 
106
+@@ -66,9 +66,9 @@ def parseSourceFiles( callback ):
107
+ 
108
+     for sourceFile in utils.getAllSourceFiles(prefix='src/mongo/'):
109
+         if list_files:
110
+-            print 'scanning file: ' + sourceFile
111
++            print('scanning file: ' + sourceFile)
112
+ 
113
+-        with open(sourceFile) as f:
114
++        with open(sourceFile,encoding="utf-8") as f:
115
+             text = f.read()
116
+ 
117
+             if not any([zz in text for zz in quick]):
118
+@@ -159,7 +159,7 @@ def readErrorCodes():
119
+ 
120
+     parseSourceFiles( checkDups )
121
+ 
122
+-    if seen.has_key("0"):
123
++    if "0" in seen:
124
+         code = "0"
125
+         bad = seen[code]
126
+         errors.append( bad )
127
+@@ -189,19 +189,19 @@ def replaceBadCodes( errors, nextCode ):
128
+ 
129
+     for loc in skip_errors:
130
+         line, col = getLineAndColumnForPosition(loc)
131
+-        print ("SKIPPING NONZERO code=%s: %s:%d:%d"
132
++        print( "SKIPPING NONZERO code=%s: %s:%d:%d"
133
+                 % (loc.code, loc.sourceFile, line, col))
134
+ 
135
+     # Dedupe, sort, and reverse so we don't have to update offsets as we go.
136
+     for assertLoc in reversed(sorted(set(zero_errors))):
137
+         (sourceFile, byteOffset, lines, code) = assertLoc
138
+         lineNum, _ = getLineAndColumnForPosition(assertLoc)
139
+-        print "UPDATING_FILE: %s:%s" % (sourceFile, lineNum)
140
++        print("UPDATING_FILE: %s:%s" % (sourceFile, lineNum))
141
+ 
142
+         ln = lineNum - 1
143
+ 
144
+         with open(sourceFile, 'r+') as f:
145
+-            print "LINE_%d_BEFORE:%s" % (lineNum, f.readlines()[ln].rstrip())
146
++            print("LINE_%d_BEFORE:%s" % (lineNum, f.readlines()[ln].rstrip()))
147
+ 
148
+             f.seek(0)
149
+             text = f.read()
150
+@@ -212,7 +212,7 @@ def replaceBadCodes( errors, nextCode ):
151
+             f.write(text[byteOffset+1:])
152
+             f.seek(0)
153
+ 
154
+-            print "LINE_%d_AFTER :%s" % (lineNum, f.readlines()[ln].rstrip())
155
++            print("LINE_%d_AFTER :%s" % (lineNum, f.readlines()[ln].rstrip()))
156
+         nextCode += 1
157
+ 
158
+ 
159
+@@ -281,7 +281,7 @@ def main():
160
+     elif options.replace:
161
+         replaceBadCodes(errors, next)
162
+     else:
163
+-        print ERROR_HELP
164
++        print(ERROR_HELP)
165
+         sys.exit(1)
166
+ 
167
+ 
168
+Index: mongodb-src-r3.6.8/buildscripts/idl/idl/syntax.py
169
+===================================================================
170
+--- mongodb-src-r3.6.8.orig/buildscripts/idl/idl/syntax.py
171
++++ mongodb-src-r3.6.8/buildscripts/idl/idl/syntax.py
172
+@@ -82,8 +82,7 @@ def _item_and_type(dic):
173
+     # type: (Dict[Any, List[Any]]) -> Iterator[Tuple[Any, Any]]
174
+     """Return an Iterator of (key, value) pairs from a dictionary."""
175
+     return itertools.chain.from_iterable((_zip_scalar(value, key)
176
+-                                          for (key, value) in dic.viewitems()))
177
+-
178
++                                          for (key, value) in dic.items()))
179
+ 
180
+ class SymbolTable(object):
181
+     """
182
+Index: mongodb-src-r3.6.8/buildscripts/make_archive.py
183
+===================================================================
184
+--- mongodb-src-r3.6.8.orig/buildscripts/make_archive.py
185
++++ mongodb-src-r3.6.8/buildscripts/make_archive.py
186
+@@ -95,14 +95,14 @@ def make_tar_archive(opts):
187
+         enclosing_file_directory = os.path.dirname(temp_file_location)
188
+         if not os.path.exists(enclosing_file_directory):
189
+             os.makedirs(enclosing_file_directory)
190
+-        print "copying %s => %s" % (input_filename, temp_file_location)
191
++        print("copying %s => %s" % (input_filename, temp_file_location))
192
+         if os.path.isdir(input_filename):
193
+             shutil.copytree(input_filename, temp_file_location)
194
+         else:
195
+             shutil.copy2(input_filename, temp_file_location)
196
+         tar_command.append(preferred_filename)
197
+ 
198
+-    print " ".join(tar_command)
199
++    print(" ".join(tar_command))
200
+     # execute the full tar command
201
+     run_directory = os.path.join(os.getcwd(), enclosing_archive_directory)
202
+     proc = Popen(tar_command, stdout=PIPE, stderr=STDOUT, bufsize=0, cwd=run_directory)
203
+Index: mongodb-src-r3.6.8/buildscripts/make_vcxproj.py
204
+===================================================================
205
+--- mongodb-src-r3.6.8.orig/buildscripts/make_vcxproj.py
206
++++ mongodb-src-r3.6.8/buildscripts/make_vcxproj.py
207
+@@ -241,7 +241,7 @@ class ProjFileGenerator(object):
208
+ 
209
+ def main():
210
+     if len(sys.argv) != 2:
211
+-        print r"Usage: python buildscripts\make_vcxproj.py FILE_NAME"
212
++        print(r"Usage: python buildscripts\make_vcxproj.py FILE_NAME")
213
+         return
214
+ 
215
+     with ProjFileGenerator(sys.argv[1]) as projfile:
216
+Index: mongodb-src-r3.6.8/buildscripts/msitrim.py
217
+===================================================================
218
+--- mongodb-src-r3.6.8.orig/buildscripts/msitrim.py
219
++++ mongodb-src-r3.6.8/buildscripts/msitrim.py
220
+@@ -29,7 +29,7 @@ def exec_update(query, column, value):
221
+     view.Close()
222
+ 
223
+ 
224
+-print "Trimming MSI"
225
++print("Trimming MSI")
226
+ 
227
+ db = msilib.OpenDatabase(args.file.name, msilib.MSIDBOPEN_DIRECT)
228
+ 
229
+Index: mongodb-src-r3.6.8/buildscripts/packager-enterprise.py
230
+===================================================================
231
+--- mongodb-src-r3.6.8.orig/buildscripts/packager-enterprise.py
232
++++ mongodb-src-r3.6.8/buildscripts/packager-enterprise.py
233
+@@ -153,7 +153,7 @@ def main(argv):
234
+     if prefix is None:
235
+       prefix=tempfile.mkdtemp()
236
+ 
237
+-    print "Working in directory %s" % prefix
238
++    print("Working in directory %s" % prefix)
239
+ 
240
+     os.chdir(prefix)
241
+     try:
242
+@@ -226,7 +226,7 @@ def make_package(distro, build_os, arch,
243
+     # directory, so the debian directory is needed in all cases (and
244
+     # innocuous in the debianoids' sdirs).
245
+     for pkgdir in ["debian", "rpm"]:
246
+-        print "Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir)
247
++        print("Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir))
248
+         # FIXME: sh-dash-cee is bad. See if tarfile can do this.
249
+         packager.sysassert(["sh", "-c", "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % (srcdir, spec.metadata_gitspec(), pkgdir, sdir)])
250
+     # Splat the binaries and snmp files under sdir.  The "build" stages of the
251
+Index: mongodb-src-r3.6.8/buildscripts/packager.py
252
+===================================================================
253
+--- mongodb-src-r3.6.8.orig/buildscripts/packager.py
254
++++ mongodb-src-r3.6.8/buildscripts/packager.py
255
+@@ -343,7 +343,7 @@ def main(argv):
256
+     prefix = args.prefix
257
+     if prefix is None:
258
+       prefix = tempfile.mkdtemp()
259
+-    print "Working in directory %s" % prefix
260
++    print("Working in directory %s" % prefix)
261
+ 
262
+     os.chdir(prefix)
263
+     try:
264
+@@ -382,14 +382,14 @@ def crossproduct(*seqs):
265
+ 
266
+ def sysassert(argv):
267
+     """Run argv and assert that it exited with status 0."""
268
+-    print "In %s, running %s" % (os.getcwd(), " ".join(argv))
269
++    print("In %s, running %s" % (os.getcwd(), " ".join(argv)))
270
+     sys.stdout.flush()
271
+     sys.stderr.flush()
272
+     assert(subprocess.Popen(argv).wait()==0)
273
+ 
274
+ def backtick(argv):
275
+     """Run argv and return its output string."""
276
+-    print "In %s, running %s" % (os.getcwd(), " ".join(argv))
277
++    print("In %s, running %s" % (os.getcwd(), " ".join(argv)))
278
+     sys.stdout.flush()
279
+     sys.stderr.flush()
280
+     return subprocess.Popen(argv, stdout=subprocess.PIPE).communicate()[0]
281
+@@ -421,7 +421,7 @@ def unpack_binaries_into(build_os, arch,
282
+         sysassert(["tar", "xvzf", rootdir+"/"+tarfile(build_os, arch, spec)])
283
+         release_dir = glob('mongodb-linux-*')[0]
284
+         for releasefile in "bin", "GNU-AGPL-3.0", "README", "THIRD-PARTY-NOTICES", "MPL-2":
285
+-            print "moving file: %s/%s" % (release_dir, releasefile)
286
++            print("moving file: %s/%s" % (release_dir, releasefile))
287
+             os.rename("%s/%s" % (release_dir, releasefile), releasefile)
288
+         os.rmdir(release_dir)
289
+     except Exception:
290
+@@ -441,7 +441,7 @@ def make_package(distro, build_os, arch,
291
+     # directory, so the debian directory is needed in all cases (and
292
+     # innocuous in the debianoids' sdirs).
293
+     for pkgdir in ["debian", "rpm"]:
294
+-        print "Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir)
295
++        print("Copying packaging files from %s to %s" % ("%s/%s" % (srcdir, pkgdir), sdir))
296
+         # FIXME: sh-dash-cee is bad. See if tarfile can do this.
297
+         sysassert(["sh", "-c", "(cd \"%s\" && git archive %s %s/ ) | (cd \"%s\" && tar xvf -)" % (srcdir, spec.metadata_gitspec(), pkgdir, sdir)])
298
+     # Splat the binaries under sdir.  The "build" stages of the
299
+Index: mongodb-src-r3.6.8/buildscripts/resmokelib/core/process.py
300
+===================================================================
301
+--- mongodb-src-r3.6.8.orig/buildscripts/resmokelib/core/process.py
302
++++ mongodb-src-r3.6.8/buildscripts/resmokelib/core/process.py
303
+@@ -196,8 +196,8 @@ class Process(object):
304
+                 finally:
305
+                     win32api.CloseHandle(mongo_signal_handle)
306
+ 
307
+-                print "Failed to cleanly exit the program, calling TerminateProcess() on PID: " +\
308
+-                    str(self._process.pid)
309
++                print("Failed to cleanly exit the program, calling TerminateProcess() on PID: " +\
310
++                    str(self._process.pid))
311
+ 
312
+             # Adapted from implementation of Popen.terminate() in subprocess.py of Python 2.7
313
+             # because earlier versions do not catch exceptions.
314
+Index: mongodb-src-r3.6.8/buildscripts/smoke.py
315
+===================================================================
316
+--- mongodb-src-r3.6.8.orig/buildscripts/smoke.py
317
++++ mongodb-src-r3.6.8/buildscripts/smoke.py
318
+@@ -133,17 +133,17 @@ class NullMongod(object):
319
+ 
320
+ 
321
+ def dump_stacks(signal, frame):
322
+-    print "======================================"
323
+-    print "DUMPING STACKS due to SIGUSR1 signal"
324
+-    print "======================================"
325
++    print("======================================")
326
++    print("DUMPING STACKS due to SIGUSR1 signal")
327
++    print("======================================")
328
+     threads = threading.enumerate();
329
+ 
330
+-    print "Total Threads: " + str(len(threads))
331
++    print("Total Threads: " + str(len(threads)))
332
+ 
333
+     for id, stack in sys._current_frames().items():
334
+-        print "Thread %d" % (id)
335
+-        print "".join(traceback.format_stack(stack))
336
+-    print "======================================"
337
++        print("Thread %d" % (id))
338
++        print("".join(traceback.format_stack(stack)))
339
++    print("======================================")
340
+ 
341
+ 
342
+ def buildlogger(cmd, is_global=False):
343
+@@ -196,8 +196,8 @@ class mongod(NullMongod):
344
+         try:
345
+             self.check_mongo_port(int(port))
346
+             return True
347
+-        except Exception,e:
348
+-            print >> sys.stderr, e
349
++        except Exception as e:
350
++            print(e, file=sys.stderr)
351
+             return False
352
+         
353
+     def did_mongod_start(self, port=mongod_port, timeout=300):
354
+@@ -207,14 +207,14 @@ class mongod(NullMongod):
355
+             if is_up:
356
+                 return True
357
+             timeout = timeout - 1
358
+-        print >> sys.stderr, "timeout starting mongod"
359
++        print( "timeout starting mongod", file=sys.stderr)
360
+         return False
361
+ 
362
+     def start(self):
363
+         global mongod_port
364
+         global mongod
365
+         if self.proc:
366
+-            print >> sys.stderr, "probable bug: self.proc already set in start()"
367
++            print( "probable bug: self.proc already set in start()", file=sys.stderr)
368
+             return
369
+         self.ensure_test_dirs()
370
+         dir_name = smoke_db_prefix + "/data/db/sconsTests/"
371
+@@ -270,7 +270,7 @@ class mongod(NullMongod):
372
+                      '--sslAllowConnectionsWithoutCertificates']
373
+         if self.kwargs.get('rlp_path'):
374
+             argv += ['--basisTechRootDirectory', self.kwargs.get('rlp_path')]
375
+-        print "running " + " ".join(argv)
376
++        print( "running " + " ".join(argv))
377
+         self.proc = self._start(buildlogger(argv, is_global=True))
378
+ 
379
+         # If the mongod process is spawned under buildlogger.py, then the first line of output
380
+@@ -352,7 +352,7 @@ class mongod(NullMongod):
381
+ 
382
+     def stop(self):
383
+         if not self.proc:
384
+-            print >> sys.stderr, "probable bug: self.proc unset in stop()"
385
++            print("probable bug: self.proc unset in stop()", file=sys.stderr)
386
+             return
387
+         try:
388
+             if os.sys.platform == "win32" and self.job_object is not None:
389
+@@ -407,9 +407,9 @@ class mongod(NullMongod):
390
+                 self.proc.terminate()
391
+             else:
392
+                 os.kill(self.proc.pid, 15)
393
+-        except Exception, e:
394
+-            print >> sys.stderr, "error shutting down mongod"
395
+-            print >> sys.stderr, e
396
++        except Exception as e:
397
++            print( "error shutting down mongod", file=sys.stderr)
398
++            print(e, file=sys.stderr)
399
+         self.proc.wait()
400
+ 
401
+         if self._stdout_pipe is not None:
402
+@@ -427,9 +427,9 @@ class mongod(NullMongod):
403
+             raise(Exception('mongod process exited with non-zero code %d' % retcode))
404
+ 
405
+     def wait_for_repl(self):
406
+-        print "Awaiting replicated (w:2, wtimeout:5min) insert (port:" + str(self.port) + ")"
407
++        print( "Awaiting replicated (w:2, wtimeout:5min) insert (port:" + str(self.port) + ")")
408
+         MongoClient(port=self.port).testing.smokeWait.insert({}, w=2, wtimeout=5*60*1000)
409
+-        print "Replicated write completed -- done wait_for_repl"
410
++        print("Replicated write completed -- done wait_for_repl")
411
+ 
412
+ class Bug(Exception):
413
+     def __str__(self):
414
+@@ -506,7 +506,7 @@ def check_db_hashes(master, slave):
415
+                 mOplog = mTestDB.connection.local[oplog];
416
+                 oplog_entries = list(mOplog.find({"$or": [{"ns":mTestDB[coll].full_name}, \
417
+                                                           {"op":"c"}]}).sort("$natural", 1))
418
+-                print "oplog for %s" % mTestDB[coll].full_name
419
++                print("oplog for %s" % mTestDB[coll].full_name)
420
+                 for doc in oplog_entries:
421
+                     pprint.pprint(doc, width=200)
422
+ 
423
+@@ -745,7 +745,7 @@ def runTest(test, result):
424
+ 
425
+     is_mongod_still_up = test_mongod.is_mongod_up(mongod_port)
426
+     if start_mongod and not is_mongod_still_up:
427
+-        print "mongod is not running after test"
428
++        print("mongod is not running after test")
429
+         result["mongod_running_at_end"] = is_mongod_still_up;
430
+         raise TestServerFailure(path)
431
+ 
432
+@@ -754,7 +754,7 @@ def runTest(test, result):
433
+     if r != 0:
434
+         raise TestExitFailure(path, r)
435
+ 
436
+-    print ""
437
++    print("")
438
+ 
439
+ def run_tests(tests):
440
+     # FIXME: some suites of tests start their own mongod, so don't
441
+@@ -825,7 +825,7 @@ def run_tests(tests):
442
+                 result = primary.admin.command("ismaster");
443
+                 ismaster = result["ismaster"]
444
+                 if not ismaster:
445
+-                    print "waiting for primary to be available ..."
446
++                    print("waiting for primary to be available ...")
447
+                     time.sleep(.2)
448
+             
449
+             secondaryUp = False
450
+@@ -835,7 +835,7 @@ def run_tests(tests):
451
+                 result = sConn.admin.command("ismaster");
452
+                 secondaryUp = result["secondary"]
453
+                 if not secondaryUp:
454
+-                    print "waiting for secondary to be available ..."
455
++                    print("waiting for secondary to be available ...")
456
+                     time.sleep(.2)
457
+ 
458
+         if small_oplog or small_oplog_rs:
459
+@@ -857,7 +857,7 @@ def run_tests(tests):
460
+                 if skipTest(test_path):
461
+                     test_result["status"] = "skip"
462
+ 
463
+-                    print "skipping " + test_path
464
++                    print("skipping " + test_path)
465
+                 else:
466
+                     fails.append(test)
467
+                     runTest(test, test_result)
468
+@@ -904,7 +904,7 @@ def run_tests(tests):
469
+                 test_result["status"] = "fail"
470
+                 test_report["results"].append( test_result )
471
+                 try:
472
+-                    print f
473
++                    print(f)
474
+                     # Record the failing test and re-raise.
475
+                     losers[f.path] = f.status
476
+                     raise f
477
+@@ -925,51 +925,51 @@ def run_tests(tests):
478
+ def check_and_report_replication_dbhashes():
479
+     def missing(lst, src, dst):
480
+         if lst:
481
+-            print """The following collections were present in the %s but not the %s
482
+-at the end of testing:""" % (src, dst)
483
++            print("""The following collections were present in the %s but not the %s
484
++at the end of testing:""" % (src, dst))
485
+             for db in lst:
486
+-                print db
487
++                print(db)
488
+ 
489
+     missing(lost_in_slave, "master", "slave")
490
+     missing(lost_in_master, "slave", "master")
491
+     if screwy_in_slave:
492
+-        print """The following collections have different hashes in the master and slave:"""
493
++        print("""The following collections have different hashes in the master and slave:""")
494
+         for coll in screwy_in_slave.keys():
495
+             stats = screwy_in_slave[coll]
496
+             # Counts are "approx" because they are collected after the dbhash runs and may not
497
+             # reflect the states of the collections that were hashed. If the hashes differ, one
498
+             # possibility is that a test exited with writes still in-flight.
499
+-            print "collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave'])
500
++            print("collection: %s\t (master/slave) hashes: %s/%s counts (approx): %i/%i" % (coll, stats['hashes']['master'], stats['hashes']['slave'], stats['counts']['master'], stats['counts']['slave']))
501
+             if "docs" in stats:
502
+                 if (("master" in stats["docs"] and len(stats["docs"]["master"]) == 0) and
503
+                     ("slave" in stats["docs"] and len(stats["docs"]["slave"]) == 0)):
504
+-                    print "All docs matched!"
505
++                    print("All docs matched!")
506
+                 else:
507
+-                    print "Different Docs"
508
+-                    print "Master docs:"
509
++                    print("Different Docs")
510
++                    print("Master docs:")
511
+                     pprint.pprint(stats["docs"]["master"], indent=2)
512
+-                    print "Slave docs:"
513
++                    print("Slave docs:")
514
+                     pprint.pprint(stats["docs"]["slave"], indent=2)
515
+             if "error-docs" in stats:
516
+-                print "Error getting docs to diff:"
517
++                print("Error getting docs to diff:")
518
+                 pprint.pprint(stats["error-docs"])
519
+         return True
520
+ 
521
+     if (small_oplog or small_oplog_rs) and not (lost_in_master or lost_in_slave or screwy_in_slave):
522
+-        print "replication ok for %d collections" % (len(replicated_collections))
523
++        print("replication ok for %d collections" % (len(replicated_collections)))
524
+ 
525
+     return False
526
+ 
527
+ 
528
+ def report():
529
+-    print "%d tests succeeded" % len(winners)
530
++    print("%d tests succeeded" % len(winners))
531
+     num_missed = len(tests) - (len(winners) + len(losers.keys()))
532
+     if num_missed:
533
+-        print "%d tests didn't get run" % num_missed
534
++        print("%d tests didn't get run" % num_missed)
535
+     if losers:
536
+-        print "The following tests failed (with exit code):"
537
++        print("The following tests failed (with exit code):")
538
+         for loser in losers:
539
+-            print "%s\t%d" % (loser, losers[loser])
540
++            print("%s\t%d" % (loser, losers[loser]))
541
+ 
542
+     test_result = { "start": time.time() }
543
+     if check_and_report_replication_dbhashes():
544
+@@ -1244,7 +1244,7 @@ def run_old_fails():
545
+         return # This counts as passing so we will run all tests
546
+ 
547
+     if ('version' not in state or state['version'] != file_version()):
548
+-        print "warning: old version of failfile.smoke detected. skipping recent fails"
549
++        print("warning: old version of failfile.smoke detected. skipping recent fails")
550
+         clear_failfile()
551
+         return
552
+ 
553
+@@ -1308,7 +1308,7 @@ def main():
554
+     try:
555
+         signal.signal(signal.SIGUSR1, dump_stacks)
556
+     except AttributeError:
557
+-        print "Cannot catch signals on Windows"
558
++        print("Cannot catch signals on Windows")
559
+ 
560
+     parser = OptionParser(usage="usage: smoke.py [OPTIONS] ARGS*")
561
+     parser.add_option('--mode', dest='mode', default='suite',
562
+@@ -1450,11 +1450,11 @@ def main():
563
+ 
564
+     if options.ignore_files != None :
565
+         ignore_patt = re.compile( options.ignore_files )
566
+-        print "Ignoring files with pattern: ", ignore_patt
567
++        print("Ignoring files with pattern: ", ignore_patt)
568
+ 
569
+         def ignore_test( test ):
570
+             if ignore_patt.search( test[0] ) != None:
571
+-                print "Ignoring test ", test[0]
572
++                print("Ignoring test ", test[0])
573
+                 return False
574
+             else:
575
+                 return True
576
+@@ -1462,7 +1462,7 @@ def main():
577
+         tests = filter( ignore_test, tests )
578
+ 
579
+     if not tests:
580
+-        print "warning: no tests specified"
581
++        print("warning: no tests specified")
582
+         return
583
+ 
584
+     if options.with_cleanbb:
585
+Index: mongodb-src-r3.6.8/buildscripts/utils.py
586
+===================================================================
587
+--- mongodb-src-r3.6.8.orig/buildscripts/utils.py
588
++++ mongodb-src-r3.6.8/buildscripts/utils.py
589
+@@ -122,7 +122,7 @@ def getprocesslist():
590
+     raw = ""
591
+     try:
592
+         raw = execsys( "/bin/ps axww" )[0]
593
+-    except Exception,e:
594
++    except Exception as e:
595
+         print( "can't get processlist: " + str( e ) )
596
+ 
597
+     r = re.compile( "[\r\n]+" )
598
+@@ -176,7 +176,7 @@ def didMongodStart( port=27017 , timeout
599
+         try:
600
+             checkMongoPort( port )
601
+             return True
602
+-        except Exception,e:
603
++        except Exception as e:
604
+             print( e )
605
+             timeout = timeout - 1
606
+     return False
607
+Index: mongodb-src-r3.6.8/SConstruct
608
+===================================================================
609
+--- mongodb-src-r3.6.8.orig/SConstruct
610
++++ mongodb-src-r3.6.8/SConstruct
611
+@@ -388,7 +388,7 @@ win_version_min_choices = {
612
+ }
613
+ 
614
+ add_option('win-version-min',
615
+-    choices=win_version_min_choices.keys(),
616
++    choices=list(win_version_min_choices.keys()),
617
+     default=None,
618
+     help='minimum Windows version to support',
619
+     type='choice',
620
+@@ -497,7 +497,7 @@ except ValueError as e:
621
+ def variable_shlex_converter(val):
622
+     # If the argument is something other than a string, propogate
623
+     # it literally.
624
+-    if not isinstance(val, basestring):
625
++    if not isinstance(val, str):
626
+         return val
627
+     parse_mode = get_option('variable-parse-mode')
628
+     if parse_mode == 'auto':
629
+@@ -751,7 +751,8 @@ env_vars.Add('TOOLS',
630
+ 
631
+ env_vars.Add('VARIANT_DIR',
632
+     help='Sets the name (or generator function) for the variant directory',
633
+-    default=mongo_generators.default_variant_dir_generator,
634
++#    default=mongo_generators.default_variant_dir_generator,
635
++    default="blah",
636
+ )
637
+ 
638
+ env_vars.Add('VERBOSE',
639
+@@ -826,7 +827,7 @@ SConsignFile(str(sconsDataDir.File('scon
640
+ def printLocalInfo():
641
+     import sys, SCons
642
+     print( "scons version: " + SCons.__version__ )
643
+-    print( "python version: " + " ".join( [ `i` for i in sys.version_info ] ) )
644
++    print( "python version: " + " ".join( [ str(i) for i in sys.version_info ] ) )
645
+ 
646
+ printLocalInfo()
647
+ 
648
+@@ -1938,7 +1939,7 @@ def doConfigure(myenv):
649
+         # to make them real errors.
650
+         cloned.Append(CCFLAGS=['-Werror'])
651
+         conf = Configure(cloned, help=False, custom_tests = {
652
+-                'CheckFlag' : lambda(ctx) : CheckFlagTest(ctx, tool, extension, flag)
653
++                'CheckFlag' : lambda ctx : CheckFlagTest(ctx, tool, extension, flag)
654
+         })
655
+         available = conf.CheckFlag()
656
+         conf.Finish()
657
+Index: mongodb-src-r3.6.8/site_scons/libdeps.py
658
+===================================================================
659
+--- mongodb-src-r3.6.8.orig/site_scons/libdeps.py
660
++++ mongodb-src-r3.6.8/site_scons/libdeps.py
661
+@@ -122,7 +122,7 @@ def __get_libdeps(node):
662
+                 marked.add(n.target_node)
663
+                 tsorted.append(n.target_node)
664
+ 
665
+-            except DependencyCycleError, e:
666
++            except DependencyCycleError as e:
667
+                 if len(e.cycle_nodes) == 1 or e.cycle_nodes[0] != e.cycle_nodes[-1]:
668
+                     e.cycle_nodes.insert(0, n.target_node)
669
+                 raise
670
+@@ -150,7 +150,7 @@ def __get_syslibdeps(node):
671
+         for lib in __get_libdeps(node):
672
+             for syslib in node.get_env().Flatten(lib.get_env().get(syslibdeps_env_var, [])):
673
+                 if syslib:
674
+-                    if type(syslib) in (str, unicode) and syslib.startswith(missing_syslibdep):
675
++                    if type(syslib) in (bytes, str) and syslib.startswith(missing_syslibdep):
676
+                         print("Target '%s' depends on the availability of a "
677
+                               "system provided library for '%s', "
678
+                               "but no suitable library was found during configuration." %
679
+@@ -209,7 +209,7 @@ def get_syslibdeps(source, target, env,
680
+         # they're believed to represent library short names, that should be prefixed with -l
681
+         # or the compiler-specific equivalent.  I.e., 'm' becomes '-lm', but 'File("m.a") is passed
682
+         # through whole cloth.
683
+-        if type(d) in (str, unicode):
684
++        if type(d) in (bytes, str):
685
+             result.append('%s%s%s' % (lib_link_prefix, d, lib_link_suffix))
686
+         else:
687
+             result.append(d)
688
+Index: mongodb-src-r3.6.8/site_scons/mongo/generators.py
689
+===================================================================
690
+--- mongodb-src-r3.6.8.orig/site_scons/mongo/generators.py
691
++++ mongodb-src-r3.6.8/site_scons/mongo/generators.py
692
+@@ -1,6 +1,6 @@
693
+ # -*- mode: python; -*-
694
+ 
695
+-import md5
696
++from hashlib import md5
697
+ 
698
+ # Default and alternative generator definitions go here.
699
+ 
700
+@@ -44,7 +44,7 @@ def default_variant_dir_generator(target
701
+ 
702
+     # Hash the named options and their values, and take the first 8 characters of the hash as
703
+     # the variant name
704
+-    hasher = md5.md5()
705
++    hasher = md5()
706
+     for option in variant_options:
707
+         hasher.update(option)
708
+         hasher.update(str(env.GetOption(option)))
709
+Index: mongodb-src-r3.6.8/site_scons/mongo/__init__.py
710
+===================================================================
711
+--- mongodb-src-r3.6.8.orig/site_scons/mongo/__init__.py
712
++++ mongodb-src-r3.6.8/site_scons/mongo/__init__.py
713
+@@ -5,4 +5,4 @@
714
+ def print_build_failures():
715
+     from SCons.Script import GetBuildFailures
716
+     for bf in GetBuildFailures():
717
+-        print "%s failed: %s" % (bf.node, bf.errstr)
718
++        print("%s failed: %s" % (bf.node, bf.errstr))
719
+Index: mongodb-src-r3.6.8/site_scons/site_tools/distsrc.py
720
+===================================================================
721
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/distsrc.py
722
++++ mongodb-src-r3.6.8/site_scons/site_tools/distsrc.py
723
+@@ -20,7 +20,10 @@ import shutil
724
+ import tarfile
725
+ import time
726
+ import zipfile
727
+-import StringIO
728
++try:
729
++    import StringIO
730
++except ImportError:
731
++    from io import StringIO
732
+ 
733
+ from distutils.spawn import find_executable
734
+ 
735
+@@ -82,7 +85,7 @@ class DistSrcTarArchive(DistSrcArchive):
736
+ 
737
+     def append_file_contents(self, filename, file_contents,
738
+             mtime=time.time(),
739
+-            mode=0644,
740
++            mode=0o644,
741
+             uname="root",
742
+             gname="root"):
743
+         file_metadata = tarfile.TarInfo(name=filename)
744
+@@ -119,7 +122,7 @@ class DistSrcZipArchive(DistSrcArchive):
745
+             name=key,
746
+             size=item_data.file_size,
747
+             mtime=time.mktime(fixed_time),
748
+-            mode=0775 if is_dir else 0664,
749
++            mode=0o775 if is_dir else 0o664,
750
+             type=tarfile.DIRTYPE if is_dir else tarfile.REGTYPE,
751
+             uid=0,
752
+             gid=0,
753
+@@ -129,7 +132,7 @@ class DistSrcZipArchive(DistSrcArchive):
754
+ 
755
+     def append_file_contents(self, filename, file_contents,
756
+             mtime=time.time(),
757
+-            mode=0644,
758
++            mode=0o644,
759
+             uname="root",
760
+             gname="root"):
761
+         self.archive_file.writestr(filename, file_contents)
762
+@@ -139,7 +142,7 @@ class DistSrcZipArchive(DistSrcArchive):
763
+ 
764
+ def build_error_action(msg):
765
+     def error_stub(target=None, source=None, env=None):
766
+-        print msg
767
++        print(msg)
768
+         env.Exit(1)
769
+     return [ error_stub ]
770
+ 
771
+@@ -162,7 +165,7 @@ def distsrc_action_generator(source, tar
772
+ 
773
+     target_ext = str(target[0])[-3:]
774
+     if not target_ext in [ 'zip', 'tar' ]:
775
+-        print "Invalid file format for distsrc. Must be tar or zip file"
776
++        print("Invalid file format for distsrc. Must be tar or zip file")
777
+         env.Exit(1)
778
+ 
779
+     git_cmd = "\"%s\" archive --format %s --output %s --prefix ${MONGO_DIST_SRC_PREFIX} HEAD" % (
780
+Index: mongodb-src-r3.6.8/site_scons/site_tools/idl_tool.py
781
+===================================================================
782
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/idl_tool.py
783
++++ mongodb-src-r3.6.8/site_scons/site_tools/idl_tool.py
784
+@@ -47,7 +47,8 @@ def idl_scanner(node, env, path):
785
+ 
786
+     deps_list = deps_str.splitlines()
787
+ 
788
+-    nodes_deps_list = [ env.File(d) for d in deps_list]
789
++    # scons likes ascii encoded "files" so lets provide one to it...
790
++    nodes_deps_list = [ env.File(d.decode("ascii", "ignore")) for d in deps_list]
791
+     nodes_deps_list.extend(env.Glob('#buildscripts/idl/*.py'))
792
+     nodes_deps_list.extend(env.Glob('#buildscripts/idl/idl/*.py'))
793
+ 
794
+Index: mongodb-src-r3.6.8/site_scons/site_tools/jstoh.py
795
+===================================================================
796
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/jstoh.py
797
++++ mongodb-src-r3.6.8/site_scons/site_tools/jstoh.py
798
+@@ -39,17 +39,17 @@ def jsToHeader(target, source):
799
+ 
800
+     text = '\n'.join(h)
801
+ 
802
+-    print "writing: %s" % outFile
803
++    print( "writing: %s" % outFile)
804
+     with open(outFile, 'wb') as out:
805
+         try:
806
+-            out.write(text)
807
++            out.write(text.encode(encoding='utf_8',errors='strict'))
808
+         finally:
809
+             out.close()
810
+ 
811
+ 
812
+ if __name__ == "__main__":
813
+     if len(sys.argv) < 3:
814
+-        print "Must specify [target] [source] "
815
++        print("Must specify [target] [source] ")
816
+         sys.exit(1)
817
+ 
818
+     jsToHeader(sys.argv[1], sys.argv[2:])
819
+Index: mongodb-src-r3.6.8/site_scons/site_tools/mongo_integrationtest.py
820
+===================================================================
821
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/mongo_integrationtest.py
822
++++ mongodb-src-r3.6.8/site_scons/site_tools/mongo_integrationtest.py
823
+@@ -15,7 +15,7 @@ def integration_test_list_builder_action
824
+     ofile = open(str(target[0]), 'wb')
825
+     try:
826
+         for s in _integration_tests:
827
+-            print '\t' + str(s)
828
++            print('\t' + str(s))
829
+             ofile.write('%s\n' % s)
830
+     finally:
831
+         ofile.close()
832
+Index: mongodb-src-r3.6.8/site_scons/site_tools/mongo_unittest.py
833
+===================================================================
834
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/mongo_unittest.py
835
++++ mongodb-src-r3.6.8/site_scons/site_tools/mongo_unittest.py
836
+@@ -14,7 +14,7 @@ def unit_test_list_builder_action(env, t
837
+     ofile = open(str(target[0]), 'wb')
838
+     try:
839
+         for s in _unittests:
840
+-            print '\t' + str(s)
841
++            print('\t' + str(s))
842
+             ofile.write('%s\n' % s)
843
+     finally:
844
+         ofile.close()
845
+Index: mongodb-src-r3.6.8/site_scons/site_tools/thin_archive.py
846
+===================================================================
847
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/thin_archive.py
848
++++ mongodb-src-r3.6.8/site_scons/site_tools/thin_archive.py
849
+@@ -41,7 +41,7 @@ def exists(env):
850
+     for line in pipe.stdout:
851
+         if isgnu:
852
+             continue  # consume all data
853
+-        isgnu = re.search(r'^GNU ar', line)
854
++        isgnu = re.search(r'^GNU ar', str(line))
855
+ 
856
+     return bool(isgnu)
857
+ 
858
+Index: mongodb-src-r3.6.8/src/mongo/base/generate_error_codes.py
859
+===================================================================
860
+--- mongodb-src-r3.6.8.orig/src/mongo/base/generate_error_codes.py
861
++++ mongodb-src-r3.6.8/src/mongo/base/generate_error_codes.py
862
+@@ -94,7 +94,7 @@ def main(argv):
863
+                 )
864
+ 
865
+         with open(output, 'wb') as outfile:
866
+-            outfile.write(text)
867
++            outfile.write(bytes(text,encoding='utf-8'))
868
+ 
869
+ def die(message=None):
870
+     sys.stderr.write(message or "Fatal error\n")
871
+Index: mongodb-src-r3.6.8/src/mongo/db/auth/generate_action_types.py
872
+===================================================================
873
+--- mongodb-src-r3.6.8.orig/src/mongo/db/auth/generate_action_types.py
874
++++ mongodb-src-r3.6.8/src/mongo/db/auth/generate_action_types.py
875
+@@ -227,7 +227,7 @@ def hasDuplicateActionTypes(actionTypes)
876
+     prevActionType = sortedActionTypes[0]
877
+     for actionType in sortedActionTypes[1:]:
878
+         if actionType == prevActionType:
879
+-            print 'Duplicate actionType %s\n' % actionType
880
++            print('Duplicate actionType %s\n' % actionType)
881
+             didFail = True
882
+         prevActionType = actionType
883
+ 
884
+@@ -240,7 +240,7 @@ def parseActionTypesFromFile(actionTypes
885
+ 
886
+ if __name__ == "__main__":
887
+     if len(sys.argv) != 4:
888
+-        print "Usage: generate_action_types.py <path to action_types.txt> <header file path> <source file path>"
889
++        print("Usage: generate_action_types.py <path to action_types.txt> <header file path> <source file path>")
890
+         sys.exit(-1)
891
+ 
892
+     actionTypes = parseActionTypesFromFile(sys.argv[1])
893
+Index: mongodb-src-r3.6.8/src/mongo/db/fts/generate_stop_words.py
894
+===================================================================
895
+--- mongodb-src-r3.6.8.orig/src/mongo/db/fts/generate_stop_words.py
896
++++ mongodb-src-r3.6.8/src/mongo/db/fts/generate_stop_words.py
897
+@@ -19,39 +19,47 @@ namespace fts {
898
+   void loadStopWordMap( StringMap< std::set< std::string > >* m );
899
+ }
900
+ }
901
+-""" )
902
++""".encode(encoding='utf_8',errors='strict') )
903
+     out.close()
904
+ 
905
+ 
906
+ 
907
+     out = open( source, "wb" )
908
+-    out.write( '#include "%s"' % header.rpartition( "/" )[2].rpartition( "\\" )[2] )
909
++    tmp_buf = '#include "%s"' % header.rpartition( "/" )[2].rpartition( "\\" )[2]
910
++    out.write( tmp_buf.encode(encoding='utf_8',errors='strict') )
911
++
912
++
913
+     out.write( """
914
+ namespace mongo {
915
+ namespace fts {
916
+ 
917
+   void loadStopWordMap( StringMap< std::set< std::string > >* m ) {
918
+-
919
+-""" )
920
++""".encode(encoding='utf_8',errors='strict') )
921
+ 
922
+     for l_file in language_files:
923
+         l = l_file.rpartition( "_" )[2].partition( "." )[0]
924
+ 
925
+-        out.write( '  // %s\n' % l_file )
926
+-        out.write( '  {\n' )
927
+-        out.write( '   const char* const words[] = {\n' )
928
++        tmp_buf = """  // %s
929
++  {
930
++   const char* const words[] = {
931
++""" % l_file
932
++        out.write( tmp_buf.encode(encoding='utf_8',errors='strict') )
933
+         for word in open( l_file, "rb" ):
934
+-            out.write( '       "%s",\n' % word.strip() )
935
+-        out.write( '   };\n' )
936
+-        out.write( '   const size_t wordcnt = sizeof(words) / sizeof(words[0]);\n' )
937
+-        out.write( '   std::set< std::string >& l = (*m)["%s"];\n' % l )
938
+-        out.write( '   l.insert(&words[0], &words[wordcnt]);\n' )
939
+-        out.write( '  }\n' )
940
++            out.write( '       "%s",\n'.encode(encoding='utf_8',errors='strict') % word.strip() )
941
++        tmp_buf="""
942
++   };
943
++   const size_t wordcnt = sizeof(words) / sizeof(words[0]);
944
++   std::set< std::string >& l = (*m)["%s"];
945
++   l.insert(&words[0], &words[wordcnt]);
946
++  }
947
++
948
++"""  % l
949
++        out.write( tmp_buf.encode(encoding='utf_8',errors='strict') )
950
+     out.write( """
951
+   }
952
+ } // namespace fts
953
+ } // namespace mongo
954
+-""" )
955
++""".encode(encoding='utf_8',errors='strict') )
956
+ 
957
+ 
958
+ if __name__ == "__main__":
959
+Index: mongodb-src-r3.6.8/src/mongo/db/fts/unicode/gen_casefold_map.py
960
+===================================================================
961
+--- mongodb-src-r3.6.8.orig/src/mongo/db/fts/unicode/gen_casefold_map.py
962
++++ mongodb-src-r3.6.8/src/mongo/db/fts/unicode/gen_casefold_map.py
963
+@@ -22,7 +22,7 @@ def generate(unicode_casefold_file, targ
964
+ 
965
+     case_mappings = {}
966
+ 
967
+-    cf_file = open(unicode_casefold_file, 'rU')
968
++    cf_file = open(unicode_casefold_file, 'rU',encoding="utf-8")
969
+ 
970
+     for line in cf_file:
971
+         # Filter out blank lines and lines that start with #
972
+Index: mongodb-src-r3.6.8/src/mongo/db/query/collation/generate_icu_init_cpp.py
973
+===================================================================
974
+--- mongodb-src-r3.6.8.orig/src/mongo/db/query/collation/generate_icu_init_cpp.py
975
++++ mongodb-src-r3.6.8/src/mongo/db/query/collation/generate_icu_init_cpp.py
976
+@@ -83,8 +83,8 @@ def generate_cpp_file(data_file_path, cp
977
+ #include "mongo/base/init.h"
978
+ #include "mongo/util/assert_util.h"
979
+ 
980
+-namespace mongo {
981
+-namespace {
982
++namespace mongo {{
983
++namespace {{
984
+ 
985
+ // alignas() is used here to ensure 16-alignment of ICU data.  See the following excerpt from the
986
+ // ICU user guide (<http://userguide.icu-project.org/icudata#TOC-Alignment>):
987
+@@ -95,24 +95,23 @@ namespace {
988
+ // n-alignment of types of size n bytes (and crash on unaligned reads), other CPUs usually operate
989
+ // faster on data that is aligned properly.  Some of the ICU code explicitly checks for proper
990
+ // alignment."
991
+-alignas(16) const uint8_t kRawData[] = {%(decimal_encoded_data)s};
992
++alignas(16) const uint8_t kRawData[] = {{ {decimal_encoded_data} }};
993
++}}  // namespace
994
+ 
995
+-}  // namespace
996
+-
997
+-MONGO_INITIALIZER(LoadICUData)(InitializerContext* context) {
998
++MONGO_INITIALIZER(LoadICUData)(InitializerContext* context) {{
999
+     UErrorCode status = U_ZERO_ERROR;
1000
+     udata_setCommonData(kRawData, &status);
1001
+     fassert(40088, U_SUCCESS(status));
1002
+     return Status::OK();
1003
+-}
1004
++}}
1005
+ 
1006
+-}  // namespace mongo
1007
++}}  // namespace mongo
1008
+ '''
1009
+     decimal_encoded_data = ''
1010
+     with open(data_file_path, 'rb') as data_file:
1011
+-        decimal_encoded_data = ','.join([str(ord(byte)) for byte in data_file.read()])
1012
++        decimal_encoded_data = ','.join([str(byte) for byte in data_file.read()])
1013
+     with open(cpp_file_path, 'wb') as cpp_file:
1014
+-        cpp_file.write(source_template % dict(decimal_encoded_data=decimal_encoded_data))
1015
+-
1016
++        tmp_buf = source_template.format(decimal_encoded_data=decimal_encoded_data)
1017
++        cpp_file.write(tmp_buf.encode(encoding='utf_8',errors='strict'))
1018
+ if __name__ == '__main__':
1019
+     main(sys.argv)
1020
+Index: mongodb-src-r3.6.8/src/mongo/SConscript
1021
+===================================================================
1022
+--- mongodb-src-r3.6.8.orig/src/mongo/SConscript
1023
++++ mongodb-src-r3.6.8/src/mongo/SConscript
1024
+@@ -157,7 +157,7 @@ js_engine_ver = get_option("js-engine")
1025
+ 
1026
+ # On windows, we need to escape the backslashes in the command-line
1027
+ # so that windows paths look okay.
1028
+-cmd_line = " ".join(sys.argv).encode('string-escape')
1029
++cmd_line = " ".join(sys.argv).encode('unicode_escape')
1030
+ if env.TargetOSIs('windows'):
1031
+     cmd_line = cmd_line.replace('\\', r'\\')
1032
+ 
1033
+@@ -604,7 +604,7 @@ env.Append(MODULE_BANNERS = [distsrc.Fil
1034
+                              distsrc.File('MPL-2')])
1035
+ 
1036
+ # If no module has introduced a file named LICENSE.txt, then inject the AGPL.
1037
+-if sum(itertools.imap(lambda x: x.name == "LICENSE.txt", env['MODULE_BANNERS'])) == 0:
1038
++if sum(map(lambda x: x.name == "LICENSE.txt", env['MODULE_BANNERS'])) == 0:
1039
+     env.Append(MODULE_BANNERS = [distsrc.File('GNU-AGPL-3.0')])
1040
+ 
1041
+ # All module banners get staged to the top level of the tarfile, so we
1042
+Index: mongodb-src-r3.6.8/src/mongo/SConscript.orig
1043
+===================================================================
1044
+--- /dev/null
1045
++++ mongodb-src-r3.6.8/src/mongo/SConscript.orig
1046
+@@ -0,0 +1,706 @@
1047
++# -*- mode: python; -*-
1048
++
1049
++# This SConscript describes build rules for the "mongo" project.
1050
++
1051
++import itertools
1052
++import os
1053
++import re
1054
++import sys
1055
++from buildscripts import utils
1056
++
1057
++Import("env")
1058
++Import("has_option")
1059
++Import("get_option")
1060
++Import("usemozjs")
1061
++Import("use_system_version_of_library")
1062
++
1063
++env = env.Clone()
1064
++
1065
++env.InjectMongoIncludePaths()
1066
++
1067
++env.SConscript(
1068
++    dirs=[
1069
++        'base',
1070
++        'bson',
1071
++        'client',
1072
++        'crypto',
1073
++        'db',
1074
++        'dbtests',
1075
++        'executor',
1076
++        'idl',
1077
++        'installer',
1078
++        'logger',
1079
++        'platform',
1080
++        'rpc',
1081
++        's',
1082
++        'scripting',
1083
++        'shell',
1084
++        'tools',
1085
++        'transport',
1086
++        'unittest',
1087
++        'util',
1088
++    ],
1089
++    exports=[
1090
++        'env',
1091
++    ],
1092
++)
1093
++
1094
++# NOTE: This library does not really belong here. Its presence here is
1095
++# temporary. Do not add to this library, do not remove from it, and do
1096
++# not declare other libraries in this file.
1097
++
1098
++baseSource=[
1099
++    'base/data_range.cpp',
1100
++    'base/data_range_cursor.cpp',
1101
++    'base/data_type.cpp',
1102
++    'base/data_type_string_data.cpp',
1103
++    'base/data_type_terminated.cpp',
1104
++    'base/error_codes.cpp',
1105
++    'base/global_initializer.cpp',
1106
++    'base/global_initializer_registerer.cpp',
1107
++    'base/init.cpp',
1108
++    'base/initializer.cpp',
1109
++    'base/initializer_context.cpp',
1110
++    'base/initializer_dependency_graph.cpp',
1111
++    'base/make_string_vector.cpp',
1112
++    'base/parse_number.cpp',
1113
++    'base/simple_string_data_comparator.cpp',
1114
++    'base/status.cpp',
1115
++    'base/string_data.cpp',
1116
++    'base/validate_locale.cpp',
1117
++    'bson/bson_comparator_interface_base.cpp',
1118
++    'bson/bson_depth.cpp',
1119
++    'bson/bson_validate.cpp',
1120
++    'bson/bsonelement.cpp',
1121
++    'bson/bsonmisc.cpp',
1122
++    'bson/bsonobj.cpp',
1123
++    'bson/bsonobjbuilder.cpp',
1124
++    'bson/bsontypes.cpp',
1125
++    'bson/json.cpp',
1126
++    'bson/oid.cpp',
1127
++    'bson/simple_bsonelement_comparator.cpp',
1128
++    'bson/simple_bsonobj_comparator.cpp',
1129
++    'bson/timestamp.cpp',
1130
++    'logger/component_message_log_domain.cpp',
1131
++    'logger/console.cpp',
1132
++    'logger/log_component.cpp',
1133
++    'logger/log_component_settings.cpp',
1134
++    'logger/log_manager.cpp',
1135
++    'logger/log_severity.cpp',
1136
++    'logger/logger.cpp',
1137
++    'logger/logstream_builder.cpp',
1138
++    'logger/max_log_size.cpp',
1139
++    'logger/message_event_utf8_encoder.cpp',
1140
++    'logger/message_log_domain.cpp',
1141
++    'logger/ramlog.cpp',
1142
++    'logger/redaction.cpp',
1143
++    'logger/rotatable_file_manager.cpp',
1144
++    'logger/rotatable_file_writer.cpp',
1145
++    'platform/decimal128.cpp',
1146
++    'platform/posix_fadvise.cpp',
1147
++    'platform/process_id.cpp',
1148
++    'platform/random.cpp',
1149
++    'platform/shared_library.cpp',
1150
++    'platform/shared_library_${TARGET_OS_FAMILY}.cpp',
1151
++    'platform/stack_locator.cpp',
1152
++    'platform/stack_locator_${TARGET_OS}.cpp',
1153
++    'platform/strcasestr.cpp',
1154
++    'platform/strnlen.cpp',
1155
++    'util/allocator.cpp',
1156
++    'util/assert_util.cpp',
1157
++    'util/base64.cpp',
1158
++    'util/concurrency/idle_thread_block.cpp',
1159
++    'util/concurrency/thread_name.cpp',
1160
++    'util/duration.cpp',
1161
++    'util/errno_util.cpp',
1162
++    'util/exception_filter_win32.cpp',
1163
++    'util/exit.cpp',
1164
++    'util/file.cpp',
1165
++    'util/hex.cpp',
1166
++    'util/itoa.cpp',
1167
++    'util/log.cpp',
1168
++    'util/platform_init.cpp',
1169
++    'util/signal_handlers_synchronous.cpp',
1170
++    'util/stacktrace.cpp',
1171
++    'util/stacktrace_${TARGET_OS_FAMILY}.cpp',
1172
++    'util/startup_test.cpp',
1173
++    'util/stringutils.cpp',
1174
++    'util/system_clock_source.cpp',
1175
++    'util/system_tick_source.cpp',
1176
++    'util/text.cpp',
1177
++    'util/time_support.cpp',
1178
++    'util/timer.cpp',
1179
++    'util/version.cpp',
1180
++]
1181
++
1182
++baseLibDeps=[
1183
++    # NOTE: This library *must not* depend on any libraries than
1184
++    # the ones declared here. Do not add to this list.
1185
++    '$BUILD_DIR/third_party/murmurhash3/murmurhash3',
1186
++    '$BUILD_DIR/third_party/shim_allocator',
1187
++    '$BUILD_DIR/third_party/shim_boost',
1188
++    '$BUILD_DIR/third_party/shim_intel_decimal128',
1189
++    '$BUILD_DIR/third_party/shim_pcrecpp',
1190
++    '$BUILD_DIR/third_party/shim_tz',
1191
++    'util/debugger',
1192
++    'util/quick_exit',
1193
++]
1194
++
1195
++env.Library(
1196
++    target='base',
1197
++    source=baseSource,
1198
++    LIBDEPS=baseLibDeps,
1199
++)
1200
++
1201
++js_engine_ver = get_option("js-engine") if get_option("server-js") == "on" else "none"
1202
++
1203
++# On windows, we need to escape the backslashes in the command-line
1204
++# so that windows paths look okay.
1205
++cmd_line = " ".join(sys.argv).encode('string-escape')
1206
++if env.TargetOSIs('windows'):
1207
++    cmd_line = cmd_line.replace('\\', r'\\')
1208
++
1209
++module_list = '{ %s }' % ', '.join([ '"{0}"'.format(x) for x in env['MONGO_MODULES'] ])
1210
++
1211
++# This generates a numeric representation of the version string so that
1212
++# you can easily compare versions of MongoDB without having to parse
1213
++# the version string.
1214
++#
1215
++# The rules for this are
1216
++# {major}{minor}{release}{pre/rc/final}
1217
++# If the version is pre-release and not an rc, the final number is 0
1218
++# If the version is an RC, the final number of 1 + rc number
1219
++# If the version is pre-release between RC's, the final number is 1 + rc number
1220
++# If the version is a final release, the final number is 99
1221
++#
1222
++# Examples:
1223
++# 3.1.1-123     = 3010100
1224
++# 3.1.1-rc2     = 3010103
1225
++# 3.1.1-rc2-123 = 3010103
1226
++# 3.1.1         = 3010199
1227
++#
1228
++version_parts = [ x for x in re.match(r'^(\d+)\.(\d+)\.(\d+)-?((?:(rc)(\d+))?.*)?',
1229
++    env['MONGO_VERSION']).groups() ]
1230
++version_extra = version_parts[3] if version_parts[3] else ""
1231
++if version_parts[4] == 'rc':
1232
++    version_parts[3] = int(version_parts[5]) + -50
1233
++elif version_parts[3]:
1234
++    version_parts[2] = int(version_parts[2]) + 1
1235
++    version_parts[3] = -100
1236
++else:
1237
++    version_parts[3] = 0
1238
++version_parts = [ int(x) for x in version_parts[:4]]
1239
++
1240
++# This turns the MONGO_BUILDINFO_ENVIRONMENT_DATA tuples into a std::vector of
1241
++# std::tuple<string, string, bool, bool>.
1242
++buildInfoInitializer = []
1243
++for tup in env['MONGO_BUILDINFO_ENVIRONMENT_DATA']:
1244
++    def pyToCXXBool(val):
1245
++        return "true" if val else "false"
1246
++    def wrapInQuotes(val):
1247
++        return '"{0}"'.format(val)
1248
++    buildInfoInitializer.append(
1249
++        'std::make_tuple({0})'.format(', '.join(
1250
++            (
1251
++                wrapInQuotes(tup[0]),
1252
++                wrapInQuotes(env.subst(tup[1])),
1253
++                pyToCXXBool(tup[2]),
1254
++                pyToCXXBool(tup[3]),
1255
++            )
1256
++        ))
1257
++    )
1258
++buildInfoInitializer = '{{ {0} }}'.format(', '.join(buildInfoInitializer))
1259
++
1260
++generatedVersionFile = env.Substfile(
1261
++    'util/version_constants.h.in',
1262
++    SUBST_DICT=[
1263
++        ('@mongo_version@', env['MONGO_VERSION']),
1264
++        ('@mongo_version_major@', version_parts[0]),
1265
++        ('@mongo_version_minor@', version_parts[1]),
1266
++        ('@mongo_version_patch@', version_parts[2]),
1267
++        ('@mongo_version_extra@', version_parts[3]),
1268
++        ('@mongo_version_extra_str@', version_extra),
1269
++        ('@mongo_git_hash@', env['MONGO_GIT_HASH']),
1270
++        ('@buildinfo_js_engine@', js_engine_ver),
1271
++        ('@buildinfo_allocator@', env['MONGO_ALLOCATOR']),
1272
++        ('@buildinfo_modules@', module_list),
1273
++        ('@buildinfo_environment_data@', buildInfoInitializer),
1274
++    ])
1275
++env.Alias('generated-sources', generatedVersionFile)
1276
++
1277
++if env.TargetOSIs('windows'):
1278
++    enterpriseEnv = env.Clone().InjectModule("enterprise")
1279
++    generatedResourceConstantFile = enterpriseEnv.Substfile(
1280
++        'util/resource_constants.h.in',
1281
++        SUBST_DICT=[
1282
++            ('@mongo_version@', env['MONGO_VERSION']),
1283
++            ('@mongo_version_major@', version_parts[0]),
1284
++            ('@mongo_version_minor@', version_parts[1]),
1285
++            ('@mongo_version_patch@', version_parts[2]),
1286
++            ('@mongo_git_hash@', env['MONGO_GIT_HASH']),
1287
++        ])
1288
++    env.Alias('generated-sources', generatedResourceConstantFile)
1289
++
1290
++config_header_substs = (
1291
++    ('@mongo_config_byte_order@', 'MONGO_CONFIG_BYTE_ORDER'),
1292
++    ('@mongo_config_debug_build@', 'MONGO_CONFIG_DEBUG_BUILD'),
1293
++    ('@mongo_config_have_execinfo_backtrace@', 'MONGO_CONFIG_HAVE_EXECINFO_BACKTRACE'),
1294
++    ('@mongo_config_have_fips_mode_set@', 'MONGO_CONFIG_HAVE_FIPS_MODE_SET'),
1295
++    ('@mongo_config_have_header_unistd_h@', 'MONGO_CONFIG_HAVE_HEADER_UNISTD_H'),
1296
++    ('@mongo_config_have_memset_s@', 'MONGO_CONFIG_HAVE_MEMSET_S'),
1297
++    ('@mongo_config_have_posix_monotonic_clock@', 'MONGO_CONFIG_HAVE_POSIX_MONOTONIC_CLOCK'),
1298
++    ('@mongo_config_have_pthread_setname_np@', 'MONGO_CONFIG_HAVE_PTHREAD_SETNAME_NP'),
1299
++    ('@mongo_config_have_std_enable_if_t@', 'MONGO_CONFIG_HAVE_STD_ENABLE_IF_T'),
1300
++    ('@mongo_config_have_std_make_unique@', 'MONGO_CONFIG_HAVE_STD_MAKE_UNIQUE'),
1301
++    ('@mongo_config_have_strnlen@', 'MONGO_CONFIG_HAVE_STRNLEN'),
1302
++    ('@mongo_config_max_extended_alignment@', 'MONGO_CONFIG_MAX_EXTENDED_ALIGNMENT'),
1303
++    ('@mongo_config_optimized_build@', 'MONGO_CONFIG_OPTIMIZED_BUILD'),
1304
++    ('@mongo_config_ssl@', 'MONGO_CONFIG_SSL'),
1305
++    ('@mongo_config_ssl_has_asn1_any_definitions@', 'MONGO_CONFIG_HAVE_ASN1_ANY_DEFINITIONS'),
1306
++    ('@mongo_config_has_ssl_set_ecdh_auto@', 'MONGO_CONFIG_HAS_SSL_SET_ECDH_AUTO'),
1307
++    ('@mongo_config_wiredtiger_enabled@', 'MONGO_CONFIG_WIREDTIGER_ENABLED'),
1308
++)
1309
++
1310
++def makeConfigHeaderDefine(self, key):
1311
++    val = "// #undef {0}".format(key)
1312
++    if key in self['CONFIG_HEADER_DEFINES']:
1313
++        val = "#define {0} {1}".format(key, self['CONFIG_HEADER_DEFINES'][key])
1314
++    return val
1315
++env.AddMethod(makeConfigHeaderDefine)
1316
++
1317
++generateConfigHeaderFile = env.Substfile(
1318
++    'config.h.in',
1319
++    SUBST_DICT=[(k, env.makeConfigHeaderDefine(v)) for (k, v) in config_header_substs]
1320
++)
1321
++env.Alias('generated-sources', generateConfigHeaderFile)
1322
++
1323
++env.Library(
1324
++    target="mongodmain",
1325
++    source=[
1326
++        "db/db.cpp",
1327
++        "db/mongod_options_init.cpp",
1328
++    ],
1329
++    LIBDEPS=[
1330
++        'db/clientcursor',
1331
++        'db/commands/core',
1332
++        'db/conn_pool_options',
1333
++        'db/dbdirectclient',
1334
++        'db/ftdc/ftdc_mongod',
1335
++        'db/generic_cursor_mongod',
1336
++        'db/index_d',
1337
++        'db/initialize_snmp',
1338
++        'db/keys_collection_manager_direct',
1339
++        'db/kill_sessions_local',
1340
++        'db/logical_session_cache_factory_mongod',
1341
++        'db/mongod_options',
1342
++        'db/mongodandmongos',
1343
++        'db/op_observer_d',
1344
++        'db/repair_database',
1345
++        'db/repl/repl_set_commands',
1346
++        'db/repl/storage_interface_impl',
1347
++        'db/repl/topology_coordinator',
1348
++        'db/s/balancer',
1349
++        'db/serveronly',
1350
++        'db/service_context_d',
1351
++        'db/startup_warnings_mongod',
1352
++        'db/system_index',
1353
++        'db/ttl_d',
1354
++        'executor/network_interface_factory',
1355
++        'rpc/rpc',
1356
++        's/catalog/sharding_catalog_manager',
1357
++        's/commands/shared_cluster_commands',
1358
++        'transport/service_entry_point',
1359
++        'transport/transport_layer_manager',
1360
++        'util/clock_sources',
1361
++        'util/fail_point',
1362
++        'util/ntservice',
1363
++        'util/options_parser/options_parser_init',
1364
++        'util/periodic_runner_factory',
1365
++        'util/version_impl',
1366
++    ],
1367
++)
1368
++
1369
++
1370
++if env.TargetOSIs('windows'):
1371
++    generatedDbManifest = env.Substfile(
1372
++        'db/db.manifest.in',
1373
++        SUBST_DICT=[
1374
++            ('@mongo_version_major@', version_parts[0]),
1375
++            ('@mongo_version_minor@', version_parts[1]),
1376
++            ('@mongo_version_patch@', version_parts[2]),
1377
++            ('@mongo_version_extra@', version_parts[3]),
1378
++            ('@mongo_version_extra_str@', version_extra),
1379
++        ])
1380
++
1381
++    env.Alias('generated-sources', generatedDbManifest)
1382
++    env.Depends("db/db.res", generatedDbManifest)
1383
++
1384
++mongod = env.Program(
1385
++    target="mongod",
1386
++    source=[
1387
++        "db/dbmain.cpp",
1388
++    ] + env.WindowsResourceFile("db/db.rc"),
1389
++    LIBDEPS=[
1390
++        'mongodmain',
1391
++    ],
1392
++)
1393
++env.Default(env.Install('#/', mongod))
1394
++
1395
++# tools
1396
++rewrittenTools = [ "mongodump", "mongorestore", "mongoexport", "mongoimport", "mongostat", "mongotop", "bsondump", "mongofiles" ]
1397
++
1398
++# mongoperf
1399
++env.Install(
1400
++    '#/',
1401
++    [
1402
++        env.Program("mongoperf",
1403
++                    [
1404
++                        "client/examples/mongoperf.cpp",
1405
++                    ] + env.WindowsResourceFile("client/examples/mongoperf.rc"),
1406
++                    LIBDEPS=[
1407
++                        "db/serveronly",
1408
++                    ]),
1409
++    ])
1410
++
1411
++if env.TargetOSIs('windows'):
1412
++    generatedServerManifest = env.Substfile(
1413
++        's/server.manifest.in',
1414
++        SUBST_DICT=[
1415
++            ('@mongo_version_major@', version_parts[0]),
1416
++            ('@mongo_version_minor@', version_parts[1]),
1417
++            ('@mongo_version_patch@', version_parts[2]),
1418
++            ('@mongo_version_extra@', version_parts[3]),
1419
++            ('@mongo_version_extra_str@', version_extra),
1420
++        ])
1421
++
1422
++    env.Alias('generated-sources', generatedServerManifest)
1423
++    env.Depends("s/server.res", generatedServerManifest)
1424
++
1425
++# mongos
1426
++env.Install(
1427
++    '#/',
1428
++    env.Program(
1429
++        target='mongos',
1430
++        source=[
1431
++            's/cluster_cursor_stats.cpp',
1432
++            's/mongos_options.cpp',
1433
++            's/mongos_options_init.cpp',
1434
++            's/s_sharding_server_status.cpp',
1435
++            's/server.cpp',
1436
++            's/service_entry_point_mongos.cpp',
1437
++            's/sharding_uptime_reporter.cpp',
1438
++            's/version_mongos.cpp',
1439
++        ] + env.WindowsResourceFile("s/server.rc"),
1440
++        LIBDEPS=[
1441
++            'db/commands/core',
1442
++            'db/commands/server_status',
1443
++            'db/conn_pool_options',
1444
++            'db/ftdc/ftdc_mongos',
1445
++            'db/generic_cursor_mongos',
1446
++            'db/logical_time_metadata_hook',
1447
++            'db/mongodandmongos',
1448
++            'db/server_options',
1449
++            'db/stats/counters',
1450
++            's/client/sharding_connection_hook',
1451
++            's/commands/cluster_commands',
1452
++            's/commands/shared_cluster_commands',
1453
++            's/coreshard',
1454
++            's/is_mongos',
1455
++            's/sharding_egress_metadata_hook_for_mongos',
1456
++            's/sharding_initialization',
1457
++            'transport/service_entry_point',
1458
++            'transport/transport_layer_manager',
1459
++            'util/clock_sources',
1460
++            'util/fail_point',
1461
++            'util/ntservice',
1462
++            'util/options_parser/options_parser_init',
1463
++            'util/version_impl',
1464
++        ]))
1465
++
1466
++env.Library("linenoise_utf8",
1467
++    source=[
1468
++        "shell/linenoise_utf8.cpp",
1469
++    ])
1470
++
1471
++# --- shell ---
1472
++
1473
++if not has_option('noshell') and usemozjs:
1474
++    shell_core_env = env.Clone()
1475
++    if has_option("safeshell"):
1476
++        shell_core_env.Append(CPPDEFINES=["MONGO_SAFE_SHELL"])
1477
++    shell_core_env.Library("shell_core",
1478
++                source=[
1479
++                    "shell/bench.cpp",
1480
++                    "shell/linenoise.cpp",
1481
++                    "shell/mk_wcwidth.cpp",
1482
++                    "shell/mongo-server.cpp",
1483
++                    "shell/shell_options.cpp",
1484
++                    "shell/shell_options_init.cpp",
1485
++                    "shell/shell_utils.cpp",
1486
++                    "shell/shell_utils_extended.cpp",
1487
++                    "shell/shell_utils_launcher.cpp",
1488
++                ],
1489
++                LIBDEPS=[
1490
++                    'db/logical_session_id_helpers',
1491
++                    'db/catalog/index_key_validate',
1492
++                    'db/query/command_request_response',
1493
++                    'db/query/query_request',
1494
++                    'db/server_options_core',
1495
++                    'linenoise_utf8',
1496
++                    'rpc/protocol',
1497
++                    'scripting/scripting',
1498
++                    'shell/mongojs',
1499
++                    'transport/message_compressor',
1500
++                    'util/net/network',
1501
++                    'util/options_parser/options_parser_init',
1502
++                    'util/processinfo',
1503
++                    'util/signal_handlers',
1504
++                    'util/version_impl',
1505
++                    'executor/thread_pool_task_executor',
1506
++                    'executor/network_interface_thread_pool',
1507
++                    'executor/network_interface_factory'
1508
++                ],
1509
++                # Because `::environ` is resolved in `/usr/lib/crt1.o` on FreeBSD, this library
1510
++                # needs to be marked `incomplete` on FreeBSD.
1511
++                LIBDEPS_TAGS=[] if not env.TargetOSIs('freebsd') else [
1512
++                    'illegal_cyclic_or_unresolved_dependencies_whitelisted',
1513
++                ],
1514
++    )
1515
++
1516
++    shellEnv = env.Clone()
1517
++    if env.TargetOSIs('windows'):
1518
++        shellEnv.Append(LIBS=["winmm.lib"])
1519
++
1520
++        generatedMongoManifest = shellEnv.Substfile(
1521
++                'shell/shell.manifest.in',
1522
++                SUBST_DICT=[
1523
++                    ('@mongo_version_major@', version_parts[0]),
1524
++                    ('@mongo_version_minor@', version_parts[1]),
1525
++                    ('@mongo_version_patch@', version_parts[2]),
1526
++                    ('@mongo_version_extra@', version_parts[3]),
1527
++                    ('@mongo_version_extra_str@', version_extra),
1528
++                ])
1529
++        shellEnv.Alias('generated-sources', generatedMongoManifest)
1530
++        shellEnv.Depends("shell/shell.res", generatedMongoManifest)
1531
++
1532
++    mongo_shell = shellEnv.Program(
1533
++        "mongo",
1534
++        ["shell/dbshell.cpp"] + env.WindowsResourceFile("shell/shell.rc"),
1535
++        LIBDEPS=[
1536
++            "$BUILD_DIR/third_party/shim_pcrecpp",
1537
++            "shell_core",
1538
++            "db/server_options_core",
1539
++            "client/clientdriver",
1540
++            "$BUILD_DIR/mongo/util/password",
1541
++        ],
1542
++        LIBDEPS_PRIVATE=[
1543
++            "$BUILD_DIR/mongo/client/connection_string",
1544
++        ]
1545
++    )
1546
++
1547
++    shellEnv.Install( '#/', mongo_shell )
1548
++else:
1549
++    shellEnv = None
1550
++
1551
++#  ----  INSTALL -------
1552
++
1553
++# binaries
1554
++
1555
++distBinaries = []
1556
++distDebugSymbols = []
1557
++
1558
++def add_exe( v ):
1559
++    return "${PROGPREFIX}%s${PROGSUFFIX}" % v
1560
++
1561
++def failMissingObjCopy(env, target, source):
1562
++    env.FatalError("Generating debug symbols requires objcopy, please set the OBJCOPY variable.")
1563
++
1564
++def installBinary( e, name ):
1565
++    debug_sym_name = name
1566
++    name = add_exe( name )
1567
++
1568
++    debug_sym_cmd = None
1569
++    if e.TargetOSIs('linux', 'solaris'):
1570
++        if 'OBJCOPY' not in e:
1571
++            debug_sym_cmd = failMissingObjCopy
1572
++        else:
1573
++            debug_sym_cmd = '${OBJCOPY} --only-keep-debug ${SOURCE} ${TARGET}'
1574
++        debug_sym_name += '.debug'
1575
++    elif e.TargetOSIs('darwin'):
1576
++        debug_sym_name += '.dSYM'
1577
++        debug_sym_cmd = 'dsymutil -o ${TARGET} ${SOURCE}'
1578
++    elif e.ToolchainIs('msvc'):
1579
++        debug_sym_name += '.pdb'
1580
++        distBinaries.append(debug_sym_name)
1581
++        distDebugSymbols.append(debug_sym_name)
1582
++
1583
++    if debug_sym_cmd:
1584
++        debug_sym = e.Command(
1585
++            debug_sym_name,
1586
++            name,
1587
++            debug_sym_cmd
1588
++        )
1589
++        e.Install("#/", debug_sym)
1590
++        e.Alias('debugsymbols', debug_sym)
1591
++        distDebugSymbols.append(debug_sym)
1592
++
1593
++    if env.TargetOSIs('linux', 'solaris') and (not has_option("nostrip")):
1594
++        strip_cmd = e.Command(
1595
++            'stripped/%s' % name,
1596
++            [name, debug_sym],
1597
++            '${OBJCOPY} --strip-debug --add-gnu-debuglink ${SOURCES[1]} ${SOURCES[0]} $TARGET'
1598
++        )
1599
++        distBinaries.append('stripped/%s' % name)
1600
++    else:
1601
++        distBinaries.append(name)
1602
++
1603
++    inst = e.Install( "$INSTALL_DIR/bin", name )
1604
++
1605
++    if env.TargetOSIs('posix'):
1606
++        e.AddPostAction( inst, 'chmod 755 $TARGET' )
1607
++
1608
++def installExternalBinary( e, name_str ):
1609
++    name = env.File("#/%s" % add_exe(name_str))
1610
++    if not name.isfile():
1611
++        env.FatalError("ERROR: external binary not found: {0}", name)
1612
++
1613
++    distBinaries.append(name)
1614
++    inst = e.Install( "$INSTALL_DIR/bin", name )
1615
++
1616
++    if env.TargetOSIs('posix'):
1617
++        e.AddPostAction( inst, 'chmod 755 $TARGET' )
1618
++
1619
++
1620
++# "--use-new-tools" adds dependencies for rewritten (Go) tools
1621
++# It is required for "dist" but optional for "install"
1622
++if has_option("use-new-tools"):
1623
++    toolsRoot = "src/mongo-tools"
1624
++    for t in rewrittenTools:
1625
++        installExternalBinary(env, "%s/%s" % (toolsRoot, t))
1626
++    if has_option("build-mongoreplay") and get_option("build-mongoreplay") == "true":
1627
++        installExternalBinary(env, "%s/%s" % (toolsRoot, "mongoreplay"))
1628
++
1629
++# legacy tools
1630
++installBinary(env, "mongoperf")
1631
++env.Alias("tools", '#/' + add_exe("mongoperf"))
1632
++
1633
++env.Alias("tools", "#/" + add_exe("mongobridge"))
1634
++
1635
++installBinary( env, "mongod" )
1636
++installBinary( env, "mongos" )
1637
++
1638
++if shellEnv is not None:
1639
++    installBinary( shellEnv, "mongo" )
1640
++    env.Alias( "core", [ '#/%s' % b for b in [ add_exe( "mongo" ) ] ] )
1641
++
1642
++env.Alias( "core", [ '#/%s' % b for b in [ add_exe( "mongod" ), add_exe( "mongos" ) ] ] )
1643
++
1644
++# Stage the top-level mongodb banners
1645
++distsrc = env.Dir('#distsrc')
1646
++env.Append(MODULE_BANNERS = [distsrc.File('README'),
1647
++                             distsrc.File('THIRD-PARTY-NOTICES'),
1648
++                             distsrc.File('MPL-2')])
1649
++
1650
++# If no module has introduced a file named LICENSE.txt, then inject the AGPL.
1651
++if sum(itertools.imap(lambda x: x.name == "LICENSE.txt", env['MODULE_BANNERS'])) == 0:
1652
++    env.Append(MODULE_BANNERS = [distsrc.File('GNU-AGPL-3.0')])
1653
++
1654
++# All module banners get staged to the top level of the tarfile, so we
1655
++# need to fail if we are going to have a name collision.
1656
++module_banner_filenames = set([f.name for f in env['MODULE_BANNERS']])
1657
++if not len(module_banner_filenames) == len(env['MODULE_BANNERS']):
1658
++    # TODO: Be nice and identify conflicts in error.
1659
++    env.FatalError("ERROR: Filename conflicts exist in module banners.")
1660
++
1661
++# Build a set of directories containing module banners, and use that
1662
++# to build a --transform option for each directory so that the files
1663
++# are tar'ed up to the proper location.
1664
++module_banner_dirs = set([Dir('#').rel_path(f.get_dir()) for f in env['MODULE_BANNERS']])
1665
++module_banner_transforms = ["--transform %s=$SERVER_DIST_BASENAME" % d for d in module_banner_dirs]
1666
++
1667
++# Allow modules to map original file name directories to subdirectories
1668
++# within the archive (e.g. { "src/mongo/db/modules/enterprise/docs": "snmp"})
1669
++archive_addition_transforms = []
1670
++for full_dir, archive_dir in env["ARCHIVE_ADDITION_DIR_MAP"].items():
1671
++  archive_addition_transforms.append("--transform \"%s=$SERVER_DIST_BASENAME/%s\"" %
1672
++                                     (full_dir, archive_dir))
1673
++
1674
++for target in env["DIST_BINARIES"]:
1675
++    installBinary(env, "db/modules/" + target)
1676
++
1677
++# Set the download url to the right place
1678
++compass_type = 'compass-community'
1679
++if 'enterprise' in env['MONGO_MODULES']:
1680
++    compass_type = 'compass'
1681
++
1682
++compass_script = "install_compass"
1683
++if env.TargetOSIs('windows'):
1684
++    # On windows the .in needs to be explicitly added to the file.
1685
++    compass_script = "Install-Compass.ps1.in"
1686
++
1687
++compass_python_interpreter = '/usr/bin/env python2'
1688
++if env.TargetOSIs('darwin'):
1689
++    compass_python_interpreter = '/usr/bin/env python'
1690
++
1691
++compass_installer = env.Substfile('#/src/mongo/installer/compass/' + compass_script,
1692
++                                  SUBST_DICT=[
1693
++                                      ('@compass_type@', compass_type),
1694
++                                      ('@python_interpreter@', compass_python_interpreter),
1695
++                                  ])
1696
++distBinaries.append(compass_installer)
1697
++
1698
++compass_script_installer = env.Install("$INSTALL_DIR/bin", compass_installer)
1699
++
1700
++if env.TargetOSIs('posix'):
1701
++    env.AddPostAction( compass_script_installer, 'chmod 755 $TARGET' )
1702
++    env.AddPostAction( compass_installer, 'chmod 755 $TARGET' )
1703
++
1704
++# "dist" target is valid only when --use-new-tools is specified
1705
++# Attempts to build release artifacts without tools must fail
1706
++if has_option("use-new-tools"):
1707
++    env.Command(
1708
++        target='#/${SERVER_ARCHIVE}',
1709
++        source=['#buildscripts/make_archive.py'] + env["MODULE_BANNERS"] + env["ARCHIVE_ADDITIONS"] + distBinaries,
1710
++        action=' '.join(
1711
++            ['$PYTHON ${SOURCES[0]} -o $TARGET'] +
1712
++            archive_addition_transforms +
1713
++            module_banner_transforms +
1714
++            [
1715
++                '--transform $BUILD_DIR/mongo/db/modules/enterprise=$SERVER_DIST_BASENAME/bin',
1716
++                '--transform $BUILD_DIR/mongo/stripped/db/modules/enterprise=$SERVER_DIST_BASENAME/bin',
1717
++                '--transform $BUILD_DIR/mongo/stripped=$SERVER_DIST_BASENAME/bin',
1718
++                '--transform $BUILD_DIR/mongo=$SERVER_DIST_BASENAME/bin',
1719
++                '--transform $BUILD_DIR/mongo/stripped/src/mongo-tools=$SERVER_DIST_BASENAME/bin',
1720
++                '--transform src/mongo-tools=$SERVER_DIST_BASENAME/bin',
1721
++                '--transform src/mongo/installer/compass=$SERVER_DIST_BASENAME/bin',
1722
++                '${TEMPFILE(SOURCES[1:])}'
1723
++            ],
1724
++        ),
1725
++        BUILD_DIR=env.Dir('$BUILD_DIR').path
1726
++    )
1727
++
1728
++    env.Alias("dist", source='#/${SERVER_ARCHIVE}')
1729
++else:
1730
++    def failDist(env, target, source):
1731
++        env.FatalError("ERROR: 'dist' target only valid with --use-new-tools.")
1732
++    env.Alias("dist", [], [ failDist ] )
1733
++    env.AlwaysBuild("dist")
1734
++
1735
++debug_symbols_dist = env.Command(
1736
++    target='#/${SERVER_DIST_BASENAME}-debugsymbols${DIST_ARCHIVE_SUFFIX}',
1737
++    source=['#buildscripts/make_archive.py'] + distDebugSymbols,
1738
++    action=' '.join(
1739
++        [
1740
++            '$PYTHON ${SOURCES[0]} -o $TARGET',
1741
++            '--transform $BUILD_DIR/mongo/db/modules/enterprise=$SERVER_DIST_BASENAME',
1742
++            '--transform $BUILD_DIR/mongo=$SERVER_DIST_BASENAME',
1743
++            '${TEMPFILE(SOURCES[1:])}',
1744
++        ]
1745
++    ),
1746
++    BUILD_DIR=env.Dir('$BUILD_DIR').path
1747
++)
1748
++
1749
++env.Alias('dist-debugsymbols', debug_symbols_dist)
1750
++
1751
++#final alias
1752
++env.Alias( "install", "$INSTALL_DIR" )
1753
+Index: mongodb-src-r3.6.8/src/third_party/wiredtiger/SConstruct
1754
+===================================================================
1755
+--- mongodb-src-r3.6.8.orig/src/third_party/wiredtiger/SConstruct
1756
++++ mongodb-src-r3.6.8/src/third_party/wiredtiger/SConstruct
1757
+@@ -11,7 +11,7 @@ import distutils.sysconfig
1758
+ EnsureSConsVersion( 2, 0, 0 )
1759
+ 
1760
+ if not os.sys.platform == "win32":
1761
+-    print ("SConstruct is only supported for Windows, use build_posix for other platforms")
1762
++    print("SConstruct is only supported for Windows, use build_posix for other platforms")
1763
+     Exit(1)
1764
+ 
1765
+ # Command line options
1766
+@@ -118,7 +118,7 @@ wtlibs = []
1767
+ 
1768
+ conf = Configure(env)
1769
+ if not conf.CheckCHeader('stdlib.h'):
1770
+-    print 'stdlib.h must be installed!'
1771
++    print('stdlib.h must be installed!')
1772
+     Exit(1)
1773
+ 
1774
+ if useZlib:
1775
+@@ -128,7 +128,7 @@ if useZlib:
1776
+         conf.env.Append(CPPDEFINES=["HAVE_BUILTIN_EXTENSION_ZLIB"])
1777
+         wtlibs.append("zlib")
1778
+     else:
1779
+-        print 'zlib.h must be installed!'
1780
++        print('zlib.h must be installed!')
1781
+         Exit(1)
1782
+ 
1783
+ if useSnappy:
1784
+@@ -138,7 +138,7 @@ if useSnappy:
1785
+         conf.env.Append(CPPDEFINES=['HAVE_BUILTIN_EXTENSION_SNAPPY'])
1786
+         wtlibs.append("snappy")
1787
+     else:
1788
+-        print 'snappy-c.h must be installed!'
1789
++        print('snappy-c.h must be installed!')
1790
+         Exit(1)
1791
+ 
1792
+ if useLz4:
1793
+@@ -148,14 +148,14 @@ if useLz4:
1794
+         conf.env.Append(CPPDEFINES=['HAVE_BUILTIN_EXTENSION_LZ4'])
1795
+         wtlibs.append("lz4")
1796
+     else:
1797
+-        print 'lz4.h must be installed!'
1798
++        print('lz4.h must be installed!')
1799
+         Exit(1)
1800
+ 
1801
+ if useBdb:
1802
+     conf.env.Append(CPPPATH=[useBdb+ "/include"])
1803
+     conf.env.Append(LIBPATH=[useBdb+ "/lib"])
1804
+     if not conf.CheckCHeader('db.h'):
1805
+-        print 'db.h must be installed!'
1806
++        print('db.h must be installed!')
1807
+         Exit(1)
1808
+ 
1809
+ if useTcmalloc:
1810
+@@ -166,7 +166,7 @@ if useTcmalloc:
1811
+         conf.env.Append(CPPDEFINES=['HAVE_LIBTCMALLOC'])
1812
+         conf.env.Append(CPPDEFINES=['HAVE_POSIX_MEMALIGN'])
1813
+     else:
1814
+-        print 'tcmalloc.h must be installed!'
1815
++        print('tcmalloc.h must be installed!')
1816
+         Exit(1)
1817
+ 
1818
+ env = conf.Finish()
1819
+@@ -202,7 +202,7 @@ if (VERSION_MAJOR == None or
1820
+     VERSION_MINOR == None or
1821
+     VERSION_PATCH == None or
1822
+     VERSION_STRING == None):
1823
+-    print "Failed to find version variables in " + version_file
1824
++    print("Failed to find version variables in " + version_file)
1825
+     Exit(1)
1826
+ 
1827
+ wiredtiger_includes = """
1828
+@@ -322,7 +322,7 @@ if GetOption("lang-python"):
1829
+     # Check that this version of python is 64-bit
1830
+     #
1831
+     if sys.maxsize < 2**32:
1832
+-        print "The Python Interpreter must be 64-bit in order to build the python bindings"
1833
++        print("The Python Interpreter must be 64-bit in order to build the python bindings")
1834
+         Exit(1)
1835
+ 
1836
+     pythonEnv = env.Clone()
1837
+@@ -436,7 +436,7 @@ examples = [
1838
+ # WiredTiger Smoke Test support
1839
+ # Runs each test in a custom temporary directory
1840
+ def run_smoke_test(x):
1841
+-    print "Running Smoke Test: " + x
1842
++    print("Running Smoke Test: " + x)
1843
+ 
1844
+     # Make temp dir
1845
+     temp_dir = tempfile.mkdtemp(prefix="wt_home")
1846
+Index: mongodb-src-r3.6.8/site_scons/site_tools/mongo_benchmark.py
1847
+===================================================================
1848
+--- mongodb-src-r3.6.8.orig/site_scons/site_tools/mongo_benchmark.py
1849
++++ mongodb-src-r3.6.8/site_scons/site_tools/mongo_benchmark.py
1850
+@@ -14,7 +14,7 @@ def benchmark_list_builder_action(env, t
1851
+     ofile = open(str(target[0]), 'wb')
1852
+     try:
1853
+         for s in _benchmarks:
1854
+-            print '\t' + str(s)
1855
++            print('\t' + str(s))
1856
+             ofile.write('%s\n' % s)
1857
+     finally:
1858
+         ofile.close()
1859
mongodb-3.6.8-fix-syntax.patch Added
21
 
1
@@ -0,0 +1,19 @@
2
+From: Andreas Stieger <astieger@suse.com>
3
+Date: Sun, 20 Jan 2019 11:09:25 +0100
4
+Subject: Fix syntax errors in mongodb 3.68 build scripts
5
+References:
6
+Upstream: no
7
+
8
+Index: mongodb-src-r3.6.8/SConstruct
9
+===================================================================
10
+--- mongodb-src-r3.6.8.orig/SConstruct
11
++++ mongodb-src-r3.6.8/SConstruct
12
+@@ -3117,7 +3117,7 @@ def doConfigure(myenv):
13
+ 
14
+         outputIndex = next((idx for idx in [0,1] if conf.CheckAltivecVbpermqOutput(idx)), None)
15
+         if outputIndex is not None:
16
+-      conf.env.SetConfigHeaderDefine("MONGO_CONFIG_ALTIVEC_VEC_VBPERMQ_OUTPUT_INDEX", outputIndex)
17
++            conf.env.SetConfigHeaderDefine("MONGO_CONFIG_ALTIVEC_VEC_VBPERMQ_OUTPUT_INDEX", outputIndex)
18
+         else:
19
+             myenv.ConfError("Running on ppc64le, but can't find a correct vec_vbpermq output index.  Compiler or platform not supported")
20
+ 
21
mongodb-src-r3.6.8.tar.gz Added
mongodb-tmpfile Added
5
 
1
@@ -0,0 +1,3 @@
2
+# make sure the mongodb dir is owned by mongodb so the process running as
3
+# mongodb can write the pid there
4
+d /run/mongodb 0755 mongodb root -
5
mongodb.conf Added
52
 
1
@@ -0,0 +1,50 @@
2
+# mongod.conf
3
+
4
+# for documentation of all options, see:
5
+#   http://docs.mongodb.org/manual/reference/configuration-options/
6
+
7
+# Where and how to store data.
8
+storage:
9
+  dbPath: /var/lib/mongodb
10
+  journal:
11
+    enabled: true
12
+#  engine:
13
+#  mmapv1:
14
+#  wiredTiger:
15
+
16
+# Where and how to log messages.
17
+systemLog:
18
+  destination: file
19
+  logAppend: true
20
+  path: /var/log/mongodb/mongod.log
21
+  logRotate: reopen
22
+
23
+# What type of connections to allow.
24
+net:
25
+  port: 27017
26
+  bindIp: 127.0.0.1,::1
27
+  ipv6: true
28
+
29
+
30
+# How to manage mongod.
31
+processManagement:
32
+  fork: true
33
+
34
+# Full path to pidfile (if not set, no pidfile is created)
35
+  pidFilePath: /var/run/mongodb/mongod.pid
36
+
37
+# Security settings.
38
+security:
39
+  authorization: enabled
40
+
41
+#operationProfiling:
42
+
43
+#replication:
44
+
45
+#sharding:
46
+
47
+## Enterprise-Only Options:
48
+
49
+#auditLog:
50
+
51
+#snmp:
52
mongodb.init Added
216
 
1
@@ -0,0 +1,214 @@
2
+#!/bin/sh
3
+# Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
4
+#
5
+# Author: Andreas Schneider <asn@cynapses.org>
6
+#
7
+# /etc/init.d/mongodb
8
+#   and its symbolic link
9
+# /(usr/)sbin/rcmongodb
10
+#
11
+# Template system startup script for some example service/daemon mongodb
12
+#
13
+# LSB compatible service control script; see http://www.linuxbase.org/spec/
14
+# 
15
+# Note: This template uses functions rc_XXX defined in /etc/rc.status on
16
+# UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your
17
+# script on this template and ensure that it works on non UL based LSB 
18
+# compliant Linux distributions, you either have to provide the rc.status
19
+# functions from UL or change the script to work without them.
20
+# See skeleton.compat for a template that works with other distros as well.
21
+#
22
+### BEGIN INIT INFO
23
+# Provides:          mongodb
24
+# Required-Start:    $syslog $remote_fs
25
+# Should-Start:      $time ypbind smtp
26
+# Required-Stop:     $syslog $remote_fs
27
+# Should-Stop:       ypbind smtp
28
+# Default-Start:     3 5
29
+# Default-Stop:      0 1 2 6
30
+# Short-Description: Start the mongodb a document-oriented database.
31
+# Description:       Start the mongodb a document-oriented database.
32
+### END INIT INFO
33
+
34
+# Check for missing binaries (stale symlinks should not happen)
35
+# Note: Special treatment of stop for LSB conformance
36
+mongodb_BIN=/usr/sbin/mongod
37
+mongodb_CONFIG=/etc/mongodb.conf
38
+
39
+test -x ${mongodb_BIN} || { echo "${mongodb_BIN} not installed"; 
40
+   if [ "$1" = "stop" ]; then exit 0;
41
+   else exit 5; fi; }
42
+
43
+# This verifies the existence of numactl as well as testing that the command works
44
+numactl_BIN=/usr/bin/numactl
45
+numactl_ARGS="--interleave=all"
46
+if [ -x ${numactl_BIN} ] && ${numactl_BIN} ${numactl_ARGS} ls / >/dev/null 2>/dev/null
47
+then
48
+    numactl="${numactl_BIN} ${numactl_ARGS}"
49
+else
50
+    numactl=""
51
+fi
52
+
53
+# avoid hitting virtual memory limits with mmaps (bnc#876326)
54
+# add recommended ulimit settings
55
+# http://docs.mongodb.org/manual/reference/ulimit/#ulimit
56
+ulimit -f unlimited
57
+ulimit -t unlimited
58
+ulimit -v unlimited
59
+ulimit -n 64000
60
+ulimit -m unlimited
61
+ulimit -u 64000
62
+
63
+# Source LSB init functions
64
+# providing start_daemon, killproc, pidofproc, 
65
+# log_success_msg, log_failure_msg and log_warning_msg.
66
+# This is currently not used by UnitedLinux based distributions and
67
+# not needed for init scripts for UnitedLinux only. If it is used,
68
+# the functions from rc.status should not be sourced or used.
69
+#. /lib/lsb/init-functions
70
+
71
+# Shell functions sourced from /etc/rc.status:
72
+#      rc_check         check and set local and overall rc status
73
+#      rc_status        check and set local and overall rc status
74
+#      rc_status -v     be verbose in local rc status and clear it afterwards
75
+#      rc_status -v -r  ditto and clear both the local and overall rc status
76
+#      rc_status -s     display "skipped" and exit with status 3
77
+#      rc_status -u     display "unused" and exit with status 3
78
+#      rc_failed        set local and overall rc status to failed
79
+#      rc_failed <num>  set local and overall rc status to <num>
80
+#      rc_reset         clear both the local and overall rc status
81
+#      rc_exit          exit appropriate to overall rc status
82
+#      rc_active        checks whether a service is activated by symlinks
83
+. /etc/rc.status
84
+
85
+# Reset status of this service
86
+rc_reset
87
+
88
+# Return values acc. to LSB for all commands but status:
89
+# 0      - success
90
+# 1       - generic or unspecified error
91
+# 2       - invalid or excess argument(s)
92
+# 3       - unimplemented feature (e.g. "reload")
93
+# 4       - user had insufficient privileges
94
+# 5       - program is not installed
95
+# 6       - program is not configured
96
+# 7       - program is not running
97
+# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
98
+# 
99
+# Note that starting an already running service, stopping
100
+# or restarting a not-running service as well as the restart
101
+# with force-reload (in case signaling is not supported) are
102
+# considered a success.
103
+
104
+case "$1" in
105
+    start)
106
+   echo -n "Starting mongodb "
107
+   ## Start daemon with startproc(8). If this fails
108
+   ## the return value is set appropriately by startproc.
109
+   LOGDIR="`sed -n 's|^[[:blank:]]*logpath[[:blank:]]*=[[:blank:]]*||p' "$mongodb_CONFIG" | tail -n 1`"
110
+   LOGDIR="`dirname "$LOGDIR"`"
111
+   if [ "$LOGDIR" ] && [ \! -e "$LOGDIR" ]; then
112
+       mkdir -p "$LOGDIR"
113
+       chown mongodb:mongodb "$LOGDIR"
114
+   fi
115
+   DBDIR="`sed -n 's|^[[:blank:]]*dbpath[[:blank:]]*=[[:blank:]]*||p' "$mongodb_CONFIG" | tail -n 1`"
116
+   if [ "$DBDIR" ] && [ \! -e "$DBDIR" ]; then
117
+       mkdir -p "$DBDIR"
118
+       chown mongodb:mongodb "$DBDIR"
119
+   fi
120
+   ${numactl} /sbin/startproc -u mongodb -g mongodb ${mongodb_BIN} --quiet \
121
+           -f "$mongodb_CONFIG"
122
+
123
+   # Remember status and be verbose
124
+   rc_status -v
125
+   ;;
126
+    stop)
127
+   echo -n "Shutting down mongodb "
128
+   ## Stop daemon with killproc(8) and if this fails
129
+   ## killproc sets the return value according to LSB.
130
+
131
+   /sbin/killproc -TERM $mongodb_BIN
132
+
133
+   # Remember status and be verbose
134
+   rc_status -v
135
+   ;;
136
+    try-restart|condrestart)
137
+   ## Do a restart only if the service was active before.
138
+   ## Note: try-restart is now part of LSB (as of 1.9).
139
+   ## RH has a similar command named condrestart.
140
+   if test "$1" = "condrestart"; then
141
+       echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
142
+   fi
143
+   $0 status
144
+   if test $? = 0; then
145
+       $0 restart
146
+   else
147
+       rc_reset    # Not running is not a failure.
148
+   fi
149
+   # Remember status and be quiet
150
+   rc_status
151
+   ;;
152
+    restart)
153
+   ## Stop the service and regardless of whether it was
154
+   ## running or not, start it again.
155
+   $0 stop
156
+   $0 start
157
+
158
+   # Remember status and be quiet
159
+   rc_status
160
+   ;;
161
+    force-reload)
162
+   ## Signal the daemon to reload its config. Most daemons
163
+   ## do this on signal 1 (SIGHUP).
164
+   ## If it does not support it, restart the service if it
165
+   ## is running.
166
+
167
+   echo -n "Reload service mongodb "
168
+   ## if it supports it:
169
+   /sbin/killproc -HUP ${mongodb_BIN}
170
+   #touch /var/run/mongodb.pid
171
+   rc_status -v
172
+
173
+   ## Otherwise:
174
+   #$0 try-restart
175
+   #rc_status
176
+   ;;
177
+    reload)
178
+   ## Like force-reload, but if daemon does not support
179
+   ## signaling, do nothing (!)
180
+
181
+   # If it supports signaling:
182
+   echo -n "Reload service mongodb "
183
+   /sbin/killproc -HUP ${mongodb_BIN}
184
+   #touch /var/run/mongodb.pid
185
+   rc_status -v
186
+   
187
+   ## Otherwise if it does not support reload:
188
+   #rc_failed 3
189
+   #rc_status -v
190
+   ;;
191
+    status)
192
+   echo -n "Checking for service mongodb "
193
+   ## Check status with checkproc(8), if process is running
194
+   ## checkproc will return with exit status 0.
195
+
196
+   # Return value is slightly different for the status command:
197
+   # 0 - service up and running
198
+   # 1 - service dead, but /var/run/  pid  file exists
199
+   # 2 - service dead, but /var/lock/ lock file exists
200
+   # 3 - service not running (unused)
201
+   # 4 - service status unknown :-(
202
+   # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
203
+   
204
+   # NOTE: checkproc returns LSB compliant status values.
205
+   /sbin/checkproc ${mongodb_BIN}
206
+   # NOTE: rc_status knows that we called this init script with
207
+   # "status" option and adapts its messages accordingly.
208
+   rc_status -v
209
+   ;;
210
+    *)
211
+   echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
212
+   exit 1
213
+   ;;
214
+esac
215
+rc_exit
216
mongodb.logrotate Added
12
 
1
@@ -0,0 +1,10 @@
2
+/var/log/mongodb/*.log {
3
+       weekly
4
+       rotate 10
5
+       su mongodb mongodb
6
+       copytruncate
7
+       delaycompress
8
+       compress
9
+       notifempty
10
+       missingok
11
+}
12
mongodb.service Added
35
 
1
@@ -0,0 +1,33 @@
2
+[Unit]
3
+Description=High-performance, schema-free document-oriented database
4
+After=syslog.target network.target
5
+
6
+[Service]
7
+Type=forking
8
+PIDFile=/run/mongodb/mongod.pid
9
+User=mongodb
10
+Group=mongodb
11
+Environment=CONFIG=/etc/mongodb.conf
12
+Environment=OPTIONS=
13
+EnvironmentFile=-/etc/sysconfig/mongodb
14
+ExecStart=/usr/sbin/mongod -f $CONFIG $OPTIONS
15
+PrivateTmp=true
16
+# avoid hitting virtual memory limits with mmaps (bnc#876326)
17
+# add recommended ulimit settings via systemd Limit options
18
+# http://docs.mongodb.org/manual/reference/ulimit/#ulimit
19
+LimitFSIZE=infinity
20
+LimitCPU=infinity
21
+LimitAS=infinity
22
+LimitNOFILE=64000
23
+LimitNPROC=64000
24
+TimeoutStartSec=180
25
+StandardOutput=syslog
26
+StandardError=syslog
27
+# total threads (user+kernel)
28
+TasksMax=infinity
29
+TasksAccounting=false
30
+# Recommended limits for for mongod as specified in
31
+# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
32
+
33
+[Install]
34
+WantedBy=multi-user.target
35
Refresh

No build results available

Refresh

No rpmlint results available

Mentioned Issues (9)

CVE-2015-1609
CVE-2017-15535
boo#1065956
boo#1087307
boo#738050
boo#863719
boo#876326
boo#921759
boo#930566
Request History
Guo Yunhe's avatar

guoyunhe created request over 4 years ago

MongoDB is removed from official repository since it changed license to SSPL, which forbid Amazon and Microsoft to use MongoDB in cloud platform.


Olaf Hering's avatar

olh accepted request over 4 years ago