packaging: Add RPM spec file for packaging
authorSangjung woo <sangjung.woo@samsung.com>
Mon, 25 Sep 2017 10:48:56 +0000 (19:48 +0900)
committerInki Dae <inki.dae@samsung.com>
Mon, 12 Mar 2018 05:38:14 +0000 (14:38 +0900)
This patch newly added the RPM spec & manifest files to build RPM
packages. This also fixed the Makefile to use %{_prefix} variable
since installed path is fixed as '/usr/local'.

Signed-off-by: Sangjung woo <sangjung.woo@samsung.com>
Corrected subject format.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
libraries/liblmdb/Makefile
packaging/lmdb.manifest [new file with mode: 0644]
packaging/lmdb.spec [new file with mode: 0644]

index 72d0984..ded965a 100644 (file)
@@ -27,10 +27,14 @@ CFLAGS      = $(THREADS) $(OPT) $(W) $(XCFLAGS)
 LDLIBS = # -lntdll # Windows needs ntdll
 SOLIBS = # -lntdll
 SOEXT  = .so
-prefix = /usr/local
+
+# Instead of fixed path in Makefile,
+# use the environment variables in build system
+prefix = $(PREFIX)
+libdir  = $(LIBDIR)
+
 exec_prefix = $(prefix)
 bindir = $(exec_prefix)/bin
-libdir = $(exec_prefix)/lib
 includedir = $(prefix)/include
 datarootdir = $(prefix)/share
 mandir = $(datarootdir)/man
diff --git a/packaging/lmdb.manifest b/packaging/lmdb.manifest
new file mode 100644 (file)
index 0000000..2a0cec5
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+  <request>
+    <domain name="_"/>
+  </request>
+</manifest>
diff --git a/packaging/lmdb.spec b/packaging/lmdb.spec
new file mode 100644 (file)
index 0000000..f3b897c
--- /dev/null
@@ -0,0 +1,103 @@
+%define lname  liblmdb-0_9_17
+%define prefix  %{_prefix}
+%define libdir  %{_libdir}
+
+Name:           lmdb
+Summary:        Lightning Memory-Mapped Database Manager
+License:        OLDAP-2.8
+Group:          Productivity/Databases/Tools
+Version:        0.9.17
+Release:        0
+Url:            http://symas.com/mdb/
+
+Source:         https://github.com/LMDB/lmdb/archive/LMDB_%version.tar.gz
+# Source99:       baselibs.conf
+
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+# BuildRequires:  autoconf
+BuildRequires:  automake >= 1.10
+BuildRequires:  libtool >= 2
+
+%description
+LMDB is a Btree-based database management library with an API similar
+to BerkeleyDB. The library is thread-aware and supports concurrent
+read/write access from multiple processes and threads. The DB
+structure is multi-versioned, and data pages use a copy-on-write
+strategy, which also provides resistance to corruption and eliminates
+the need for any recovery procedures. The database is exposed in a
+memory map, requiring no page cache layer of its own.
+
+%package -n %lname
+Summary:        Shared library for Lightning Memory-Mapped Database (LMDB)
+Group:          System/Libraries
+
+%description -n %lname
+LMDB is a Btree-based database management library with an API similar
+to BerkeleyDB. The library is thread-aware and supports concurrent
+read/write access from multiple processes and threads. The DB
+structure is multi-versioned, and data pages use a copy-on-write
+strategy, which also provides resistance to corruption and eliminates
+the need for any recovery procedures. The database is exposed in a
+memory map, requiring no page cache layer of its own.
+
+This package contains the shared library.
+
+%package devel
+Summary:        Development package for lmdb
+Group:          Development/Libraries/C and C++
+Requires:       %lname = %version
+
+%description devel
+LMDB is a Btree-based database management library with an API similar
+to BerkeleyDB. The library is thread-aware and supports concurrent
+read/write access from multiple processes and threads. The DB
+structure is multi-versioned, and data pages use a copy-on-write
+strategy, which also provides resistance to corruption and eliminates
+the need for any recovery procedures. The database is exposed in a
+memory map, requiring no page cache layer of its own.
+This package contains the files needed to compile programs that use
+the liblmdb library.
+
+%prep
+%setup
+
+%build
+cd libraries/liblmdb
+make PREFIX=%{prefix} LIBDIR=%{libdir}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+cd libraries/liblmdb
+# make install DESTDIR="%buildroot"
+make install prefix=$RPM_BUILD_ROOT%{prefix} LIBDIR=$RPM_BUILD_ROOT%{libdir} install
+
+# Remove unnecessary files
+rm -f "%buildroot%{libdir}"/*.a
+
+cd %buildroot/%{libdir}
+mv liblmdb.so liblmdb-%version.so
+ln -s liblmdb-%version.so liblmdb.so
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post   -n %lname -p /sbin/ldconfig
+%postun -n %lname -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root)
+%{prefix}/bin/*
+%exclude %{libdir}/documentation.list
+%doc %{_mandir}/man1/*.1.gz
+
+%files -n %lname
+%defattr(-,root,root)
+%{libdir}/liblmdb-%version.so
+
+%files devel
+%defattr(-,root,root)
+%_includedir/*
+%{libdir}/liblmdb.so
+
+%changelog