File lmdb.spec of Package mingw64-lmdb

#
# spec file for package mingw64-lmdb
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unl 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 _name   lmdb
Name:           mingw64-%{_name}
Summary:        Lightning Memory-Mapped Database Manager
License:        OLDAP-2.8
Group:          Productivity/Databases/Tools
%define lname	liblmdb-0_9_17
Version:        0.9.17
Release:        0
Url:            http://symas.com/mdb/

#Git-Clone:	git://git.openldap.org/openldap mdb.master
Source:         https://github.com/LMDB/lmdb/archive/LMDB_%version.tar.gz

# PATCH-FIX-UPSTREAM - debugging tools (https://github.com/kacfengine/lmdb)
Patch1:         0001-Add-extra-tools-and-CFEngine-modifications-for-LMDB.patch
# PATCH-FIX-UPSTREAM - configure.ac, Makefile.am, etc.
Patch2:         0002-Autoconf-files.patch
# PATCH-FIX-OPENSUSE - Implicit declaration of atol()
Patch3:         liblmdb-implicit-decl.patch
Patch4:         soname-configurable.patch
# PATCH-FIX-UPSTREAM
Patch5:         0001-ITS-8756-remove-loose-pg-from-dirty-list-in-freelist.patch
# PATCH-FIX-UPSTREAM
Patch6:         0001-ITS-8336-fix-page_search_root-assert-on-FreeDB.patch

BuildRequires:  autoconf
BuildRequires:  automake >= 1.10
BuildRequires:  libtool >= 2
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-filesystem
%_mingw64_package_header_debug
BuildArch:      noarch

%description
LMDB is a Btree-based database management library with an API similar
to BerkeleyDB. The library is thread-aware and supports concurrent
read/write access from multiple processes and threads. The DB
structure is multi-versioned, and data pages use a copy-on-write
strategy, which also provides resistance to corruption and eliminates
the need for any recovery procedures. The database is exposed in a
memory map, requiring no page cache layer of its own.

%package -n mingw64-%lname
Summary:        Shared library for Lightning Memory-Mapped Database (LMDB)
Group:          System/Libraries

%description -n mingw64-%lname
LMDB is a Btree-based database management library with an API similar
to BerkeleyDB. The library is thread-aware and supports concurrent
read/write access from multiple processes and threads. The DB
structure is multi-versioned, and data pages use a copy-on-write
strategy, which also provides resistance to corruption and eliminates
the need for any recovery procedures. The database is exposed in a
memory map, requiring no page cache layer of its own.

This package contains the shared library.

%package devel
Summary:        Development package for lmdb
Group:          Development/Libraries/C and C++
Requires:       mingw64-%lname = %version

%description devel
LMDB is a Btree-based database management library with an API similar
to BerkeleyDB. The library is thread-aware and supports concurrent
read/write access from multiple processes and threads. The DB
structure is multi-versioned, and data pages use a copy-on-write
strategy, which also provides resistance to corruption and eliminates
the need for any recovery procedures. The database is exposed in a
memory map, requiring no page cache layer of its own.
 
This package contains the files needed to compile programs that use
the liblmdb library.

%_mingw64_debug_package

%prep
%setup -qn lmdb-LMDB_%version
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 6 -p1
sed -i -e 's,__VERSION__,%version,' libraries/liblmdb/Makefile.am

%build
cd libraries/liblmdb
mkdir -p m4
autoreconf -fi
%_mingw64_configure --disable-static
make %{?_smp_mflags} V=1

%install
cd libraries/liblmdb
make install DESTDIR="%buildroot"
rm -f "%buildroot/%_mingw64_libdir"/*.la


%files
%defattr(-,root,root)
%doc libraries/liblmdb/CHANGES
%doc libraries/liblmdb/COPYRIGHT
%doc libraries/liblmdb/LICENSE
%{_mingw64_bindir}/*.exe
%doc %{_mingw64_mandir}/man1/*.1.gz

%files -n mingw64-%lname
%defattr(-,root,root)
%_mingw64_bindir/liblmdb*.dll

%files devel
%defattr(-,root,root)
%_mingw64_includedir/*
%_mingw64_libdir/liblmdb.dll.a

%changelog
openSUSE Build Service is sponsored by