Skip to content

Instantly share code, notes, and snippets.

@mdavis95
Created December 21, 2017 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdavis95/08726d56b8b9da71524c1c2562ae72bf to your computer and use it in GitHub Desktop.
Save mdavis95/08726d56b8b9da71524c1c2562ae72bf to your computer and use it in GitHub Desktop.
MongoDB 3.6 Arch Linux PKGBUILD
# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Mathias Stearn <mathias@10gen.com>
# Contributor: Alec Thomas
pkgname=mongodb
pkgver=3.6.0
pkgrel=1
pkgdesc='A high-performance, open source, schema-free document-oriented database'
arch=('x86_64')
url='http://www.mongodb.org'
license=('AGPL3')
depends=('pcre' 'snappy' 'openssl' 'libsasl' 'boost-libs' 'yaml-cpp' 'lsb-release'
'libstemmer')
makedepends=('scons' 'readline' 'ncurses' 'libpcap' 'boost')
checkdepends=('python2-pymongo' 'python2-yaml python2-cheetah')
optdepends=('libpcap: needed for mongosniff'
'mongodb-tools: mongoimport, mongodump, mongotop, etc')
backup=('etc/mongodb.conf')
install=mongodb.install
source=("http://downloads.mongodb.org/src/mongodb-src-r${pkgver}.tar.gz" 'mongodb.conf' 'mongodb.service' )
sha512sums=('05fa6f5875f23b7415bb87ed71324f3e7bd2120983b03a8a779b2c386d05f18e3cb9980023304bce8326b71af404b518ceea0fba0b59505ca8aeb657b82ed57f' '05dead727d3ea5fe8af1a3c3888693f6b3e2b8cb7f197a5d793352e10d2c524e96c9a5c55ad2e88c1114643a9612ec0b26a2574b48a5260a9b51ec8941461f1c' '177251404b2e818ae2b546fe8b13cb76e348c99e85c7bef22a04b0f07b600fd515a309ede50214f4198594388a6d2b31f46e945b9dae84aabb4dfa13b1123bb9'
)
_scons_args=(
--use-system-boost
--use-system-pcre
--use-system-snappy
--use-system-yaml
--use-system-zlib
#--use-system-wiredtiger
--use-system-stemmer
--use-sasl-client
--ssl
--disable-warnings-as-errors
# --use-system-asio # https://jira.mongodb.org/browse/SERVER-21839 (technically fixed now)
# --use-system-v8 # Doesn't compile
# --use-system-icu
# --use-system-tcmalloc # Disabled as upstream suggests in https://jira.mongodb.org/browse/SERVER-17447?focusedCommentId=841890&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-841890
)
prepare() {
cd mongodb-src-r${pkgver}
sed -e 's|-std=c++11|-std=gnu++11|g' -i SConstruct # tests use hex floats, not supported in plain C++
sed -i '/#include "mongo.platform.strnlen.h"/a using namespace std;' src/mongo/bson/bsonelement.h
}
build() {
cd mongodb-src-r${pkgver}
export SCONSFLAGS="$MAKEFLAGS"
scons core tools "${_scons_args[@]}"
}
check() {
cd mongodb-src-r${pkgver}
export SCONSFLAGS="$MAKEFLAGS"
# Setting LANG to workaround the following test error:
# std::exception: locale::facet::_S_create_c_locale name not valid
# 3.4.9: Tests hang
# scons unittests "${_scons_args[@]}"
# sed -i -e '/oplog_buffer_collection_test/d' build/unittests.txt
# LANG=en_US.UTF-8 python2 buildscripts/resmoke.py --suites=unittests
scons dbtest "${_scons_args[@]}"
python2 buildscripts/resmoke.py --suites=dbtest
#scons integration_tests "${_scons_args[@]}"
#python2 buildscripts/resmoke.py --suites=integration_tests_replset,integration_tests_standalone --dbpathPrefix="$srcdir"
}
package() {
cd mongodb-src-r${pkgver}
scons install --prefix="$pkgdir/usr" --nostrip "${_scons_args[@]}"
install -Dm644 "$srcdir/mongodb.conf" "$pkgdir/etc/mongodb.conf"
install -Dm644 "$srcdir/mongodb.service" "$pkgdir/usr/lib/systemd/system/mongodb.service"
install -dm700 "$pkgdir/var/lib/mongodb"
install -dm755 "$pkgdir/var/log/mongodb"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment