# # spec file for package lmdb # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless 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/ # Name: lmdb %define libname liblmdb %define libsoname %{libname}0 License: OLDAP-2.8 Group: Productivity/Databases/Tools Summary: LMDB is a tiny database with some great capabilities Version: 0.9.11 Release: 0 Url: http://symas.com/mdb Source: %{name}-%{version}.tar.bz2 # fix prefix and libdir Patch: liblmdb.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description LMDB is a tiny database with some great capabilities: Ordered-map interface (keys are always sorted, supports range lookups) Fully transactional, full ACID semantics with MVCC. Reader/writer transactions: readers don't block writers and writers don't block readers. Writers are fully serialized, so writes are always deadlock-free. Read transactions are extremely cheap, and can be performed using no mallocs or any other blocking calls. Supports multi-thread and multi-process concurrency, environments may be opened by multiple processes on the same host. Multiple sub-databases may be created with transactions covering all sub-databases. Memory-mapped, allowing for zero-copy lookup and iteration. Maintenance-free, no external process or background cleanup/compaction required. No application-level caching. LMDB fully exploits the operating system's buffer cache. 32KB of object code and 6KLOC of C. Licensed under the OpenLDAP Public License It is a read-optimized design and performs reads several times faster than other DB engines, several orders of magnitude faster in many cases. It is not a write-optimized design; for heavy random write workloads other DB designs may be more suitable. %package -n %{libsoname} Summary: Shared library of Lightning MDB (LMDB) Group: System/Libraries %if 0%{?suse_version} == 1010 Requires: glibc %endif %description -n %{libsoname} This package contains the shared lightning memory data base (lmdb) %package devel Summary: Development package for lmdb Group: Development/Libraries/C and C++ Requires: %{libsoname} = %{version} %description devel A high-speed in-memory database. This package contains the files needed to compile programs that use the liblmdb library. %prep %setup -q -n %{libname} %patch -p1 %build MANDIR=%{_mandir} LIB=%{_lib} %{__make} %install install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_libdir} install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_prefix}/include MANDIR=%{_mandir} LIB=%{_lib} %{__make} install DESTDIR=%{buildroot} mv %{buildroot}%{_libdir}/liblmdb.so %{buildroot}%{_libdir}/liblmdb0.so.0 (cd %{buildroot}%{_libdir}; ln -s liblmdb0.so.0 liblmdb.so) install -m 644 lmdb.h %{buildroot}%{_prefix}/include rm -f %{buildroot}%{_libdir}/*.a %post -n %{libsoname} /sbin/ldconfig %postun -n %{libsoname} /sbin/ldconfig %files %defattr(-,root,root) %doc CHANGES %doc COPYRIGHT %doc LICENSE %{_bindir}/* %doc %{_mandir}/man1/* %files -n %{libsoname} %defattr(-,root,root) %{_libdir}/*.so.* %files devel %defattr(-,root,root) %{_prefix}/include/* %{_libdir}/*.so %changelog