f3b897ca5fbdd75665c64d8b4878bc1971fdd7b6
[platform/upstream/lmdb.git] / packaging / lmdb.spec
1 %define lname   liblmdb-0_9_17
2 %define prefix  %{_prefix}
3 %define libdir  %{_libdir}
4
5 Name:           lmdb
6 Summary:        Lightning Memory-Mapped Database Manager
7 License:        OLDAP-2.8
8 Group:          Productivity/Databases/Tools
9 Version:        0.9.17
10 Release:        0
11 Url:            http://symas.com/mdb/
12
13 Source:         https://github.com/LMDB/lmdb/archive/LMDB_%version.tar.gz
14 # Source99:       baselibs.conf
15
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
17 # BuildRequires:  autoconf
18 BuildRequires:  automake >= 1.10
19 BuildRequires:  libtool >= 2
20
21 %description
22 LMDB is a Btree-based database management library with an API similar
23 to BerkeleyDB. The library is thread-aware and supports concurrent
24 read/write access from multiple processes and threads. The DB
25 structure is multi-versioned, and data pages use a copy-on-write
26 strategy, which also provides resistance to corruption and eliminates
27 the need for any recovery procedures. The database is exposed in a
28 memory map, requiring no page cache layer of its own.
29
30 %package -n %lname
31 Summary:        Shared library for Lightning Memory-Mapped Database (LMDB)
32 Group:          System/Libraries
33
34 %description -n %lname
35 LMDB is a Btree-based database management library with an API similar
36 to BerkeleyDB. The library is thread-aware and supports concurrent
37 read/write access from multiple processes and threads. The DB
38 structure is multi-versioned, and data pages use a copy-on-write
39 strategy, which also provides resistance to corruption and eliminates
40 the need for any recovery procedures. The database is exposed in a
41 memory map, requiring no page cache layer of its own.
42
43 This package contains the shared library.
44
45 %package devel
46 Summary:        Development package for lmdb
47 Group:          Development/Libraries/C and C++
48 Requires:       %lname = %version
49
50 %description devel
51 LMDB is a Btree-based database management library with an API similar
52 to BerkeleyDB. The library is thread-aware and supports concurrent
53 read/write access from multiple processes and threads. The DB
54 structure is multi-versioned, and data pages use a copy-on-write
55 strategy, which also provides resistance to corruption and eliminates
56 the need for any recovery procedures. The database is exposed in a
57 memory map, requiring no page cache layer of its own.
58  
59 This package contains the files needed to compile programs that use
60 the liblmdb library.
61
62 %prep
63 %setup
64
65 %build
66 cd libraries/liblmdb
67 make PREFIX=%{prefix} LIBDIR=%{libdir}
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 cd libraries/liblmdb
72 # make install DESTDIR="%buildroot"
73 make install prefix=$RPM_BUILD_ROOT%{prefix} LIBDIR=$RPM_BUILD_ROOT%{libdir} install
74
75 # Remove unnecessary files
76 rm -f "%buildroot%{libdir}"/*.a
77
78 cd %buildroot/%{libdir}
79 mv liblmdb.so liblmdb-%version.so
80 ln -s liblmdb-%version.so liblmdb.so
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %post   -n %lname -p /sbin/ldconfig
86 %postun -n %lname -p /sbin/ldconfig
87
88 %files
89 %defattr(-,root,root)
90 %{prefix}/bin/*
91 %exclude %{libdir}/documentation.list
92 %doc %{_mandir}/man1/*.1.gz
93
94 %files -n %lname
95 %defattr(-,root,root)
96 %{libdir}/liblmdb-%version.so
97
98 %files devel
99 %defattr(-,root,root)
100 %_includedir/*
101 %{libdir}/liblmdb.so
102
103 %changelog