import lmdb-0.9.23-5.el8
This commit is contained in:
commit
4fa7fa854c
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/LMDB_0.9.23.tar.gz
|
1
.lmdb.metadata
Normal file
1
.lmdb.metadata
Normal file
@ -0,0 +1 @@
|
||||
801e97190ab68fdceb6daf5fc623f9c3c29d4b4a SOURCES/LMDB_0.9.23.tar.gz
|
37
SOURCES/lmdb-covscan.patch
Normal file
37
SOURCES/lmdb-covscan.patch
Normal file
@ -0,0 +1,37 @@
|
||||
diff -up ./libraries/liblmdb/midl.c.fix ./libraries/liblmdb/midl.c
|
||||
--- ./libraries/liblmdb/midl.c.fix 2019-06-19 11:10:07.791337785 +0200
|
||||
+++ ./libraries/liblmdb/midl.c 2019-06-19 11:16:04.005166705 +0200
|
||||
@@ -120,9 +120,15 @@ void mdb_midl_free(MDB_IDL ids)
|
||||
void mdb_midl_shrink( MDB_IDL *idp )
|
||||
{
|
||||
MDB_IDL ids = *idp;
|
||||
- if (*(--ids) > MDB_IDL_UM_MAX &&
|
||||
- (ids = realloc(ids, (MDB_IDL_UM_MAX+2) * sizeof(MDB_ID))))
|
||||
+ MDB_IDL res = NULL;
|
||||
+ if (*(--ids) > MDB_IDL_UM_MAX)
|
||||
{
|
||||
+ res = realloc(ids, (MDB_IDL_UM_MAX+2) * sizeof(MDB_ID));
|
||||
+ if (res)
|
||||
+ ids = res;
|
||||
+ else
|
||||
+ return;
|
||||
+
|
||||
*ids++ = MDB_IDL_UM_MAX;
|
||||
*idp = ids;
|
||||
}
|
||||
@@ -131,10 +137,13 @@ void mdb_midl_shrink( MDB_IDL *idp )
|
||||
static int mdb_midl_grow( MDB_IDL *idp, int num )
|
||||
{
|
||||
MDB_IDL idn = *idp-1;
|
||||
+ MDB_IDL res = NULL;
|
||||
/* grow it */
|
||||
- idn = realloc(idn, (*idn + num + 2) * sizeof(MDB_ID));
|
||||
- if (!idn)
|
||||
+ res = realloc(idn, (*idn + num + 2) * sizeof(MDB_ID));
|
||||
+ if (!res)
|
||||
return ENOMEM;
|
||||
+ else
|
||||
+ idn = res;
|
||||
*idn++ += num;
|
||||
*idp = idn;
|
||||
return 0;
|
76
SOURCES/lmdb-make.patch
Normal file
76
SOURCES/lmdb-make.patch
Normal file
@ -0,0 +1,76 @@
|
||||
diff -up lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile.orig lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile
|
||||
--- lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile.orig 2017-01-04 12:14:24.303344915 +0100
|
||||
+++ lmdb-LMDB_0.9.19/libraries/liblmdb/Makefile 2017-01-04 12:19:20.190295319 +0100
|
||||
@@ -26,6 +26,7 @@ OPT = -O2 -g
|
||||
CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS)
|
||||
LDLIBS =
|
||||
SOLIBS =
|
||||
+SOVERSION = 0.0.0
|
||||
SOEXT = .so
|
||||
prefix = /usr/local
|
||||
exec_prefix = $(prefix)
|
||||
@@ -38,7 +39,7 @@ mandir = $(datarootdir)/man
|
||||
########################################################################
|
||||
|
||||
IHDRS = lmdb.h
|
||||
-ILIBS = liblmdb.a liblmdb$(SOEXT)
|
||||
+ILIBS = liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVERSION)
|
||||
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
|
||||
@@ -49,13 +50,13 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
|
||||
mkdir -p $(DESTDIR)$(libdir)
|
||||
mkdir -p $(DESTDIR)$(includedir)
|
||||
mkdir -p $(DESTDIR)$(mandir)/man1
|
||||
- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
|
||||
- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
|
||||
- for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
|
||||
- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
|
||||
+ for f in $(IPROGS); do cp -a $$f $(DESTDIR)$(bindir); done
|
||||
+ for f in $(ILIBS); do cp -a $$f $(DESTDIR)$(libdir); done
|
||||
+ for f in $(IHDRS); do cp -a $$f $(DESTDIR)$(includedir); done
|
||||
+ for f in $(IDOCS); do cp -a $$f $(DESTDIR)$(mandir)/man1; done
|
||||
|
||||
clean:
|
||||
- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb
|
||||
+ rm -rf $(PROGS) *.[ao] *.[ls]o* *~ testdb
|
||||
|
||||
test: all
|
||||
rm -rf testdb && mkdir testdb
|
||||
@@ -64,20 +65,24 @@ test: all
|
||||
liblmdb.a: mdb.o midl.o
|
||||
$(AR) rs $@ mdb.o midl.o
|
||||
|
||||
-liblmdb$(SOEXT): mdb.lo midl.lo
|
||||
+liblmdb$(SOEXT): liblmdb$(SOEXT).$(SOVERSION)
|
||||
+ rm -f $@
|
||||
+ ln -s $< $@
|
||||
+
|
||||
+liblmdb$(SOEXT).$(SOVERSION): 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 -Wl,-soname,$@ -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_stat: mdb_stat.o liblmdb.so
|
||||
+mdb_copy: mdb_copy.o liblmdb.so
|
||||
+mdb_dump: mdb_dump.o liblmdb.so
|
||||
+mdb_load: mdb_load.o liblmdb.so
|
||||
+mtest: mtest.o liblmdb.so
|
||||
+mtest2: mtest2.o liblmdb.so
|
||||
+mtest3: mtest3.o liblmdb.so
|
||||
+mtest4: mtest4.o liblmdb.so
|
||||
+mtest5: mtest5.o liblmdb.so
|
||||
+mtest6: mtest6.o liblmdb.so
|
||||
|
||||
mdb.o: mdb.c lmdb.h midl.h
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c
|
14
SOURCES/lmdb-s390-check.patch
Normal file
14
SOURCES/lmdb-s390-check.patch
Normal file
@ -0,0 +1,14 @@
|
||||
# The s390 architecture needs a pause before accessing the test DB.
|
||||
|
||||
diff -up lmdb-LMDB_0.9.17/libraries/liblmdb/Makefile.orig lmdb-LMDB_0.9.17/libraries/liblmdb/Makefile
|
||||
--- lmdb-LMDB_0.9.17/libraries/liblmdb/Makefile.orig 2015-12-03 09:21:35.621480706 +0100
|
||||
+++ lmdb-LMDB_0.9.17/libraries/liblmdb/Makefile 2015-12-03 09:22:10.069644210 +0100
|
||||
@@ -57,7 +57,7 @@ clean:
|
||||
|
||||
test: all
|
||||
rm -rf testdb && mkdir testdb
|
||||
- ./mtest && ./mdb_stat testdb
|
||||
+ ./mtest && sleep 1 && ./mdb_stat testdb
|
||||
|
||||
liblmdb.a: mdb.o midl.o
|
||||
$(AR) rs $@ mdb.o midl.o
|
11
SOURCES/lmdb.pc.in
Normal file
11
SOURCES/lmdb.pc.in
Normal file
@ -0,0 +1,11 @@
|
||||
prefix=@PREFIX@
|
||||
exec_prefix=@EXEC_PREFIX@
|
||||
libdir=@LIBDIR@
|
||||
includedir=@INCLUDEDIR@
|
||||
|
||||
Name: liblmdb
|
||||
Description: Lightning Memory-mapped key-value database
|
||||
URL: http://symas.com/mdb/
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -llmdb
|
||||
Cflags: -I${includedir}
|
138
SPECS/lmdb.spec
Normal file
138
SPECS/lmdb.spec
Normal file
@ -0,0 +1,138 @@
|
||||
# The files themselves are in several subdirectories and need to be prefixed wit this.
|
||||
%global archive_path libraries/lib%{name}
|
||||
|
||||
Name: lmdb
|
||||
Version: 0.9.23
|
||||
Release: 5%{?dist}
|
||||
Summary: Memory-mapped key-value database
|
||||
|
||||
License: OpenLDAP
|
||||
URL: http://symas.com/mdb/
|
||||
Source0: https://github.com/LMDB/lmdb/archive/LMDB_%{version}.tar.gz
|
||||
Source1: lmdb.pc.in
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: doxygen
|
||||
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
# Patch description in the corresponding file
|
||||
Patch0: lmdb-make.patch
|
||||
Patch1: lmdb-s390-check.patch
|
||||
Patch2: lmdb-covscan.patch
|
||||
|
||||
%description
|
||||
LMDB is an ultra-fast, ultra-compact key-value embedded data
|
||||
store developed by Symas for the OpenLDAP Project. By using memory-mapped files,
|
||||
it provides the read performance of a pure in-memory database while still
|
||||
offering the persistence of standard disk-based databases, and is only limited
|
||||
to the size of the virtual address space.
|
||||
|
||||
%package libs
|
||||
Summary: Shared libraries for %{name}
|
||||
|
||||
%description libs
|
||||
The %{name}-libs package contains shared libraries necessary for running
|
||||
applications that use %{name}.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for %{name}
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
The %{name}-devel package contains libraries and header files for
|
||||
developing applications that use %{name}.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation files for %{name}
|
||||
BuildArch: noarch
|
||||
|
||||
%description doc
|
||||
The %{name}-doc package contains automatically generated documentation for %{name}.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-LMDB_%{version}
|
||||
%patch0 -p1 -b .make
|
||||
%patch1 -p1 -b .s390-check
|
||||
%patch2 -p1 -b .covscan
|
||||
|
||||
%build
|
||||
pushd %{archive_path}
|
||||
make LDFLAGS="%{build_ldflags}" XCFLAGS="%{optflags}" %{?_smp_mflags}
|
||||
# Build doxygen documentation
|
||||
doxygen
|
||||
# remove unpackaged files
|
||||
rm -f Doxyfile
|
||||
rm -rf man # Doxygen generated manpages
|
||||
popd
|
||||
|
||||
%install
|
||||
pushd %{archive_path}
|
||||
# make install expects existing directory tree
|
||||
mkdir -m 0755 -p %{buildroot}{%{_bindir},%{_includedir}}
|
||||
mkdir -m 0755 -p %{buildroot}{%{_libdir}/pkgconfig,%{_mandir}/man1}
|
||||
make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} mandir=%{_mandir} install
|
||||
popd
|
||||
|
||||
# Install pkgconfig file
|
||||
sed -e 's:@PREFIX@:%{_prefix}:g' \
|
||||
-e 's:@EXEC_PREFIX@:%{_exec_prefix}:g' \
|
||||
-e 's:@LIBDIR@:%{_libdir}:g' \
|
||||
-e 's:@INCLUDEDIR@:%{_includedir}:g' \
|
||||
-e 's:@PACKAGE_VERSION@:%{version}:g' \
|
||||
%{SOURCE1} >lmdb.pc
|
||||
install -Dpm 0644 -t %{buildroot}%{_libdir}/pkgconfig lmdb.pc
|
||||
|
||||
%check
|
||||
%if 0%{?rhel} == 6 && %{_arch} == "ppc64"
|
||||
# rhel6 ppc64: skip unit tests
|
||||
exit 0
|
||||
%endif
|
||||
|
||||
pushd %{archive_path}
|
||||
rm -rf testdb
|
||||
LD_LIBRARY_PATH=$PWD make test
|
||||
popd
|
||||
|
||||
%ldconfig_scriptlets libs
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/*
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%files libs
|
||||
%doc %{archive_path}/COPYRIGHT
|
||||
%doc %{archive_path}/CHANGES
|
||||
%license %{archive_path}/LICENSE
|
||||
%{_libdir}/*.so.*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
|
||||
%files doc
|
||||
%doc %{archive_path}/html
|
||||
%doc %{archive_path}/COPYRIGHT
|
||||
%doc %{archive_path}/CHANGES
|
||||
%license %{archive_path}/LICENSE
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Jun 18 2019 Radovan Sroka <rsroka@redhat.com> - 0.9.23-5
|
||||
- fixed resolves from RPMDIFF
|
||||
- fixed some covscan issues
|
||||
|
||||
* Wed Jun 12 2019 Radovan Sroka <rsroka@redhat.com> - 0.9.23-4
|
||||
- propagate ldflags for makefile
|
||||
- added explicit Requires for -libs
|
||||
|
||||
* Wed May 15 2019 Radovan Sroka <rsroka@redhat.com> - 0.9.23-3
|
||||
- rebuild
|
||||
|
||||
* Mon Apr 29 2019 Radovan Sroka <rsroka@redhat.com> - 0.9.23-2
|
||||
- Initial Package
|
||||
- Resolves: rhbz#1692264
|
Loading…
Reference in New Issue
Block a user