# Maintainer: Filipp Andronov pkgname=mongodb pkgver=3.0.6 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 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="1cda3caf0d63ce9bae20de0fec7baccd mongodb-src-r3.0.6.tar.gz 9419a078d1cc62d6cb27d9585028e3c3 20-fix-libc-version.patch 4b27b6c9d0216234ac6a24106b624381 30-fix-backtrace.patch 04a348397be8ca7471d404056d8a1490 40-fix-elf-native-class.patch 7d2f94bed7bfacd32fcd52dfd931f077 mongodb.confd 792a0b53b3e843cf14176c5beb8cdfe1 mongodb.initd 49df78833de4cb6e2b9b1ab9da52c3ac mongodb.logrotate 33b23ee722f6e5d15eb6d9c2723a346f mongos.confd 28611e6796d71c21661dd3d7ee8f23b8 mongos.initd" sha256sums="609f6bd416ed11898b49406332b8ff301de239ba72df0bdbf1603233229c822d mongodb-src-r3.0.6.tar.gz dc536f728b27e0a01406a4a99afd4f02e86514d225ad7eb71834bc18db6b9861 20-fix-libc-version.patch 7630b7b55cd2b3e836c441e5ac13b4a111ef3552a9576433a58bd839a1b9259b 30-fix-backtrace.patch 3a863660113d29728d7a852b3fba73926697b496848f8ccc4d8e73e6614cfdfc 40-fix-elf-native-class.patch a4ca29c577428c02cd0b0a8b46756df5f53a05519c9d13c270533cf99b9b819d mongodb.confd 7e39fbd4dc18dba21c8767931683f4795e58e0e91b9f9a5842539923ded453c9 mongodb.initd 76994c32d999def5c925bd7be3f96687b3406f1d67b89aa6a4df8053025b1e01 mongodb.logrotate 2afd582564623da0e928ca667d37bef467334c82d08b49301f1f6c16ba177767 mongos.confd 1c48327b02bb9e1aaacaa39a4c0e9976a765a0ab0992d4e27cc4c36a33fefe2d mongos.initd" sha512sums="1990e9011ae586e30aef28be58f9fc6d8b7f45b787dbde9785c82eff6fb0a70ea45152e450c032a898e6464bbb9b1683082f2a072ba874f7532e167330658175 mongodb-src-r3.0.6.tar.gz 08a2ec09d4cce55e00eb8dce3b52c0f8a6dfca9f67b6194934ec95afef1c60efb8982ae6b88bff571591cdfeede6a732879ab0f201a78a794530ff0a7e917dd1 20-fix-libc-version.patch 914c896c7736330834a2a66b60615656b67df5348c65b8ba48478e98044d1fae781082aa510263a7f7a3cb13fa2c019747600250e5b584a12870553cf9fe1f99 30-fix-backtrace.patch 56db8f43afc94713ac65b174189e2dd903b5e1eff0b65f1bdac159e52ad4de6606c449865d73bd47bffad6a8fc339777e2b11395596e9a476867d94a219c7925 40-fix-elf-native-class.patch 9bcd870742c31bf25f34188ddc3c414de1103e9860dea9f54eee276b89bc2cf1226abab1749c5cda6a6fb0880e541373754e5e83d63cc7189d4b9c274fd555c3 mongodb.confd 2cb295ac0eb44acb4533c86d6d0988d5f760361a43cff7845713f3e2cf0e37023d23790a2926c613bf2b0668060c0b68d59000db52daaacd8af10e701a8b4192 mongodb.initd 8c089b1a11f494e4148fb4646265964c925bf937633a65e395ee1361d42facf837871dd493a9a2e0f480ae0e0829dbd3ed60794c5334e2716332e131fc5c2c51 mongodb.logrotate 61d8734cef644187eeadc821c89e63a3fbf61860fe2db6e74557b1c6760fe83ba7549cb04f9e3aacea4d8e7e4d81a3b1bc0d5e29715eca33c4761adb17ea9ab7 mongos.confd 13aad7247b848ac58b2bc0b40a0d30d909e950380abd0c83fab0e2a394a42dc268a66dac53cf9feec6971739977470082cc4339cca827f41044cfe43803ef3f7 mongos.initd"