diff options
author | Sangjung woo <sangjung.woo@samsung.com> | 2017-09-25 19:48:56 +0900 |
---|---|---|
committer | Sangjung woo <sangjung.woo@samsung.com> | 2017-09-25 19:48:56 +0900 |
commit | 01349b9f3e3937f7716ea384df8954bb1435f3d0 (patch) | |
tree | 5582a749873cd66e732b7e9eaf6abebc64360543 | |
parent | 3daab3be733b933a3fd2263441da4976206b27a2 (diff) | |
download | lmdb-01349b9f3e3937f7716ea384df8954bb1435f3d0.tar.gz lmdb-01349b9f3e3937f7716ea384df8954bb1435f3d0.tar.bz2 lmdb-01349b9f3e3937f7716ea384df8954bb1435f3d0.zip |
DIST: Add RPM spec file for packaging
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>
-rw-r--r-- | libraries/liblmdb/Makefile | 8 | ||||
-rw-r--r-- | packaging/lmdb.manifest | 5 | ||||
-rw-r--r-- | packaging/lmdb.spec | 103 |
3 files changed, 114 insertions, 2 deletions
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile index 72d0984..ded965a 100644 --- a/libraries/liblmdb/Makefile +++ b/libraries/liblmdb/Makefile @@ -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 index 0000000..2a0cec5 --- /dev/null +++ b/packaging/lmdb.manifest @@ -0,0 +1,5 @@ +<manifest> + <request> + <domain name="_"/> + </request> +</manifest> diff --git a/packaging/lmdb.spec b/packaging/lmdb.spec new file mode 100644 index 0000000..f3b897c --- /dev/null +++ b/packaging/lmdb.spec @@ -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 |