aboutsummaryrefslogtreecommitdiffstats
path: root/non-free/mongodb
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-11 16:04:34 -0600
committerLeonardo Arena <rnalrd@alpinelinux.org>2019-04-03 08:49:55 +0000
commit8a901de31fa055ed591d487e12f8bb9ffcc0df21 (patch)
tree10bc98c626703819e94ec25bf0c2eaa0f6fe2cc9 /non-free/mongodb
parentfffa6ab6963a4a0045f99432ac487957791685ea (diff)
downloadaports-8a901de31fa055ed591d487e12f8bb9ffcc0df21.tar.bz2
aports-8a901de31fa055ed591d487e12f8bb9ffcc0df21.tar.xz
community/mongodb: expunge nonfree software
Upstream has switched to a nonfree license.
Diffstat (limited to 'non-free/mongodb')
-rw-r--r--non-free/mongodb/APKBUILD100
-rw-r--r--non-free/mongodb/fix-backtrace.patch12
-rw-r--r--non-free/mongodb/fix-default-stacksize.patch20
-rw-r--r--non-free/mongodb/fix-elf-native-class.patch12
-rw-r--r--non-free/mongodb/fix-processinfo_linux.patch35
-rw-r--r--non-free/mongodb/fix-resolv.patch17
-rw-r--r--non-free/mongodb/fix-strerror_r.patch13
-rw-r--r--non-free/mongodb/mongodb.confd14
-rw-r--r--non-free/mongodb/mongodb.initd41
-rw-r--r--non-free/mongodb/mongodb.logrotate13
-rw-r--r--non-free/mongodb/mongodb.pre-install6
-rw-r--r--non-free/mongodb/mongos.confd16
-rw-r--r--non-free/mongodb/mongos.initd45
-rw-r--r--non-free/mongodb/wiredtiger.patch11
14 files changed, 355 insertions, 0 deletions
diff --git a/non-free/mongodb/APKBUILD b/non-free/mongodb/APKBUILD
new file mode 100644
index 0000000000..38a9823f4c
--- /dev/null
+++ b/non-free/mongodb/APKBUILD
@@ -0,0 +1,100 @@
+# Maintainer: Marc Vertes <mvertes@free.fr>
+# Contributor: Filipp Andronov <filipp.andronov@gmail.com>
+pkgname=mongodb
+pkgver=4.0.6
+pkgrel=1
+pkgdesc="A high-performance, open source, schema-free document-oriented database"
+url="http://www.mongodb.org"
+arch="x86_64 ppc64le aarch64"
+options="!check" # out of disk space (>35GB)
+license='AGPL3'
+pkgusers="mongodb"
+pkggroups="mongodb"
+makedepends="scons py-setuptools py2-cheetah py2-typing py2-yaml paxmark
+ openssl-dev pcre-dev snappy-dev boost-dev asio-dev libpcap-dev
+ snowball-dev zlib-dev cyrus-sasl-dev yaml-cpp-dev curl-dev"
+install="$pkgname.pre-install"
+source="http://downloads.mongodb.org/src/mongodb-src-r${pkgver}.tar.gz
+ fix-backtrace.patch
+ fix-default-stacksize.patch
+ fix-elf-native-class.patch
+ fix-processinfo_linux.patch
+ fix-resolv.patch
+ fix-strerror_r.patch
+ wiredtiger.patch
+
+ mongodb.confd
+ mongodb.initd
+ mongodb.logrotate
+ mongos.confd
+ mongos.initd
+ "
+
+builddir="$srcdir"/$pkgname-src-r$pkgver
+_buildopts="
+ --allocator=system \
+ --disable-warnings-as-errors \
+ --use-system-boost \
+ --use-system-pcre \
+ --use-system-stemmer \
+ --use-system-snappy \
+ --use-system-zlib \
+ --use-system-yaml \
+ --use-sasl-client \
+ --ssl \
+ "
+
+case $CARCH in
+ aarch64) _buildopts="$_buildopts CCFLAGS=-march=armv8-a+crc" ;;
+esac
+
+build() {
+ cd "$builddir"
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons $_buildopts --prefix=$pkgdir/usr core
+}
+
+check() {
+ cd "$builddir"
+
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons $_buildopts unittests
+ python buildscripts/resmoke.py --suites=unittests --jobs=2
+}
+
+package() {
+ cd "$builddir"
+
+ # install mongo targets
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons $_buildopts --prefix=$pkgdir/usr install
+
+ # java jit requires paxmark
+ paxmark -m "$pkgdir"/usr/bin/mongo*
+
+ # install alpine specific files
+ install -dm700 "$pkgdir/var/lib/mongodb"
+ install -dm755 "$pkgdir/var/log/mongodb"
+ chown mongodb:mongodb "$pkgdir/var/lib/mongodb" "$pkgdir/var/log/mongodb"
+
+ install -Dm755 "$srcdir/mongodb.initd" "$pkgdir/etc/init.d/mongodb"
+ install -Dm644 "$srcdir/mongodb.confd" "$pkgdir/etc/conf.d/mongodb"
+ install -Dm644 "$srcdir/mongodb.logrotate" "$pkgdir/etc/logrotate.d/mongodb"
+
+ install -Dm755 "$srcdir/mongos.initd" "$pkgdir/etc/init.d/mongos"
+ install -Dm644 "$srcdir/mongos.confd" "$pkgdir/etc/conf.d/mongos"
+}
+
+sha512sums="72e04154cf221833522bb0c2cc99acc2a86d20e2dcbf1f8c6ff0a870edf7b2529a55b6821c664805c00c12a311ae374a276ef1e3ccea1ed84fb125bb8726906a mongodb-src-r4.0.6.tar.gz
+05c4331d028eb396e6cf52d96cdaa2af7199a03522e1a8211df2d36cb053ec093a51e9abf83c4dc00c09a0b1fa119a79bcc719fbc81a48f50ca1527c26613cf0 fix-backtrace.patch
+1492137b0e3456d90a79617c1cd5ead5c71b1cfaae9ee41c75d56cd25f404ec73a690f95ce0d8c064c0a14206daca8070aa769b7cdfa904a338a425b52c293fa fix-default-stacksize.patch
+56db8f43afc94713ac65b174189e2dd903b5e1eff0b65f1bdac159e52ad4de6606c449865d73bd47bffad6a8fc339777e2b11395596e9a476867d94a219c7925 fix-elf-native-class.patch
+4b72d659eb6cf8c5b303bd91fe28d4cebeefda97be5b93df12a3e265283b4057ff299e14763a0b9f4b6eaae8da1725af35038b3aba578c66dd950f1703c28d42 fix-processinfo_linux.patch
+aac12cffc452f1dc365c65944a015476c2011b0975144879d28938c690fe6e77b6bd672e040b4c04c02cb002224e24d6f13adb083324f424ef4cdb79a3a71f6b fix-resolv.patch
+92cf2c55c68b975408ed2f7fde65da6b238b617dfaa0737a1c51ce19344dba11dd96c0a99f7671c1b7464f5114b3e820a32a25b1600d1c8217262b60fe0364ea fix-strerror_r.patch
+ecbe6cb579b33dd4888096712f150772db06fd38219ca2a7679b1dc1ee73b0c3f5ee498af12ecd0265b5231a9fe6b7c12b2c1d606ed04caa6aa00c3ad3fe925a wiredtiger.patch
+9bcd870742c31bf25f34188ddc3c414de1103e9860dea9f54eee276b89bc2cf1226abab1749c5cda6a6fb0880e541373754e5e83d63cc7189d4b9c274fd555c3 mongodb.confd
+74009794d566dd9d70ec93ffd95c830ee4696165574ecf87398165637fb40799b38d182ef54c50fd0772d589be94ade7f7a49247f3d31c1f012cb4e44cc9f5df mongodb.initd
+8c089b1a11f494e4148fb4646265964c925bf937633a65e395ee1361d42facf837871dd493a9a2e0f480ae0e0829dbd3ed60794c5334e2716332e131fc5c2c51 mongodb.logrotate
+61d8734cef644187eeadc821c89e63a3fbf61860fe2db6e74557b1c6760fe83ba7549cb04f9e3aacea4d8e7e4d81a3b1bc0d5e29715eca33c4761adb17ea9ab7 mongos.confd
+13aad7247b848ac58b2bc0b40a0d30d909e950380abd0c83fab0e2a394a42dc268a66dac53cf9feec6971739977470082cc4339cca827f41044cfe43803ef3f7 mongos.initd"
diff --git a/non-free/mongodb/fix-backtrace.patch b/non-free/mongodb/fix-backtrace.patch
new file mode 100644
index 0000000000..67cb7ca422
--- /dev/null
+++ b/non-free/mongodb/fix-backtrace.patch
@@ -0,0 +1,12 @@
+--- mongodb-src-r3.6.1/SConstruct.orig
++++ mongodb-src-r3.6.1/SConstruct
+@@ -2896,7 +2896,8 @@
+ if (conf.CheckCXXHeader( "execinfo.h" ) and
+ conf.CheckDeclaration('backtrace', includes='#include <execinfo.h>') and
+ conf.CheckDeclaration('backtrace_symbols', includes='#include <execinfo.h>') and
+- conf.CheckDeclaration('backtrace_symbols_fd', includes='#include <execinfo.h>')):
++ conf.CheckDeclaration('backtrace_symbols_fd', includes='#include <execinfo.h>') and
++ conf.CheckFunc('backtrace')):
+
+ conf.env.SetConfigHeaderDefine("MONGO_CONFIG_HAVE_EXECINFO_BACKTRACE")
+
diff --git a/non-free/mongodb/fix-default-stacksize.patch b/non-free/mongodb/fix-default-stacksize.patch
new file mode 100644
index 0000000000..d40a2d4b6e
--- /dev/null
+++ b/non-free/mongodb/fix-default-stacksize.patch
@@ -0,0 +1,20 @@
+diff -ru mongodb-src-r3.2.10.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp mongodb-src-r3.2.10/src/mongo/platform/stack_locator_pthread_getattr_np.cpp
+--- mongodb-src-r3.2.10.orig/src/mongo/platform/stack_locator_pthread_getattr_np.cpp 2016-09-26 15:10:04.000000000 +0300
++++ mongodb-src-r3.2.10/src/mongo/platform/stack_locator_pthread_getattr_np.cpp 2016-11-01 10:47:31.062284560 +0200
+@@ -35,6 +35,16 @@
+ #include "mongo/util/assert_util.h"
+ #include "mongo/util/scopeguard.h"
+
++__attribute__((constructor))
++static void set_default_stack_size(void)
++{
++ pthread_attr_t attr;
++ invariant(pthread_attr_init(&attr) == 0);
++ invariant(pthread_attr_setstacksize(&attr, 256*1024) == 0);
++ pthread_setattr_default_np(&attr);
++ invariant(pthread_attr_destroy(&attr) == 0);
++}
++
+ namespace mongo {
+
+ StackLocator::StackLocator() {
diff --git a/non-free/mongodb/fix-elf-native-class.patch b/non-free/mongodb/fix-elf-native-class.patch
new file mode 100644
index 0000000000..badb712d8e
--- /dev/null
+++ b/non-free/mongodb/fix-elf-native-class.patch
@@ -0,0 +1,12 @@
+--- orig/mongodb-src-r3.0.2/src/mongo/util/stacktrace_posix.cpp
++++ mongodb-src-r3.0.2/src/mongo/util/stacktrace_posix.cpp
+@@ -209,6 +209,9 @@
+ #include <elf.h>
+ #include <link.h>
+
++// AlpineTODO: Better option??
++#define __ELF_NATIVE_CLASS 64
++
+ namespace mongo {
+ namespace {
+
diff --git a/non-free/mongodb/fix-processinfo_linux.patch b/non-free/mongodb/fix-processinfo_linux.patch
new file mode 100644
index 0000000000..a5411371a3
--- /dev/null
+++ b/non-free/mongodb/fix-processinfo_linux.patch
@@ -0,0 +1,35 @@
+--- mongodb-src-r4.0.0/src/mongo/util/processinfo_linux.cpp.orig
++++ mongodb-src-r4.0.0/src/mongo/util/processinfo_linux.cpp
+@@ -42,13 +42,7 @@
+ #include <sys/time.h>
+ #include <sys/utsname.h>
+ #include <unistd.h>
+-#ifdef __BIONIC__
+-#include <android/api-level.h>
+-#elif __UCLIBC__
+ #include <features.h>
+-#else
+-#include <gnu/libc-version.h>
+-#endif
+
+ #include <boost/filesystem.hpp>
+ #include <boost/none.hpp>
+@@ -495,17 +489,9 @@
+
+ BSONObjBuilder bExtra;
+ bExtra.append("versionString", LinuxSysHelper::readLineFromFile("/proc/version"));
+-#ifdef __BIONIC__
+ stringstream ss;
+- ss << "bionic (android api " << __ANDROID_API__ << ")";
++ ss << "musl-1.1.19";
+ bExtra.append("libcVersion", ss.str());
+-#elif __UCLIBC__
+- stringstream ss;
+- ss << "uClibc-" << __UCLIBC_MAJOR__ << "." << __UCLIBC_MINOR__ << "." << __UCLIBC_SUBLEVEL__;
+- bExtra.append("libcVersion", ss.str());
+-#else
+- bExtra.append("libcVersion", gnu_get_libc_version());
+-#endif
+ if (!verSig.empty())
+ // optional
+ bExtra.append("versionSignature", verSig);
diff --git a/non-free/mongodb/fix-resolv.patch b/non-free/mongodb/fix-resolv.patch
new file mode 100644
index 0000000000..09bda7b643
--- /dev/null
+++ b/non-free/mongodb/fix-resolv.patch
@@ -0,0 +1,17 @@
+--- mongodb-src-r3.6.1/src/mongo/util/dns_query_posix-impl.h.orig
++++ mongodb-src-r3.6.1/src/mongo/util/dns_query_posix-impl.h
+@@ -38,6 +38,14 @@
+ #include <resolv.h>
+ // clang-format on
+
++// Support deprecated resolver, as in musl libc
++#ifndef res_ninit
++#define res_nclose(arg)
++#define res_ninit(arg) res_init()
++#define res_nsearch(sta, nam, clas, typ, ans, alen) res_search(nam, clas, typ, ans, alen)
++#endif
++
++
+ #include <stdio.h>
+
+ #include <iostream>
diff --git a/non-free/mongodb/fix-strerror_r.patch b/non-free/mongodb/fix-strerror_r.patch
new file mode 100644
index 0000000000..172c7fefac
--- /dev/null
+++ b/non-free/mongodb/fix-strerror_r.patch
@@ -0,0 +1,13 @@
+--- mongodb-src-r4.0.0/src/mongo/util/errno_util.cpp.orig
++++ mongodb-src-r4.0.0/src/mongo/util/errno_util.cpp
+@@ -58,9 +58,7 @@
+ char buf[kBuflen];
+ char* msg{nullptr};
+
+-#if defined(__GNUC__) && defined(_GNU_SOURCE) && (__ANDROID_API__ > 22)
+- msg = strerror_r(errNumber, buf, kBuflen);
+-#elif defined(_WIN32)
++#if defined(_WIN32)
+
+ LPWSTR errorText = nullptr;
+ FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER |
diff --git a/non-free/mongodb/mongodb.confd b/non-free/mongodb/mongodb.confd
new file mode 100644
index 0000000000..4f76c5a79f
--- /dev/null
+++ b/non-free/mongodb/mongodb.confd
@@ -0,0 +1,14 @@
+# Mongodb essentials
+MONGODB_EXEC="/usr/bin/mongod"
+MONGODB_RUN="/var/run/mongodb"
+MONGODB_DATA="/var/lib/mongodb"
+MONGODB_USER="mongodb"
+
+# Listen to specified IP, comment this to listen to all
+MONGODB_IP="127.0.0.1"
+
+# Listen to specified port
+MONGODB_PORT="27017"
+
+# Set extra options here, such as disabling the admin web server
+MONGODB_OPTIONS="--journal"
diff --git a/non-free/mongodb/mongodb.initd b/non-free/mongodb/mongodb.initd
new file mode 100644
index 0000000000..fede8f683c
--- /dev/null
+++ b/non-free/mongodb/mongodb.initd
@@ -0,0 +1,41 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongodb.initd,v 1.5 2013/01/18 11:19:27 ultrabug Exp $
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ checkpath -d -m 0750 -o "${MONGODB_USER}":mongodb "${MONGODB_RUN}"
+
+ # Listen to MONGODB_IP if configured
+ [ -z "${MONGODB_IP}" ] || MONGODB_OPTIONS="--bind_ip ${MONGODB_IP} ${MONGODB_OPTIONS}"
+
+ # Baselayout-1 user should use --chuid instead of --user
+ local USEROPT="--user"
+ if [ ! -f /etc/init.d/sysfs ]; then
+ USEROPT="--chuid"
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --background --start --make-pidfile \
+ --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid \
+ ${USEROPT} ${MONGODB_USER:-mongodb} \
+ --exec ${MONGODB_EXEC:-/usr/bin/mongod} \
+ -- \
+ --port ${MONGODB_PORT:-27017} \
+ --dbpath ${MONGODB_DATA:-/var/lib/mongodb} \
+ --unixSocketPrefix ${MONGODB_RUN:-/var/run/mongodb} \
+ --logappend --logpath /var/log/mongodb/${SVCNAME}.log \
+ ${MONGODB_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${MONGODB_RUN:-/var/run/mongodb}/${SVCNAME}.pid
+ eend $?
+}
diff --git a/non-free/mongodb/mongodb.logrotate b/non-free/mongodb/mongodb.logrotate
new file mode 100644
index 0000000000..f95a438b5b
--- /dev/null
+++ b/non-free/mongodb/mongodb.logrotate
@@ -0,0 +1,13 @@
+# Default log rotation / compression keeps 1 year of logs.
+/var/log/mongodb/*.log {
+ daily
+ rotate 365
+ dateext
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ extension gz
+ sharedscripts
+ missingok
+}
diff --git a/non-free/mongodb/mongodb.pre-install b/non-free/mongodb/mongodb.pre-install
new file mode 100644
index 0000000000..1ed56eb7f4
--- /dev/null
+++ b/non-free/mongodb/mongodb.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S mongodb 2>/dev/null
+adduser -S -D -h /var/lib/mongodb -s /sbin/nologin -G mongodb -g mongodb mongodb 2>/dev/null
+
+exit 0
diff --git a/non-free/mongodb/mongos.confd b/non-free/mongodb/mongos.confd
new file mode 100644
index 0000000000..644cd0a252
--- /dev/null
+++ b/non-free/mongodb/mongos.confd
@@ -0,0 +1,16 @@
+# Mongos essentials
+MONGOS_EXEC="/usr/bin/mongos"
+MONGOS_RUN="/var/run/mongodb"
+MONGOS_USER="mongodb"
+
+# Listen to specified IP, comment this to listen to all
+MONGOS_IP="127.0.0.1"
+
+# Listen to specified port
+MONGOS_PORT="27018"
+
+# 1 to 3 comma separated config servers (mandatory)
+MONGOS_CONFIGDB=""
+
+# Set extra options here
+MONGOS_OPTIONS=""
diff --git a/non-free/mongodb/mongos.initd b/non-free/mongodb/mongos.initd
new file mode 100644
index 0000000000..a38fc50569
--- /dev/null
+++ b/non-free/mongodb/mongos.initd
@@ -0,0 +1,45 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongos.initd,v 1.3 2013/01/18 11:19:27 ultrabug Exp $
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -z "${MONGOS_CONFIGDB}" ]; then
+ eerror "MONGOS_CONFIGDB is not defined, check your configuration file !"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+
+ checkpath -d -m 0750 -o "${MONGOS_USER}":mongodb "${MONGOS_RUN}"
+
+ # Listen to MONGOS_IP if configured
+ [ -z "${MONGOS_IP}" ] || MONGOS_OPTIONS="--bind_ip ${MONGOS_IP} ${MONGOS_OPTIONS}"
+
+ local USEROPT="--user"
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --background --start --make-pidfile \
+ --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid \
+ ${USEROPT} ${MONGOS_USER:-mongodb} \
+ --exec ${MONGOS_EXEC:-/usr/bin/mongos} \
+ -- \
+ --port ${MONGOS_PORT:-27018} \
+ --unixSocketPrefix ${MONGOS_RUN:-/var/run/mongodb} \
+ --logappend --logpath /var/log/mongodb/${SVCNAME}.log \
+ --configdb ${MONGOS_CONFIGDB} \
+ ${MONGOS_OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${MONGOS_RUN:-/var/run/mongodb}/${SVCNAME}.pid
+ eend $?
+}
diff --git a/non-free/mongodb/wiredtiger.patch b/non-free/mongodb/wiredtiger.patch
new file mode 100644
index 0000000000..37d9fedabe
--- /dev/null
+++ b/non-free/mongodb/wiredtiger.patch
@@ -0,0 +1,11 @@
+--- ./src/third_party/wiredtiger/build_linux/wiredtiger_config.h.orig
++++ ./src/third_party/wiredtiger/build_linux/wiredtiger_config.h
+@@ -104,7 +104,7 @@
+ #define HAVE_STRING_H 1
+
+ /* Define to 1 if you have the `strtouq' function. */
+-#define HAVE_STRTOUQ 1
++/* #define HAVE_STRTOUQ 1 */
+
+ /* Define to 1 if you have the `sync_file_range' function. */
+ /* #undef HAVE_SYNC_FILE_RANGE */