aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mongodb/APKBUILD
diff options
context:
space:
mode:
authorFilipp Andronov <filipp.andronov@gmail.com>2015-05-16 21:43:04 +0700
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2015-06-27 20:36:57 +0200
commit11de19231cd990e2700f20635f3413f8d2be3016 (patch)
treefe20a325ab539873980542185d8233ada2b192a9 /testing/mongodb/APKBUILD
parentfe594b5019dc0a4d2abd0e30a61d4f695e9737c8 (diff)
downloadaports-11de19231cd990e2700f20635f3413f8d2be3016.tar.bz2
aports-11de19231cd990e2700f20635f3413f8d2be3016.tar.xz
testing/mongodb: new aport
Things to be complete: 1. Build is only for x86_64, because I have to made a few hacks in code. Most critical one is __ELF_NATIVE_CLASS 2. No tc-malloc. It doesnt build, so system allocator instead. Im working on gpreftools package... 3. No heap usage statistics: always returns 0. It is broken in mongodb for 64bit architecture and also musl mallocinfo is not compatible with glibc. So I just comment out heap reporting code, see comments in APKBUILD 4. Use more system libs, yaml & boost are from the top of my mind. Boost make compilation fails, but should be easy to fix 5. Enable mongodb tests during build. Im just not sure how that should be done in Alpine, i.e _where_ in build lifecycle tests should run
Diffstat (limited to 'testing/mongodb/APKBUILD')
-rw-r--r--testing/mongodb/APKBUILD112
1 files changed, 112 insertions, 0 deletions
diff --git a/testing/mongodb/APKBUILD b/testing/mongodb/APKBUILD
new file mode 100644
index 0000000000..96d7a7c6b3
--- /dev/null
+++ b/testing/mongodb/APKBUILD
@@ -0,0 +1,112 @@
+# Maintainer: Filipp Andronov <filipp.andronov@gmail.com>
+
+pkgname=mongodb
+pkgver=3.0.2
+pkgrel=0
+pkgdesc='A high-performance, open source, schema-free document-oriented database'
+url='http://www.mongodb.org'
+arch='x86_64'
+license='AGPL3'
+pkgusers="mongodb"
+depends=
+depends_dev="scons openssl-dev libexecinfo-dev pcre-dev wiredtiger-dev"
+makedepends="$depends_dev"
+install="$pkgname.pre-install"
+source="http://downloads.mongodb.org/src/mongodb-src-r${pkgver}.tar.gz
+ 10-fix-poll-h.patch
+ 20-fix-libc-version.patch
+ 30-fix-backtrace.patch
+ 40-fix-elf-native-class.patch
+
+ mongodb.confd
+ mongodb.initd
+ mongodb.logrotate
+ mongos.confd
+ mongos.initd
+ "
+#
+# 1. Force 64bits because of 40-fix-elf-native-class.patch
+# 2. Use system allocator as tc-malloc doesn't build
+# 2. Use as much system libs as possible, boost doesn't compile foe example
+#
+# TODO: proper elf-netive-class fix
+# TODO: check if there are more libs could be replaced by system counterparts (see libpcap does't use, for example)
+# TODO: proper fix for heap usage
+# Right now code patched to always return 0 for heap usage statistics. That is necessary because musl malloc info
+# doesn't compatible with glibc and breaks build. It is _possible_ to patch code to return 0
+# because on 64bit platform statistics is broken and returns wrong numbers, see SERVER-9168 mongo bug.
+#
+# There is a way to return propper value when tc-malloc used, but it doesn't compile for libmusl. Work is in progress,
+# contribution strongly welcome :D
+#
+_builddir="$srcdir"/$pkgname-src-r$pkgver
+_buildops="--variant-dir=build --64 --allocator=system --use-system-pcre \
+ --use-system-wiredtiger --extralib=libexecinfo --disable-warnings-as-errors"
+
+prepare() {
+ cd "$_builddir"
+
+ local i
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+
+ export SCONSFLAGS="$MAKEFLAGS"
+ scons $_buildops --prefix=$pkgdir/usr core
+}
+
+package() {
+ cd "$_builddir"
+
+ # install mongo targets
+ scons $_buildops --prefix=$pkgdir/usr install
+
+ # install alpine specific files
+ install -dm700 "$pkgdir/var/lib/mongodb"
+ install -dm755 "$pkgdir/var/log/mongodb"
+ chown mongodb:daemon "$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"
+}
+
+md5sums="d9fe75f9bc88f34194d823f1d288e4d9 mongodb-src-r3.0.2.tar.gz
+b37ef33a58cbfddd7272b2e3e7c29d18 10-fix-poll-h.patch
+c30067f1f39707371db5897dbd46012f 20-fix-libc-version.patch
+4b27b6c9d0216234ac6a24106b624381 30-fix-backtrace.patch
+04a348397be8ca7471d404056d8a1490 40-fix-elf-native-class.patch
+7d2f94bed7bfacd32fcd52dfd931f077 mongodb.confd
+7bfbe9bd5da9254ab4981c7c3b8ac2bc mongodb.initd
+49df78833de4cb6e2b9b1ab9da52c3ac mongodb.logrotate
+33b23ee722f6e5d15eb6d9c2723a346f mongos.confd
+e2e7904c561364545a48077ba4e84dc3 mongos.initd"
+sha256sums="010522203cdb9bbff52fbd9fe299b67686bb1256e2e55eb78abf35444f668399 mongodb-src-r3.0.2.tar.gz
+7eff5c3f9d0119c19b9144d0933f2cd60db0490e096d4b34c1578101ad06ba33 10-fix-poll-h.patch
+1cc23b97d2c0fcec0c67418c9d3fe842fd121fd7e0596ef4ae77b1b992919631 20-fix-libc-version.patch
+7630b7b55cd2b3e836c441e5ac13b4a111ef3552a9576433a58bd839a1b9259b 30-fix-backtrace.patch
+3a863660113d29728d7a852b3fba73926697b496848f8ccc4d8e73e6614cfdfc 40-fix-elf-native-class.patch
+a4ca29c577428c02cd0b0a8b46756df5f53a05519c9d13c270533cf99b9b819d mongodb.confd
+ee590071ade60cffdd28ce5bd1e685bcfb49878fb88a21adea0cf30867587ade mongodb.initd
+76994c32d999def5c925bd7be3f96687b3406f1d67b89aa6a4df8053025b1e01 mongodb.logrotate
+2afd582564623da0e928ca667d37bef467334c82d08b49301f1f6c16ba177767 mongos.confd
+0b7dafba846962f473c406e09d80923e07cf03bb8ba727b3e0408fbef28b23da mongos.initd"
+sha512sums="ec14529f39459835644dd681a98133c276bb96c676ce3ad91c20dff1ce96aeda3e14f08c05019a72a6f8eaadfed7e176944b42187a273b3e82001946126931d7 mongodb-src-r3.0.2.tar.gz
+73427e35edaf6e6c3b9b2fc16ef4560fc3765084d840bdbec729445fa24ca87394798db16366e0ec320312b3c3b6e1fe58db013e902a2b1413c36b8e66c6bce8 10-fix-poll-h.patch
+b9c9f5dbefe765b3cd1043c259dda027721bf66e75024ec70c0d84fe6a1039065b133c3ea838e01538535d07e308c8629920b11fff51a304d0bf59d04ee3ad9b 20-fix-libc-version.patch
+914c896c7736330834a2a66b60615656b67df5348c65b8ba48478e98044d1fae781082aa510263a7f7a3cb13fa2c019747600250e5b584a12870553cf9fe1f99 30-fix-backtrace.patch
+56db8f43afc94713ac65b174189e2dd903b5e1eff0b65f1bdac159e52ad4de6606c449865d73bd47bffad6a8fc339777e2b11395596e9a476867d94a219c7925 40-fix-elf-native-class.patch
+9bcd870742c31bf25f34188ddc3c414de1103e9860dea9f54eee276b89bc2cf1226abab1749c5cda6a6fb0880e541373754e5e83d63cc7189d4b9c274fd555c3 mongodb.confd
+c0634af4653a3b3ca1a72671460e8ea11cce99b84a48782c5cdcc27453d7ead1e89a61d0ce225febda68913dd04e972b4d6a911060b1e5c4ecfbfc1e991e7b12 mongodb.initd
+8c089b1a11f494e4148fb4646265964c925bf937633a65e395ee1361d42facf837871dd493a9a2e0f480ae0e0829dbd3ed60794c5334e2716332e131fc5c2c51 mongodb.logrotate
+61d8734cef644187eeadc821c89e63a3fbf61860fe2db6e74557b1c6760fe83ba7549cb04f9e3aacea4d8e7e4d81a3b1bc0d5e29715eca33c4761adb17ea9ab7 mongos.confd
+28b54e19efd977721549b95e23d34b070c1af0648d5ae60e2457c86a3c18e5cbb6a56fa147d13a38ac540cf9315ac8f74cddaa3c7baafc56c8c6e5596ebef0c0 mongos.initd"