diff --git a/lmdb-LMDB_0.9.29.tar.gz b/lmdb-LMDB_0.9.29.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1784ff7e940a23a274d8086ea87d53e2150e1a5d Binary files /dev/null and b/lmdb-LMDB_0.9.29.tar.gz differ diff --git a/lmdb.pc.in b/lmdb.pc.in new file mode 100644 index 0000000000000000000000000000000000000000..b26cf70d2fb7f749d1b1a37ff96c6fb8386160cd --- /dev/null +++ b/lmdb.pc.in @@ -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} diff --git a/lmdb.spec b/lmdb.spec new file mode 100644 index 0000000000000000000000000000000000000000..ab98e0254cdd51912b5824119ea1825a51ee9966 --- /dev/null +++ b/lmdb.spec @@ -0,0 +1,115 @@ +%define anolis_release 1 + +Name: lmdb +Version: 0.9.29 +Release: %{anolis_release}%{?dist} +Summary: Memory-mapped key-value database +License: OpenLDAP +URL: http://symas.com/mdb + +%global archive_path libraries/lib%{name} + +Source0: lmdb-LMDB_%{version}.tar.gz +Source1: lmdb.pc.in + +BuildRequires: make +BuildRequires: gcc +BuildRequires: doxygen + +%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}%{?_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 +%autosetup -p1 -n lmdb-LMDB_%{version} + + +%build +pushd %{archive_path} +%set_build_flags +%make_build XCFLAGS="%{build_cflags}" +# 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_install prefix=%{_prefix} libdir=%{_libdir} mandir=%{_mandir} +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 +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}/*.a +%{_libdir}/pkgconfig/*.pc + +%files doc +%doc %{archive_path}/html +%doc %{archive_path}/COPYRIGHT +%doc %{archive_path}/CHANGES +%license %{archive_path}/LICENSE + + +%changelog +* Thu Mar 10 2022 Liwei Ge - 0.9.29-1 +- Init version from upstream v0.9.29