8f53e73
# remirepo/fedora spec file for mongo-c-driver
8f53e73
#
3e46953
# Copyright (c) 2015-2018 Remi Collet
8f53e73
# License: CC-BY-SA
8f53e73
# http://creativecommons.org/licenses/by-sa/4.0/
8f53e73
#
8f53e73
# Please, preserve the changelog entries
8f53e73
#
8f53e73
%global gh_owner     mongodb
8f53e73
%global gh_project   mongo-c-driver
8f53e73
%global libname      libmongoc
8f53e73
%global libver       1.0
06882fa
#global prever       rc2
57a1f60
%global bsonver      1.9
8f53e73
8f53e73
%ifarch x86_64
e50e97b
# Temporarily disabled
e50e97b
%global with_tests   0%{?_with_tests:1}
8f53e73
%else
8f53e73
# See https://jira.mongodb.org/browse/CDRIVER-1186
8f53e73
# 32-bit MongoDB support was officially deprecated
8f53e73
# in MongoDB 3.2, and support is being removed in 3.4.
8f53e73
%global with_tests   0%{?_with_tests:1}
8f53e73
%endif
8f53e73
8f53e73
Name:      mongo-c-driver
8f53e73
Summary:   Client library written in C for MongoDB
eff9f52
Version:   1.9.2
06882fa
Release:   1%{?dist}
8f53e73
License:   ASL 2.0
8f53e73
Group:     System Environment/Libraries
8f53e73
URL:       https://github.com/%{gh_owner}/%{gh_project}
8f53e73
8f53e73
Source0:   https://github.com/%{gh_owner}/%{gh_project}/releases/download/%{version}%{?prever:-%{prever}}/%{gh_project}-%{version}%{?prever:-%{prever}}.tar.gz
8f53e73
3bba532
# RPM specific changes
3bba532
# 1. Ignore check for libbson version = libmongoc version
3bba532
# 2. Use bundled libbson documentation
3bba532
#    https://jira.mongodb.org/browse/CDRIVER-2078
3bba532
# 3. Don't install COPYING file which is not doc but license
3bba532
Patch0:    %{name}-rpm.patch
3bba532
5b9b757
BuildRequires: autoconf
5b9b757
BuildRequires: automake
5b9b757
BuildRequires: libtool
8f53e73
BuildRequires: pkgconfig(openssl)
2b85a51
BuildRequires: pkgconfig(libbson-1.0) > %{bsonver}
8f53e73
BuildRequires: pkgconfig(libsasl2)
1f1d6a8
BuildRequires: pkgconfig(zlib)
1f1d6a8
%if 0%{?fedora} >= 26
1f1d6a8
# pkgconfig file introduce in 1.1.4
1f1d6a8
BuildRequires: pkgconfig(snappy)
1f1d6a8
%else
1f1d6a8
BuildRequires: snappy-devel
1f1d6a8
%endif
8f53e73
%if %{with_tests}
8f53e73
BuildRequires: mongodb-server
8f53e73
BuildRequires: openssl
8f53e73
%endif
19286ff
BuildRequires: perl-interpreter
8f53e73
# From man pages
8f53e73
BuildRequires: python
3ca4548
BuildRequires: /usr/bin/sphinx-build
8f53e73
8f53e73
Requires:   %{name}-libs%{?_isa} = %{version}-%{release}
8f53e73
# Sub package removed
8f53e73
Obsoletes:  %{name}-tools         < 1.3.0
8f53e73
Provides:   %{name}-tools         = %{version}
8f53e73
Provides:   %{name}-tools%{?_isa} = %{version}
8f53e73
8f53e73
8f53e73
%description
8f53e73
%{name} is a client library written in C for MongoDB.
8f53e73
8f53e73
8f53e73
%package libs
8f53e73
Summary:    Shared libraries for %{name}
8f53e73
Group:      Development/Libraries
8f53e73
8f53e73
%description libs
8f53e73
This package contains the shared libraries for %{name}.
8f53e73
8f53e73
8f53e73
%package devel
8f53e73
Summary:    Header files and development libraries for %{name}
8f53e73
Group:      Development/Libraries
8f53e73
Requires:   %{name}%{?_isa} = %{version}-%{release}
8f53e73
Requires:   pkgconfig
8f53e73
8f53e73
%description devel
8f53e73
This package contains the header files and development libraries
8f53e73
for %{name}.
8f53e73
8f53e73
Documentation: http://api.mongodb.org/c/%{version}/
8f53e73
8f53e73
8f53e73
%prep
1f1d6a8
%setup -q -n %{gh_project}-%{version}%{?prever:-dev}
3bba532
%patch0 -p1 -b .rpm
3ca4548
3bba532
: Generate build scripts from sources
3bba532
autoreconf --force --install --verbose -I build/autotools
e057836
3e670c7
: delete bundled libbson sources
3e670c7
rm -r src/libbson
8f53e73
8f53e73
8f53e73
%build
8f53e73
export LIBS=-lpthread
8f53e73
8f53e73
%configure \
2b85a51
  --enable-debug-symbols \
