Package init
This commit is contained in:
commit
193e2889d8
BIN
LMDB_0.9.22.tar.gz
Normal file
BIN
LMDB_0.9.22.tar.gz
Normal file
Binary file not shown.
76
lmdb-make.patch
Normal file
76
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
lmdb-s390-check.patch
Normal file
14
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
lmdb.pc.in
Normal file
11
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}
|
||||||
96
lmdb.spec
Normal file
96
lmdb.spec
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
Name: lmdb
|
||||||
|
Version: 0.9.22
|
||||||
|
Release: 4
|
||||||
|
Summary: An extraordinarily fast, memory-efficient database
|
||||||
|
License: OpenLDAP
|
||||||
|
URL: http://symas.com/lmdb/
|
||||||
|
Source0: https://github.com/LMDB/lmdb/archive/LMDB_%{version}.tar.gz
|
||||||
|
Source1: lmdb.pc.in
|
||||||
|
|
||||||
|
BuildRequires: gcc, make, doxygen, git
|
||||||
|
|
||||||
|
Patch0: lmdb-make.patch
|
||||||
|
Patch1: lmdb-s390-check.patch
|
||||||
|
|
||||||
|
Provides: %{name}-libs
|
||||||
|
Obsoletes: %{name}-libs
|
||||||
|
|
||||||
|
%description
|
||||||
|
Symas LMDB is an extraordinarily fast, memory-efficient database
|
||||||
|
we developed for the OpenLDAP Project. With memory-mapped files,
|
||||||
|
it has the read performance of a pure in-memory database while
|
||||||
|
retaining the persistence of standard disk-based databases.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development libraries and files for %{name}
|
||||||
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
The package contains lib and header files for developing application
|
||||||
|
that use %{name}
|
||||||
|
|
||||||
|
%package_help
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{name}-LMDB_%{version} -p1 -Sgit
|
||||||
|
|
||||||
|
%build
|
||||||
|
pushd libraries/lib%{name}
|
||||||
|
%make_build XCFLAGS="%{optflags}"
|
||||||
|
|
||||||
|
doxygen
|
||||||
|
rm -f Doxyfile || :
|
||||||
|
rm -rf man || :
|
||||||
|
popd
|
||||||
|
|
||||||
|
%install
|
||||||
|
pushd libraries/lib%{name}
|
||||||
|
mkdir -m 0755 -p %{buildroot}{%{_exec_prefix}/bin,%{_exec_prefix}/include}
|
||||||
|
mkdir -m 0755 -p %{buildroot}{%{_exec_prefix}/%{_lib}/pkgconfig,%{_datadir}/man/man1}
|
||||||
|
make DESTDIR=%{buildroot} prefix=%{_exec_prefix} libdir=%{_exec_prefix}/%{_lib} mandir=%{_datadir}/man install
|
||||||
|
popd
|
||||||
|
|
||||||
|
sed -e 's:@PREFIX@:%{_exec_prefix}:g' \
|
||||||
|
-e 's:@EXEC_PREFIX@:%{_exec_prefix}:g' \
|
||||||
|
-e 's:@LIBDIR@:%{_exec_prefix}/%{_lib}:g' \
|
||||||
|
-e 's:@INCLUDEDIR@:%{_exec_prefix}/include:g' \
|
||||||
|
-e 's:@PACKAGE_VERSION@:%{version}:g' \
|
||||||
|
%{SOURCE1} >lmdb.pc
|
||||||
|
install -Dpm 0644 -t %{buildroot}%{_exec_prefix}/%{_lib}/pkgconfig lmdb.pc
|
||||||
|
|
||||||
|
%check
|
||||||
|
|
||||||
|
pushd libraries/lib%{name}
|
||||||
|
rm -rf testdb || :
|
||||||
|
LD_LIBRARY_PATH=$PWD make test
|
||||||
|
popd
|
||||||
|
|
||||||
|
%post
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%postun
|
||||||
|
/sbin/ldconfig
|
||||||
|
|
||||||
|
%files
|
||||||
|
%{_exec_prefix}/bin/*
|
||||||
|
%{_exec_prefix}/%{_lib}/*.so.*
|
||||||
|
%doc libraries/lib%{name}/CHANGES
|
||||||
|
%doc libraries/lib%{name}/COPYRIGHT
|
||||||
|
%license libraries/lib%{name}/LICENSE
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%{_exec_prefix}/include/*
|
||||||
|
%{_exec_prefix}/%{_lib}/*.so
|
||||||
|
%{_exec_prefix}/%{_lib}/pkgconfig/*.pc
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%{_datadir}/man/man1/*
|
||||||
|
%doc libraries/lib%{name}/html
|
||||||
|
%doc libraries/lib%{name}/COPYRIGHT
|
||||||
|
%doc libraries/lib%{name}/CHANGES
|
||||||
|
%license libraries/lib%{name}/LICENSE
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Sep 20 2019 caomeng<caomeng5@huawei.com> - 0.9.22-4
|
||||||
|
- Package init
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user