Accepting request 613891 from systemsmanagement

OBS-URL: https://build.opensuse.org/request/show/613891
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lmdb?expand=0&rev=13
This commit is contained in:
Dominique Leuenberger 2018-06-05 10:51:16 +00:00 committed by Git OBS Bridge
commit 26e129a594
8 changed files with 199 additions and 255 deletions

View File

@ -1,221 +0,0 @@
From 8e9182f6252eeb8e2390de814f4d1e9db2485edc Mon Sep 17 00:00:00 2001
From: Kristian Amlie <kristian.amlie@cfengine.com>
Date: Wed, 18 Feb 2015 09:40:20 +0100
Subject: [PATCH 2/4] Autoconf files.
---
libraries/liblmdb/Makefile | 111 -----------------------------------------
libraries/liblmdb/Makefile.am | 11 ++++
libraries/liblmdb/configure.ac | 42 ++++++++++++++++
libraries/liblmdb/mdb.c | 6 +++
4 files changed, 59 insertions(+), 111 deletions(-)
delete mode 100644 libraries/liblmdb/Makefile
create mode 100644 libraries/liblmdb/Makefile.am
create mode 100644 libraries/liblmdb/configure.ac
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
deleted file mode 100644
index dbb5d698fee7..000000000000
--- a/libraries/liblmdb/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-# Makefile for liblmdb (Lightning memory-mapped database library).
-
-########################################################################
-# Configuration. The compiler options must enable threaded compilation.
-#
-# Preprocessor macros (for CPPFLAGS) of interest...
-# Note that the defaults should already be correct for most
-# platforms; you should not need to change any of these.
-# Read their descriptions in mdb.c if you do:
-#
-# - MDB_USE_POSIX_SEM
-# - MDB_DSYNC
-# - MDB_FDATASYNC
-# - MDB_FDATASYNC_WORKS
-# - MDB_USE_PWRITEV
-# - MDB_USE_ROBUST
-#
-# There may be other macros in mdb.c of interest. You should
-# read mdb.c before changing any of them.
-#
-CC = gcc
-AR = ar
-W = -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized
-THREADS = -pthread
-OPT = -O2 -g
-CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS)
-LDLIBS =
-SOLIBS =
-prefix = /usr/local
-mandir = $(prefix)/man
-
-########################################################################
-
-IHDRS = lmdb.h
-ILIBS = liblmdb.a liblmdb.so
-IPROGS = mdb_stat mdb_copy mdb_dump mdb_load
-IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1
-PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
-all: $(ILIBS) $(PROGS)
-
-install: $(ILIBS) $(IPROGS) $(IHDRS)
- mkdir -p $(DESTDIR)$(prefix)/bin
- mkdir -p $(DESTDIR)$(prefix)/lib
- mkdir -p $(DESTDIR)$(prefix)/include
- mkdir -p $(DESTDIR)$(prefix)/man/man1
- for f in $(IPROGS); do cp $$f $(DESTDIR)$(prefix)/bin; done
- for f in $(ILIBS); do cp $$f $(DESTDIR)$(prefix)/lib; done
- for f in $(IHDRS); do cp $$f $(DESTDIR)$(prefix)/include; done
- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
-
-clean:
- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
-
-test: all
- rm -rf testdb && mkdir testdb
- ./mtest && ./mdb_stat testdb
-
-liblmdb.a: mdb.o midl.o
- $(AR) rs $@ mdb.o midl.o
-
-liblmdb.so: mdb.lo midl.lo
-# $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)
- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS)
-
-mdb_stat: mdb_stat.o liblmdb.a
-mdb_copy: mdb_copy.o liblmdb.a
-mdb_dump: mdb_dump.o liblmdb.a
-mdb_load: mdb_load.o liblmdb.a
-mtest: mtest.o liblmdb.a
-mtest2: mtest2.o liblmdb.a
-mtest3: mtest3.o liblmdb.a
-mtest4: mtest4.o liblmdb.a
-mtest5: mtest5.o liblmdb.a
-mtest6: mtest6.o liblmdb.a
-
-mdb.o: mdb.c lmdb.h midl.h
- $(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c
-
-midl.o: midl.c midl.h
- $(CC) $(CFLAGS) $(CPPFLAGS) -c midl.c
-
-mdb.lo: mdb.c lmdb.h midl.h
- $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -c mdb.c -o $@
-
-midl.lo: midl.c midl.h
- $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -c midl.c -o $@
-
-%: %.o
- $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
-
-%.o: %.c lmdb.h
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
-
-COV_FLAGS=-fprofile-arcs -ftest-coverage
-COV_OBJS=xmdb.o xmidl.o
-
-coverage: xmtest
- for i in mtest*.c [0-9]*.c; do j=`basename \$$i .c`; $(MAKE) $$j.o; \
- gcc -o x$$j $$j.o $(COV_OBJS) -pthread $(COV_FLAGS); \
- rm -rf testdb; mkdir testdb; ./x$$j; done
- gcov xmdb.c
- gcov xmidl.c
-
-xmtest: mtest.o xmdb.o xmidl.o
- gcc -o xmtest mtest.o xmdb.o xmidl.o -pthread $(COV_FLAGS)
-
-xmdb.o: mdb.c lmdb.h midl.h
- $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 $(COV_FLAGS) -c mdb.c -o $@
-
-xmidl.o: midl.c midl.h
- $(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 $(COV_FLAGS) -c midl.c -o $@
diff --git a/libraries/liblmdb/Makefile.am b/libraries/liblmdb/Makefile.am
new file mode 100644
index 000000000000..d3a4a4c99c5d
--- /dev/null
+++ b/libraries/liblmdb/Makefile.am
@@ -0,0 +1,15 @@
+lib_LTLIBRARIES = liblmdb.la
+liblmdb_la_SOURCES = mdb.c midl.c
+liblmdb_la_LDFLAGS=-no-undefined -avoid-version
+
+bin_PROGRAMS = mdb_stat mdb_copy mdb_load mdb_dump lmdump lmmgr
+mdb_stat_LDADD = liblmdb.la
+mdb_copy_LDADD = liblmdb.la
+mdb_load_LDADD = liblmdb.la
+mdb_dump_LDADD = liblmdb.la
+lmdump_LDADD = liblmdb.la
+lmmgr_LDADD = liblmdb.la
+
+man_MANS = mdb_stat.1 mdb_copy.1 mdb_load.1 mdb_dump.1
+
+include_HEADERS = lmdb.h
diff --git a/libraries/liblmdb/configure.ac b/libraries/liblmdb/configure.ac
new file mode 100644
index 000000000000..3db22516634b
--- /dev/null
+++ b/libraries/liblmdb/configure.ac
@@ -0,0 +1,42 @@
+AC_INIT([hello], [1.0]) # good
+AC_CANONICAL_TARGET
+AM_INIT_AUTOMAKE([foreign])
+
+AC_PROG_CC
+
+# Use either new LT_INIT or old AC_DISABLE_STATIC/AC_PROG_LIBTOOL macros
+m4_ifdef([LT_INIT],
+ [LT_INIT([disable-static])],
+ [AC_DISABLE_STATIC
+ AC_PROG_LIBTOOL])
+
+AC_ARG_WITH([pthread], [Path to pthread])
+AS_IF([test -n "$with_pthread"],
+ [LDFLAGS+=" -L$with_pthread/lib"]
+)
+AC_CHECK_LIB([pthread], [pthread_mutex_lock])
+AC_CHECK_LIB([pthreadGC2], [pthread_mutex_lock])
+AS_IF([test "$ac_cv_lib_pthread" = "no" && test "$ac_cv_lib_pthreadGC2" = "no"],
+[
+ AC_MSG_ERROR([Could not find pthreads library])
+])
+AC_CHECK_FUNCS([pthread_mutexattr_settype])
+AC_CHECK_FUNC([pthread_mutexattr_setrobust],
+[
+ AC_MSG_CHECKING([whether pthread_mutexattr_setrobust can be used on this platform])
+ AS_CASE([$target_os],
+ [*solaris*],
+ [
+ # Disable pthread_mutexattr_setrobust on Solaris, it is reported as
+ # existing on Solaris 11, but known to be broken.
+ AC_MSG_RESULT([no])
+ ],
+ [
+ AC_DEFINE([HAVE_PTHREAD_MUTEXATTR_SETROBUST])
+ AC_MSG_RESULT([yes])
+ ])
+])
+
+AC_CONFIG_SRCDIR([mdb.c])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c
index 96c859efd9bd..695d11602a13 100644
--- a/libraries/liblmdb/mdb.c
+++ b/libraries/liblmdb/mdb.c
@@ -220,6 +220,12 @@ typedef SSIZE_T ssize_t;
#define MDB_DEVEL 0
#endif
+#ifdef HAVE_PTHREAD_MUTEXATTR_SETROBUST
+#define MDB_USE_ROBUST 1
+#else
+#define MDB_USE_ROBUST 0
+#endif
+
/** Wrapper around __func__, which is a C99 feature */
#if __STDC_VERSION__ >= 199901L
# define mdb_func_ __func__
--
2.7.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:80a08218e40f76a0485ec18c42de6f1e020b1ed0268f7cb34c69746e8d98c72c
size 135816

3
LMDB_0.9.22.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3927859882eb608868c8c31586bb7eb84562a40a6bf5cc3e13b6b564641ea28
size 143468

View File

@ -0,0 +1,124 @@
From 3e19339d0d22c76ac0fd17f1a59ca2ae1c03f93a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 3 Jun 2018 23:49:29 +0200
Subject: [PATCH 1/3] Set SONAME in shared lib
---
libraries/liblmdb/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
index f254511f1..489a08976 100644
--- a/libraries/liblmdb/Makefile
+++ b/libraries/liblmdb/Makefile
@@ -38,7 +38,7 @@ mandir = $(datarootdir)/man
########################################################################
IHDRS = lmdb.h
-ILIBS = liblmdb.a liblmdb$(SOEXT)
+ILIBS = liblmdb-$(SOVERSION)$(SOEXT)
IPROGS = mdb_stat mdb_copy mdb_dump mdb_load
IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1
PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
@@ -64,9 +64,9 @@ test: all
liblmdb.a: mdb.o midl.o
$(AR) rs $@ mdb.o midl.o
-liblmdb$(SOEXT): mdb.lo midl.lo
+liblmdb-$(SOVERSION)$(SOEXT): mdb.lo midl.lo
# $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)
- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS)
+ $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS) -Wl,-soname -Wl,liblmdb-$(SOVERSION).so
mdb_stat: mdb_stat.o liblmdb.a
mdb_copy: mdb_copy.o liblmdb.a
--
2.17.0
From e4e77f24f0b45c308e4f774c67281d38dee0b060 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 3 Jun 2018 23:52:16 +0200
Subject: [PATCH 2/3] Use shared library
---
libraries/liblmdb/Makefile | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
index 489a08976..d926df798 100644
--- a/libraries/liblmdb/Makefile
+++ b/libraries/liblmdb/Makefile
@@ -68,16 +68,16 @@ liblmdb-$(SOVERSION)$(SOEXT): mdb.lo midl.lo
# $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS)
$(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS) -Wl,-soname -Wl,liblmdb-$(SOVERSION).so
-mdb_stat: mdb_stat.o liblmdb.a
-mdb_copy: mdb_copy.o liblmdb.a
-mdb_dump: mdb_dump.o liblmdb.a
-mdb_load: mdb_load.o liblmdb.a
-mtest: mtest.o liblmdb.a
-mtest2: mtest2.o liblmdb.a
-mtest3: mtest3.o liblmdb.a
-mtest4: mtest4.o liblmdb.a
-mtest5: mtest5.o liblmdb.a
-mtest6: mtest6.o liblmdb.a
+mdb_stat: mdb_stat.o
+mdb_copy: mdb_copy.o
+mdb_dump: mdb_dump.o
+mdb_load: mdb_load.o
+mtest: mtest.o
+mtest2: mtest2.o
+mtest3: mtest3.o
+mtest4: mtest4.o
+mtest5: mtest5.o
+mtest6: mtest6.o
mdb.o: mdb.c lmdb.h midl.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c
@@ -91,8 +91,8 @@ mdb.lo: mdb.c lmdb.h midl.h
midl.lo: midl.c midl.h
$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -c midl.c -o $@
-%: %.o
- $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
+%: %.o | liblmdb-$(SOVERSION)$(SOEXT)
+ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -L. -llmdb-$(SOVERSION) -o $@
%.o: %.c lmdb.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
--
2.17.0
From 85810167f7db0091e0937e5fb464f7f7868d36a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sun, 3 Jun 2018 23:52:43 +0200
Subject: [PATCH 3/3] Build/install CFEngine extra tools
---
libraries/liblmdb/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
index d926df798..b2e95a642 100644
--- a/libraries/liblmdb/Makefile
+++ b/libraries/liblmdb/Makefile
@@ -40,6 +40,7 @@ mandir = $(datarootdir)/man
IHDRS = lmdb.h
ILIBS = liblmdb-$(SOVERSION)$(SOEXT)
IPROGS = mdb_stat mdb_copy mdb_dump mdb_load
+IPROGS += lmdump lmmgr
IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1
PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5
all: $(ILIBS) $(PROGS)
@@ -78,6 +79,8 @@ mtest3: mtest3.o
mtest4: mtest4.o
mtest5: mtest5.o
mtest6: mtest6.o
+lmmgr: lmmgr.o
+lmdump: lmdump.o
mdb.o: mdb.c lmdb.h midl.h
$(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c
--
2.17.0

View File

@ -1 +1 @@
liblmdb-0_9_17
liblmdb-0_9_22

View File

@ -1,3 +1,57 @@
-------------------------------------------------------------------
Sun Jun 3 19:23:50 UTC 2018 - stefan.bruens@rwth-aachen.de
- LMDB 0.9.22 Release (2018-03-22)
* Fix MDB_DUPSORT alignment bug (ITS#8819)
* Fix regression with new db from 0.9.19 (ITS#8760)
* Fix liblmdb to build on Solaris (ITS#8612)
* Fix delete behavior with DUPSORT DB (ITS#8622)
* Fix mdb_cursor_get/mdb_cursor_del behavior (ITS#8722)
- LMDB 0.9.21 Release (2017/06/01)
* Fix xcursor after cursor_del (ITS#8622)
- LMDB 0.9.20 (Withdrawn)
* Fix mdb_load with escaped plaintext (ITS#8558)
* Fix mdb_cursor_last / mdb_put interaction (ITS#8557)
- LMDB 0.9.19 Release (2016/12/28)
* Fix mdb_env_cwalk cursor init (ITS#8424)
* Fix robust mutexes on Solaris 10/11 (ITS#8339)
* Tweak Win32 error message buffer
* Fix MDB_GET_BOTH on non-dup record (ITS#8393)
* Optimize mdb_drop
* Fix xcursors after mdb_cursor_del (ITS#8406)
* Fix MDB_NEXT_DUP after mdb_cursor_del (ITS#8412)
* Fix mdb_cursor_put resetting C_EOF (ITS#8489)
* Fix mdb_env_copyfd2 to return EPIPE on SIGPIPE (ITS#8504)
* Fix mdb_env_copy with empty DB (ITS#8209)
* Fix behaviors with fork (ITS#8505)
* Fix mdb_dbi_open with mainDB cursors (ITS#8542)
* Fix robust mutexes on kFreeBSD (ITS#8554)
* Fix utf8_to_utf16 error checks (ITS#7992)
* Fix F_NOCACHE on MacOS, error is non-fatal (ITS#7682)
* Build
Make shared lib suffix overridable (ITS#8481)
* Documentation
+ Cleanup doxygen nits
+ Note reserved vs actual mem/disk usage
- LMDB 0.9.18 Release (2016/02/05)
* Fix robust mutex detection on glibc 2.10-11 (ITS#8330)
* Fix page_search_root assert on FreeDB (ITS#8336)
* Fix MDB_APPENDDUP vs. rewrite(single item) (ITS#8334)
* Fix mdb_copy of large files on Windows
* Fix subcursor move after delete (ITS#8355)
* Fix mdb_midl_shirnk off-by-one (ITS#8363)
* Check for utf8_to_utf16 failures (ITS#7992)
* Catch strdup failure in mdb_dbi_open
* Build
+ Additional makefile var tweaks (ITS#8169)
* Documentation
+ Add Getting Started page
+ Update WRITEMAP description
- Drop 0002-Autoconf-files.patch, soname-configurable.patch and
add Makefile-build-use-shared-lib.patch instead. Instead of
replacing the Makefile with a libtool/automake based one, just
patch the relevant parts of the upstream Makefile.
-------------------------------------------------------------------
Fri Oct 13 13:45:42 UTC 2017 - dmueller@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package lmdb
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# 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
@ -20,8 +20,8 @@ Name: lmdb
Summary: Lightning Memory-Mapped Database Manager
License: OLDAP-2.8
Group: Productivity/Databases/Tools
%define lname liblmdb-0_9_17
Version: 0.9.17
%define lname liblmdb-0_9_22
Version: 0.9.22
Release: 0
Url: http://symas.com/mdb/
@ -31,16 +31,15 @@ Source99: baselibs.conf
# 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
Patch2: liblmdb-implicit-decl.patch
# PATCH-FIX-OPENSUSE - Build and link to shared library
Patch3: Makefile-build-use-shared-lib.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake >= 1.10
BuildRequires: libtool >= 2
%if 0%{?rhel_version} == 700
BuildRequires: perl-Exporter
%endif
%description
LMDB is a Btree-based database management library with an API similar
@ -88,20 +87,20 @@ the liblmdb library.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
sed -i -e 's,__VERSION__,%version,' libraries/liblmdb/Makefile.am
%build
cd libraries/liblmdb
mkdir -p m4
autoreconf -fi
%configure --disable-static
make %{?_smp_mflags} V=1
make %{?_smp_mflags} V=1 SOVERSION=%{version} CFLAGS="%{optflags}"
%install
cd libraries/liblmdb
make install DESTDIR="%buildroot"
rm -f "%buildroot/%_libdir"/*.la
make install DESTDIR="%buildroot" SOVERSION=%{version} \
bindir=%{_bindir} \
libdir=%{_libdir} \
mandir=%{_mandir} \
includedir=%{_includedir} \
datarootdir=%{_datadir}
ln -s %{_libdir}/liblmdb-%{version}.so %{buildroot}%{_libdir}/liblmdb.so
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

View File

@ -1,12 +0,0 @@
Index: lmdb-LMDB_0.9.17/libraries/liblmdb/Makefile.am
===================================================================
--- lmdb-LMDB_0.9.17.orig/libraries/liblmdb/Makefile.am
+++ lmdb-LMDB_0.9.17/libraries/liblmdb/Makefile.am
@@ -1,6 +1,6 @@
lib_LTLIBRARIES = liblmdb.la
liblmdb_la_SOURCES = mdb.c midl.c
-liblmdb_la_LDFLAGS=-no-undefined -avoid-version
+liblmdb_la_LDFLAGS = -no-undefined -release __VERSION__
bin_PROGRAMS = mdb_stat mdb_copy mdb_load mdb_dump lmdump lmmgr
mdb_stat_LDADD = liblmdb.la