8f53e73
  --enable-shm-counters \
8f53e73
  --disable-automatic-init-and-cleanup \
2b85a51
  --enable-crypto-system-profile \
8f53e73
%if %{with_tests}
8f53e73
  --enable-tests \
8f53e73
%else
8f53e73
  --disable-tests \
8f53e73
%endif
8f53e73
  --enable-sasl \
8f53e73
  --enable-ssl \
8f53e73
  --with-libbson=system \
e50e97b
  --with-snappy=system \
e50e97b
  --with-zlib=system \
8f53e73
  --disable-html-docs \
3bba532
  --enable-examples \
8f53e73
  --enable-man-pages
8f53e73
74ce6a3
rm -r src/zlib-*
74ce6a3
e057836
make %{?_smp_mflags} all V=1
3e670c7
e057836
# Explicit man target is needed for generating manual pages
3e670c7
make %{?_smp_mflags} doc/man V=1
8f53e73
8f53e73
8f53e73
%install
8f53e73
make install DESTDIR=%{buildroot}
8f53e73
3bba532
rm %{buildroot}%{_libdir}/*la
3bba532
3bba532
: install examples
3bba532
for i in examples/*.c examples/*/*.c; do
3bba532
  install -Dpm 644 $i %{buildroot}%{_datadir}/doc/%{name}/$i
3bba532
done
3bba532
3bba532
: Rename documentation to match subpackage name
3bba532
mv %{buildroot}%{_datadir}/doc/%{name} \
3bba532
   %{buildroot}%{_datadir}/doc/%{name}-devel
8f53e73
8f53e73
8f53e73
%check
8f53e73
%if %{with_tests}
8f53e73
: Run a server
8f53e73
mkdir dbtest
8f53e73
mongod \
8f53e73
  --journal \
e2d6151
  --ipv6 \
8f53e73
  --unixSocketPrefix /tmp \
8f53e73
  --logpath     $PWD/server.log \
8f53e73
  --pidfilepath $PWD/server.pid \
8f53e73
  --dbpath      $PWD/dbtest \
8f53e73
  --fork
8f53e73
8f53e73
: Run the test suite
8f53e73
ret=0
8f53e73
export MONGOC_TEST_OFFLINE=on
eff5bd0
#export MONGOC_TEST_SKIP_SLOW=on
1d86b3e
8f53e73
make check || ret=1
8f53e73
8f53e73
: Cleanup
8f53e73
[ -s server.pid ] && kill $(cat server.pid)
8f53e73
8f53e73
exit $ret
8f53e73
%endif
8f53e73
8f53e73
8f53e73
%post   libs -p /sbin/ldconfig
8f53e73
%postun libs -p /sbin/ldconfig
8f53e73
8f53e73
8f53e73
%files
8f53e73
%{_bindir}/mongoc-stat
8f53e73
8f53e73
%files libs
8f53e73
%{!?_licensedir:%global license %%doc}
8f53e73
%license COPYING
3bba532
%license THIRD_PARTY_NOTICES
8f53e73
%{_libdir}/%{libname}-%{libver}.so.*
8f53e73
8f53e73
%files devel
3bba532
%{_docdir}/%{name}-devel
8f53e73
%{_includedir}/%{libname}-%{libver}
8f53e73
%{_libdir}/%{libname}-%{libver}.so
8f53e73
%{_libdir}/pkgconfig/%{libname}-*.pc
1f1d6a8
%{_libdir}/cmake/%{libname}-%{libver}
8f53e73
%{_mandir}/man3/mongoc*
8f53e73
8f53e73
8f53e73
%changelog
eff9f52
* Fri Jan 12 2018 Remi Collet <remi@remirepo.net> - 1.9.2-1
eff9f52
- update to 1.9.2 (no change)
eff9f52
3e46953
* Wed Jan 10 2018 Remi Collet <remi@remirepo.net> - 1.9.1-1
3e46953
- update to 1.9.1
3e46953
57a1f60
* Fri Dec 22 2017 Remi Collet <remi@remirepo.net> - 1.9.0-1
57a1f60
- update to 1.9.0
57a1f60
- raise dependency on libbson 1.9
57a1f60
8f1eb1e
* Fri Nov 17 2017 Remi Collet <remi@fedoraproject.org> - 1.8.2-1
8f1eb1e
- update to 1.8.2
8f1eb1e
e50e97b
* Thu Oct 12 2017 Remi Collet <remi@fedoraproject.org> - 1.8.1-1
e50e97b
- update to 1.8.1
e50e97b
74ce6a3
* Fri Sep 15 2017 Remi Collet <remi@fedoraproject.org> - 1.8.0-1
74ce6a3
- update to 1.8.0
74ce6a3
06882fa
* Thu Aug 10 2017 Remi Collet <remi@fedoraproject.org> - 1.7.0-1
06882fa
- update to 1.7.0
06882fa
- disable test suite in rawhide (mongodb-server is broken)
06882fa
1f1d6a8
* Tue Aug  8 2017 Remi Collet <remi@fedoraproject.org> - 1.7.0-0.1.rc2
1f1d6a8
- update to 1.7.0-rc2
1f1d6a8
- add --with-snappy and --with-zlib build options
1f1d6a8
c0d26d1
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.3-3
c0d26d1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c0d26d1
2779180
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.3-2
2779180
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2779180
6254e13
* Wed May 24 2017 Remi Collet <remi@fedoraproject.org> - 1.6.3-1
6254e13
- update to 1.6.2
6254e13
3e670c7
* Tue Mar 28 2017 Remi Collet <remi@fedoraproject.org> - 1.6.2-1
3e670c7
- update to 1.6.2
3e670c7
3bba532
* Wed Mar  8 2017 Remi Collet <remi@fedoraproject.org> - 1.6.1-2
3bba532
- rebuild with new upstream tarball
3bba532
- add examples in devel documentation
3bba532
- use patch instead of sed hacks for rpm specific changes
3bba532
e057836
* Tue Mar  7 2017 Remi Collet <remi@fedoraproject.org> - 1.6.1-1
e057836
- update to 1.6.1
e057836
- open https://jira.mongodb.org/browse/CDRIVER-2078
e057836
  can't build man pages
