diff --git a/SOURCES/lmdb-make.patch b/SOURCES/lmdb-make.patch new file mode 100644 index 00000000..9fe4bd79 --- /dev/null +++ b/SOURCES/lmdb-make.patch @@ -0,0 +1,78 @@ +# Patch the main Makefile to allow for a build that complies to packaging guidelines. + +diff -up lmdb-LMDB_0.9.18/libraries/liblmdb/Makefile.oldmake lmdb-LMDB_0.9.18/libraries/liblmdb/Makefile +--- lmdb-LMDB_0.9.18/libraries/liblmdb/Makefile.oldmake 2016-02-10 11:25:58.609614905 +0100 ++++ lmdb-LMDB_0.9.18/libraries/liblmdb/Makefile 2016-02-10 11:28:27.100398910 +0100 +@@ -26,6 +26,7 @@ OPT = -O2 -g + CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) + LDLIBS = + SOLIBS = ++SOVERSION = 0.0.0 + prefix = /usr/local + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin +@@ -37,7 +38,7 @@ mandir = $(datarootdir)/man + ######################################################################## + + IHDRS = lmdb.h +-ILIBS = liblmdb.a liblmdb.so ++ILIBS = liblmdb.so liblmdb.so.$(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 +@@ -48,13 +49,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 +@@ -63,20 +64,24 @@ test: all + liblmdb.a: mdb.o midl.o + $(AR) rs $@ mdb.o midl.o + +-liblmdb.so: mdb.lo midl.lo ++liblmdb.so: liblmdb.so.$(SOVERSION) ++ rm -f $@ ++ ln -s $< $@ ++ ++liblmdb.so.$(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 diff --git a/SOURCES/lmdb-optflags.patch b/SOURCES/lmdb-optflags.patch new file mode 100644 index 00000000..6595b46a --- /dev/null +++ b/SOURCES/lmdb-optflags.patch @@ -0,0 +1,11 @@ +--- lmdb-LMDB_0.9.18/libraries/liblmdb/Makefile 2016-10-12 10:28:17.860379142 +0200 ++++ lmdb-LMDB_0.9.18/libraries/liblmdb/Makefile 2016-10-12 10:28:30.305379142 +0200 +@@ -22,7 +22,7 @@ + AR = ar + W = -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized + THREADS = -pthread +-OPT = -O2 -g ++OPT = + CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) + LDLIBS = + SOLIBS = diff --git a/SOURCES/lmdb-s390-check.patch b/SOURCES/lmdb-s390-check.patch new file mode 100644 index 00000000..d51785b4 --- /dev/null +++ b/SOURCES/lmdb-s390-check.patch @@ -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 diff --git a/SPECS/lmdb.spec b/SPECS/lmdb.spec new file mode 100644 index 00000000..7ecbc5e6 --- /dev/null +++ b/SPECS/lmdb.spec @@ -0,0 +1,149 @@ +# 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.18 +Release: 1%{?dist} +Summary: Memory-mapped key-value database + +License: OpenLDAP +URL: http://symas.com/mdb/ +Source: https://github.com/LMDB/lmdb/archive/LMDB_%{version}.tar.gz +# Patch description in the corresponding file +Patch0: lmdb-make.patch +Patch1: lmdb-s390-check.patch +Patch2: lmdb-optflags.patch + +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 +Group: Documentation + +%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 .optflags + + +%build +pushd %{archive_path} +make 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}%{_prefix}{/bin,/include} +mkdir -m 0755 -p %{buildroot}{%{_libdir},%{_mandir}/man1} +make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} mandir=%{_mandir} install +popd + + +%check +pushd %{archive_path} +rm -rf testdb +LD_LIBRARY_PATH=$PWD make test +popd + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + +%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 + +%files doc +%doc %{archive_path}/html +%doc %{archive_path}/COPYRIGHT +%doc %{archive_path}/CHANGES +%license %{archive_path}/LICENSE + + +%changelog +* Wed Feb 10 2016 Jan Stanek - 0.9.18-1 +- Update to 0.9.18 + +* Thu Feb 04 2016 Fedora Release Engineering - 0.9.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Dec 28 2015 Jan Vcelak 0.9.17-2 +- Make liblmdb.so a symbolic link to (not a copy of) the versioned DSO + +* Thu Dec 03 2015 Jan Staněk - 0.9.17-1 +- Update to 0.9.17 + +* Wed Nov 25 2015 Jan Staněk - 0.9.16-2 +- Return the name 'Symas' into description + +* Fri Aug 14 2015 Jan Staněk - 0.9.16-1 +- Updated to 0.9.16 + +* Wed Jun 17 2015 Fedora Release Engineering - 0.9.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Dec 11 2014 Jan Staněk - 0.9.14-1 +- Updated to 0.9.14 + +* Sun Aug 17 2014 Fedora Release Engineering - 0.9.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jul 18 2014 Jan Stanek - 0.9.13-1 +- Updated to 0.9.13 + +* Mon Jul 14 2014 Jan Stanek - 0.9.11-4 +- Changed install instruction to be compatible with older coreutils (#1119084) + +* Thu Jun 26 2014 Jan Stanek - 0.9.11-3 +- Added delay in testing which was needed on s390* arches (#1104232) + +* Sat Jun 07 2014 Fedora Release Engineering - 0.9.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 27 2014 Jan Stanek - 0.9.11-1 +- Initial Package