void-packages/srcpkgs/mongodb/template
2016-11-22 19:51:30 +01:00

77 lines
2.1 KiB
Bash

# Template file for 'mongodb'
pkgname=mongodb
version=3.2.11
revision=1
wrksrc="mongodb-src-r${version}"
hostmakedepends="scons"
makedepends="boost-devel pcre-devel snappy-devel libressl-devel libpcap-devel
gperftools-devel libsasl-devel yaml-cpp-devel"
depends="cyrus-sasl-modules"
conf_files="/etc/mongodb/mongodb.conf"
system_accounts="mongodb"
mongodb_homedir="/var/lib/mongodb"
short_desc="High-performance, schema-free document-oriented database"
maintainer="Enno Boland <gottox@voidlinux.eu>"
homepage="http://www.mongodb.org"
license="AGPL-3"
distfiles="http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz"
checksum=625eb28fd47b2af63b30343a064de7f42e5265f4c642874ec766ba3643fd80d7
# build flags broken.
nopie=yes
make_dirs="
/var/lib/mongodb 0700 mongodb mongodb
/var/log/mongodb 0750 mongodb mongodb"
# ETOOHUGE
nodebug=1
case "${XBPS_TARGET_MACHINE}" in
x86_64*|aarch64*) makedepends+=" wiredtiger-devel";;
esac
do_configure() {
find . -name SConstruct -print0 | xargs -0 sed -i "s/-Werror/-Wno-error/g"
case "$XBPS_TARGET_MACHINE" in
*-musl) # Disable strtouq(3)
sed -i src/third_party/wiredtiger/build_linux/wiredtiger_config.h \
-e "s;#define HAVE_STRTOUQ 1;#undef HAVE_STRTOUQ;"
esac
}
do_build() {
# Choose storage engine
case "$XBPS_TARGET_MACHINE" in
x86_64*|aarch64*) _scons_args="--wiredtiger=on --use-system-wiredtiger";;
i686*|arm*) _scons_args="--wiredtiger=off --mmapv1=on";;
*) _scons_args="--wiredtiger=off";;
esac
scons core tools ${makejobs} \
CC=$CC \
CFLAGS="$CFLAGS" \
CXX=$CXX \
CXXFLAGS="$CXXFLAGS" \
LIBPATH="${XBPS_CROSS_BASE}/usr/lib" \
CPPPATH="${XBPS_CROSS_BASE}/usr/include" \
--prefix="/usr" \
--use-system-pcre \
--use-system-boost \
--use-system-snappy \
--use-system-zlib \
--use-system-yaml \
--use-system-intel_decimal128 \
--use-sasl-client \
--ssl \
--nostrip \
--disable-warnings-as-errors \
--allocator=system \
${_scons_args}
}
do_install() {
for b in mongos mongod mongosniff mongo mongoperf; do
vbin $b
done
vinstall ${FILESDIR}/mongodb.conf 644 etc/mongodb
vsv mongodb
}