e057836
3ca4548
* Thu Feb  9 2017 Remi Collet <remi@fedoraproject.org> - 1.6.0-1
3ca4548
- update to 1.6.0
5cc6002
- add fix for https://jira.mongodb.org/browse/CDRIVER-2042
5cc6002
  from https://github.com/mongodb/mongo-c-driver/pull/421
3ca4548
b469a18
* Thu Jan 12 2017 Remi Collet <remi@fedoraproject.org> - 1.5.3-1
b469a18
- update to 1.5.3
b469a18
ba0d3c8
* Wed Jan 11 2017 Remi Collet <remi@fedoraproject.org> - 1.5.2-1
ba0d3c8
- update to 1.5.2
e2d6151
- run server on both IPv4 and IPv6
e2d6151
- open https://jira.mongodb.org/browse/CDRIVER-1988 - Failed test
eff5bd0
- revert IPv6 commit
ba0d3c8
ff21ba1
* Tue Dec 20 2016 Remi Collet <remi@fedoraproject.org> - 1.5.1-1
ff21ba1
- update to 1.5.1
ff21ba1
cce87c3
* Mon Nov 28 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-1
cce87c3
- update to 1.5.0
cce87c3
c77a964
* Fri Nov 18 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-0.5.rc6
c77a964
- update to 1.5.0-rc6
c77a964
c76beeb
* Fri Nov  4 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-0.4.rc4
c76beeb
- update to 1.5.0-rc4
c76beeb
d1b9194
* Thu Oct 20 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-0.3.rc3
d1b9194
- update to 1.5.0-rc3
d1b9194
- drop patches merged upstream
d1b9194
6154138
* Fri Oct 14 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-0.2.rc2
6154138
- open https://jira.mongodb.org/browse/CDRIVER-1703 missing files
6154138
- open https://jira.mongodb.org/browse/CDRIVER-1702 broken test
6154138
- enable test suite
6154138
2b85a51
* Fri Oct 14 2016 Remi Collet <remi@fedoraproject.org> - 1.5.0-0.1.rc2
2b85a51
- update to 1.5.0-rc2
2b85a51
- drop crypto patch merged upstream
2b85a51
- drop the private library
2b85a51
- disable test suite
2b85a51
6499e90
* Mon Aug 29 2016 Petr Pisar <ppisar@redhat.com> - 1.3.5-6
6499e90
- Rebuild against libbson-1.4.0 (bug #1361166)
6499e90
4ce13ab
* Tue Jul 26 2016 Remi Collet <remi@fedoraproject.org> - 1.3.5-5
4ce13ab
- add BR on perl, FTBFS from Koschei
4ce13ab
b4a8c8b
* Mon Jun 13 2016 Remi Collet <remi@fedoraproject.org> - 1.3.5-4
f633bf9
- add workaround to abicheck failure
f633bf9
  see https://bugzilla.redhat.com/1345868
f633bf9
8f53e73
* Mon May 16 2016 Remi Collet <remi@fedoraproject.org> - 1.3.5-2
8f53e73
- add patch to enforce system crypto policies
8f53e73
8f53e73
* Thu Mar 31 2016 Remi Collet <remi@fedoraproject.org> - 1.3.5-1
8f53e73
- update to 1.3.5
8f53e73
- use --disable-automatic-init-and-cleanup build option
8f53e73
- ignore check for libbson version = libmongoc version
8f53e73
8f53e73
* Sat Mar 19 2016 Remi Collet <remi@fedoraproject.org> - 1.3.4-2
8f53e73
- build with MONGOC_NO_AUTOMATIC_GLOBALS
8f53e73
8f53e73
* Tue Mar 15 2016 Remi Collet <remi@fedoraproject.org> - 1.3.4-1
8f53e73
- update to 1.3.4
8f53e73
- drop patch merged upstream
8f53e73
8f53e73
* Mon Feb 29 2016 Remi Collet <remi@fedoraproject.org> - 1.3.3-2
8f53e73
- cleanup for review
8f53e73
- move libraries in "libs" sub-package
8f53e73
- add patch to skip online tests
8f53e73
  open https://github.com/mongodb/mongo-c-driver/pull/314
8f53e73
- temporarily disable test suite on arm  (#1303864)
8f53e73
- temporarily disable test suite on i686/F24+ (#1313018)
8f53e73
8f53e73
* Sun Feb  7 2016 Remi Collet <remi@fedoraproject.org> - 1.3.3-1
8f53e73
- Update to 1.3.3
8f53e73
8f53e73
* Tue Feb  2 2016 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
8f53e73
- Update to 1.3.2
8f53e73
8f53e73
* Thu Jan 21 2016 Remi Collet <remi@fedoraproject.org> - 1.3.1-1
8f53e73
- Update to 1.3.1
8f53e73
8f53e73
* Wed Dec 16 2015 Remi Collet <remi@fedoraproject.org> - 1.3.0-1
8f53e73
- Update to 1.3.0
8f53e73
- move tools in devel package
8f53e73
8f53e73
* Tue Dec  8 2015 Remi Collet <remi@fedoraproject.org> - 1.2.3-1
8f53e73
- Update to 1.2.3
8f53e73
8f53e73
* Tue Dec  8 2015 Remi Collet <remi@fedoraproject.org> - 1.3.0-1
8f53e73
- Update to 1.3.0
8f53e73
- open https://jira.mongodb.org/browse/CDRIVER-1040 - ABI breaks
8f53e73
8f53e73
* Wed Oct 14 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-1
8f53e73
- Update to 1.2.0
8f53e73
8f53e73
* Sun Oct  4 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-0.6.rc0
8f53e73
- Update to 1.2.0-rc0
8f53e73
8f53e73
* Fri Sep 11 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-0.5.20150903git3eaf73e
8f53e73
- add patch to export library verson in the API
8f53e73
  open https://github.com/mongodb/mongo-c-driver/pull/265
8f53e73
8f53e73
* Fri Sep  4 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-0.4.20150903git3eaf73e
8f53e73
- update to version 1.2.0beta1 from git snapshot
8f53e73
- https://jira.mongodb.org/browse/CDRIVER-828 missing tests/json
8f53e73
8f53e73
* Mon Aug 31 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-0.3.beta
8f53e73
- more upstream patch (for EL-6)
8f53e73
8f53e73
* Mon Aug 31 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-0.2.beta
8f53e73
- Upstream version 1.2.0beta
8f53e73
8f53e73
* Wed May 20 2015 Remi Collet <remi@fedoraproject.org> - 1.1.6-1
8f53e73
- Upstream version 1.1.6
8f53e73
8f53e73
* Mon May 18 2015 Remi Collet <remi@fedoraproject.org> - 1.1.5-1
8f53e73
- Upstream version 1.1.5
8f53e73
8f53e73
* Sat Apr 25 2015 Remi Collet <remi@fedoraproject.org> - 1.1.4-3
8f53e73
- test build for upstream patch
8f53e73
8f53e73
* Thu Apr 23 2015 Remi Collet <remi@fedoraproject.org> - 1.1.4-2
8f53e73
- cleanup build dependencies and options
8f53e73
8f53e73
* Wed Apr 22 2015 Remi Collet <remi@fedoraproject.org> - 1.1.4-1
8f53e73
- Initial package
8f53e73
- open https://jira.mongodb.org/browse/CDRIVER-624 - gcc 5