diff --git a/.gitignore b/.gitignore index e69de29..1a0790e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/lmdb-0.9.11.tar.gz diff --git a/lmdb-make.patch b/lmdb-make.patch new file mode 100644 index 0000000..eb5ca3e --- /dev/null +++ b/lmdb-make.patch @@ -0,0 +1,75 @@ +# Update main Makefile in oprder to build and install follow guidelines + +diff -up liblmdb/Makefile.orig liblmdb/Makefile +--- liblmdb/Makefile.orig 2014-05-22 13:56:31.804238561 +0200 ++++ liblmdb/Makefile 2014-05-22 13:56:45.959294775 +0200 +@@ -23,25 +23,30 @@ OPT = -O2 -g + CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) + LDLIBS = + SOLIBS = ++SOVERSION = 0.0.0 + prefix = /usr/local ++binprefix = $(prefix)/bin ++libprefix = $(prefix)/lib ++includeprefix = $(prefix)/include ++manprefix = $(prefix)/man + + ######################################################################## + + IHDRS = lmdb.h +-ILIBS = liblmdb.a liblmdb.so ++ILIBS = liblmdb.so liblmdb.so.$(SOVERSION) + IPROGS = mdb_stat mdb_copy + IDOCS = mdb_stat.1 mdb_copy.1 + PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5 + all: $(ILIBS) $(PROGS) + + install: $(ILIBS) $(IPROGS) $(IHDRS) +- 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)$(prefix)/man/man1; done ++ for f in $(IPROGS); do cp $$f $(DESTDIR)$(binprefix); done ++ for f in $(ILIBS); do cp -d $$f $(DESTDIR)$(libprefix); done ++ for f in $(IHDRS); do cp $$f $(DESTDIR)$(includeprefix); done ++ for f in $(IDOCS); do cp $$f $(DESTDIR)$(manprefix)/man1; done + + clean: +- rm -rf $(PROGS) *.[ao] *.so *~ testdb ++ rm -rf $(PROGS) *.[ao] *.so* *~ testdb + + test: all + mkdir testdb +@@ -50,18 +55,22 @@ test: all + liblmdb.a: mdb.o midl.o + ar rs $@ mdb.o midl.o + +-liblmdb.so: mdb.o midl.o ++liblmdb.so: liblmdb.so.$(SOVERSION) ++ rm -f $@ ++ ln -s $< $@ ++ ++liblmdb.so.$(SOVERSION): mdb.o midl.o + # $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS) +- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.o midl.o $(SOLIBS) ++ $(CC) $(LDFLAGS) -pthread -shared -Wl,-soname,$@ -o $@ mdb.o midl.o $(SOLIBS) + +-mdb_stat: mdb_stat.o liblmdb.a +-mdb_copy: mdb_copy.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 ++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) -fPIC $(CPPFLAGS) -c mdb.c diff --git a/lmdb.spec b/lmdb.spec new file mode 100644 index 0000000..fbf34af --- /dev/null +++ b/lmdb.spec @@ -0,0 +1,97 @@ +Name: lmdb +Version: 0.9.11 +Release: 1%{?dist} +Summary: Memory-mapped key-value database + +License: OpenLDAP +URL: http://symas.com/mdb/ +# Source built from git. To get the tarball, execute following commands: +# $ export VERSION=%%{version} +# $ git clone git://gitorious.org/mdb/mdb.git lmdb && pushd lmdb +# $ git checkout tags/LMDB_$VERSION && popd +# $ tar cvzf lmdb-$VERSION.tar.gz -C lmdb/libraries/ liblmdb +Source: %{name}-%{version}.tar.gz +# Patch description in the corresponding file +Patch0: lmdb-make.patch + +BuildRequires: doxygen + +%description +LMDB is an ultra-fast, ultra-compact key-value embedded data +store developed by 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 +Group: Documentation + +%description doc +The %{name}-doc package contains automatically generated documentation for %{name}. + + +%prep +%setup -q -n lib%{name} +%patch0 -p1 -b .make + + +%build +make XCFLAGS="%{optflags}" %{?_smp_mflags} +# Build doxygen documentation +doxygen +# remove unpackaged files +rm -f Doxyfile +rm -rf man # Doxygen generated manpages + +%install +# make install expects existing directory tree +mkdir -m=0755 -p %{buildroot}%{_prefix}{/bin,/include} +mkdir -m=0755 -p %{buildroot}{%{_libdir},%{_mandir}/man1} +make DESTDIR=%{buildroot} prefix=%{_prefix} libprefix=%{_libdir} manprefix=%{_mandir} install + + +%check +rm -rf testdb +LD_LIBRARY_PATH=$PWD make test + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + +%files +%{_bindir}/* +%{_mandir}/man1/* + +%files libs +%doc COPYRIGHT CHANGES LICENSE +%{_libdir}/*.so.* + +%files devel +%{_includedir}/* +%{_libdir}/*.so + +%files doc +%doc html COPYRIGHT CHANGES LICENSE + + +%changelog +* Tue May 27 2014 Jan Stanek - 0.9.11-1 +- Initial Package diff --git a/sources b/sources index e69de29..f33edca 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +da243be5f2c3bcfade82c30d67178ad9 lmdb-0.9.11.tar.gz