File mongo-c-driver.spec of Package mongo-c-driver

#
# spec file for package mongo-c-driver
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define DriverName    mongo-c-driver
%define MongocName    libmongoc-1_0-0
%define DriverVersion 1.9.4
%define BsonName      libbson-1_0-0
%define BsonVersion   1.9.4
Name:           %{MongocName}
Version:        %{DriverVersion}
Release:        0
Summary:        MongoDB C Driver
License:        Apache-2.0
Group:          Development/Libraries/C and C++
URL:            https://github.com/mongodb/mongo-c-driver
Source0:        https://github.com/mongodb/mongo-c-driver/archive/%{DriverVersion}.tar.gz#/%{DriverName}-%{DriverVersion}.tar.gz
Source1:        https://github.com/mongodb/libbson/archive/%{BsonVersion}.tar.gz#/libbson-%{BsonVersion}.tar.gz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  cyrus-sasl-devel
BuildRequires:  libtool
BuildRequires:  openssl-devel
BuildRequires:  pkgconfig
BuildRequires:  python
BuildRequires:  python-Sphinx
BuildRequires:  python-xml
BuildRequires:  snappy-devel

%description
mongo-c-driver is a library for building high-performance
applications that communicate with the MongoDB NoSQL
database in the C language. It can also be used to write
fast client implementations in languages such as Python,
Ruby, or Perl.

%package devel
Summary:        Development files for mongo-c-driver
Group:          Development/Libraries/C and C++
Requires:       %{MongocName} = %{DriverVersion}

%description devel
The %{MongocName}-devel package contains libraries and header files for
developing applications that use %{DriverName}.

%package -n %{BsonName}
Version:        %{BsonVersion}
Summary:        A library for parsing and generating BSON documents
Group:          System/Libraries

%description -n %{BsonName}
Libbson is a library providing useful routines related to
building, parsing, and iterating BSON documents. It is a
useful base for those wanting to write high-performance
C extensions to higher level languages such as Python,
Ruby, or Perl.

%package -n %{BsonName}-devel
Version:        %{BsonVersion}
Summary:        Development files for libbson
Group:          Development/Libraries/C and C++
Requires:       %{BsonName} = %{BsonVersion}

%description -n %{BsonName}-devel
The %{BsonName}-devel package contains libraries and header files for
developing applications that use %{BsonName}.

%prep
%setup -q -n %{DriverName}-%{DriverVersion}
tar xzf %{SOURCE1} -C src/libbson/ --strip-components=1

%build
autoreconf -fi
%configure \
    --disable-static \
    --disable-silent-rules \
    --enable-debug-symbols \
    --enable-man-pages \
    --enable-ssl \
    --enable-sasl \
    --disable-automatic-init-and-cleanup \
    --with-libbson=bundled \
    --enable-optimizations \
    --enable-examples=no \
    --docdir=%{_docdir}/%{MongocName}
make %{?_smp_mflags}

%check
make %{?_smp_mflags} check || :

%install
%make_install
rm -rf %{buildroot}/%{_libdir}/cmake
find %{buildroot} -type f -name "*.la" -delete -print

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n %{BsonName} -p /sbin/ldconfig
%postun -n %{BsonName} -p /sbin/ldconfig

%files
%dir %{_docdir}/%{MongocName}
%doc %{_docdir}/%{MongocName}/*
%{_libdir}/libmongoc-1.0.so.*

%files -n %{BsonName}
%{_libdir}/libbson-1.0.so.*

%files devel
%dir %{_includedir}/libmongoc-1.0
%{_includedir}/libmongoc-1.0/*.h
%{_includedir}/libmongoc-1.0/*.def
%{_includedir}/libmongoc-1.0/*.defs
%{_libdir}/libmongoc-1.0.so
%{_libdir}/pkgconfig/libmongoc-1.0.pc
%{_libdir}/pkgconfig/libmongoc-ssl-1.0.pc
%{_bindir}/mongoc-stat
#%%{_mandir}/man3/mongoc_*

%files -n %{BsonName}-devel
%dir %{_includedir}/libbson-1.0
%{_includedir}/libbson-1.0/*.h
%{_libdir}/libbson-1.0.so
%{_libdir}/pkgconfig/libbson-1.0.pc
#%%{_mandir}/man3/bson_*

%changelog