aboutsummaryrefslogtreecommitdiffstats
path: root/community/mongo-c-driver
diff options
context:
space:
mode:
authorSergey Safarov <s.safarov@gmail.com>2019-08-26 20:23:32 +0000
committerLeo <thinkabit.ukim@gmail.com>2019-08-27 02:14:41 -0300
commitaac86616d69c78ece2431ebcd06571231d174d1e (patch)
tree490151dbc687ae92cd0fe8dbeac30c31d44a5c2d /community/mongo-c-driver
parent1cd48760357f310712c2b5dcac3eb6357b28b995 (diff)
downloadaports-aac86616d69c78ece2431ebcd06571231d174d1e.tar.bz2
aports-aac86616d69c78ece2431ebcd06571231d174d1e.tar.xz
community/mongo-c-driver: move from testing
kamailio.org project want use this package durring stable branch build testing packages not avaialble in stable repo
Diffstat (limited to 'community/mongo-c-driver')
-rw-r--r--community/mongo-c-driver/APKBUILD122
1 files changed, 122 insertions, 0 deletions
diff --git a/community/mongo-c-driver/APKBUILD b/community/mongo-c-driver/APKBUILD
new file mode 100644
index 0000000000..1b743e11f9
--- /dev/null
+++ b/community/mongo-c-driver/APKBUILD
@@ -0,0 +1,122 @@
+# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
+pkgname=mongo-c-driver
+pkgver=1.15.0
+pkgrel=0
+pkgdesc="Client library written in C for MongoDB"
+url="https://github.com/mongodb/mongo-c-driver"
+arch="all"
+license="Apache-2.0"
+makedepends="openssl-dev snappy-dev zlib-dev libtool py3-sphinx cmake"
+subpackages="
+ $pkgname-static:_static
+ libbson-static:_libbson_static
+ $pkgname-dev:_dev
+ $pkgname-doc
+ libbson
+ libbson-dev
+ "
+source="https://github.com/mongodb/mongo-c-driver/releases/download/$pkgver/mongo-c-driver-$pkgver.tar.gz"
+
+build() {
+ mkdir -p "$srcdir"/build
+ cd "$srcdir"/build
+ cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DENABLE_BSON:STRING=ON \
+ -DENABLE_MONGOC:BOOL=ON \
+ -DENABLE_SSL:STRING=OPENSSL \
+ -DENABLE_AUTOMATIC_INIT_AND_CLEANUP:BOOL=OFF \
+ -DENABLE_MAN_PAGES:BOOL=ON \
+ -DENABLE_TESTS:BOOL=ON \
+ -DENABLE_EXAMPLES:BOOL=OFF \
+ -DSPHINX_EXECUTABLE:STRING=/usr/bin/sphinx-build-3 \
+ -DCMAKE_SKIP_RPATH=ON \
+ "$builddir"
+ make
+}
+
+check() {
+ cd "$srcdir"/build
+ export MONGOC_TEST_SKIP_MOCK=on
+ export MONGOC_TEST_SKIP_SLOW=on
+ export MONGOC_TEST_SKIP_LIVE=on
+ make check
+}
+
+package() {
+ cd "$srcdir"/build
+ make DESTDIR="$pkgdir" install
+
+ # removes COPYING, NEWS, README, uninstall script
+ rm -rf "$pkgdir/usr/share/mongo-c-driver"
+}
+
+libbson() {
+ pkgdesc="Building, parsing, and iterating BSON documents"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libbson-*.so.* "$subpkgdir"/usr/lib/
+}
+
+_static() {
+ # Depend on the dev package that has the headers required
+ # for compiling against, whether it is static or shared
+ depends_static="mongo-c-driver-dev"
+
+ default_static
+
+ # Move the libbson static archive from the mongo-c-driver-static
+ # back to $pkgdir it will be then moved to libbson-static
+ mkdir -p "$pkgdir"/usr/lib
+ mv "$subpkgdir"/usr/lib/libbson-static-1.0.a "$pkgdir"/usr/lib
+
+ # Move development dependencies that only make sense in the context
+ # of static libraries like libmongoc-static-1.0.pc
+ mkdir -p "$subpkgdir"/usr/lib/pkgconfig
+ mkdir -p "$subpkgdir"/usr/lib/cmake
+ mv "$pkgdir"/usr/lib/pkgconfig/libmongoc-static-1.0.pc "$subpkgdir"/usr/lib/pkgconfig
+ mv "$pkgdir"/usr/lib/cmake/libmongoc-static-1.0 "$subpkgdir"/usr/lib/cmake
+}
+
+_libbson_static() {
+ # Depend on the dev package that has the headers required
+ # for compiling against, whether it is static or shared
+ depends_static="libbson-dev"
+
+ default_static
+
+ # Move development dependencies that only make sense in the context
+ # of static libraries like libbson-static-1.0.pc
+ mkdir -p "$subpkgdir"/usr/lib/pkgconfig
+ mkdir -p "$subpkgdir"/usr/lib/cmake
+ mv "$pkgdir"/usr/lib/pkgconfig/libbson-static-1.0.pc "$subpkgdir"/usr/lib/pkgconfig
+ mv "$pkgdir"/usr/lib/cmake/libbson-static-1.0 "$subpkgdir"/usr/lib/cmake
+}
+
+_dev() {
+ # This should be removed once abuild knows how to search for pkg-config
+ # files that are in another subpackage that is also being created alongside
+ # this one.
+ depends_dev="libbson-dev"
+
+ default_dev
+
+ # libbson pkg-config files
+ mkdir -p "$pkgdir"/usr/lib/pkgconfig
+ mv "$subpkgdir"/usr/lib/pkgconfig/libbson-1.0.pc "$pkgdir"/usr/lib/pkgconfig
+
+ # libbson solink
+ mkdir -p "$pkgdir"/usr/lib
+ mv "$subpkgdir"/usr/lib/libbson-1.0.so "$pkgdir"/usr/lib
+
+ # libbson cmake file
+ mkdir -p "$pkgdir"/usr/lib/cmake
+ mv "$subpkgdir"/usr/lib/cmake/libbson-1.0 "$pkgdir"/usr/lib/cmake
+
+ # libbson include files
+ mkdir -p "$pkgdir"/usr/include
+ mv "$subpkgdir"/usr/include/libbson-1.0 "$pkgdir"/usr/include
+}
+
+sha512sums="b3a24116787e2e76eaeb86d26e812a6afe4fbd065ae12ed5c2730d14c78101b9c7a7cf60d549bd64c278e57581118af065e97ac09db7a08b7008b3f607538b09 mongo-c-driver-1.15.0.tar.gz"