]>
Commit | Line | Data |
---|---|---|
d120039a | 1 | # TODO: hdfs/java |
b427c498 ER |
2 | # |
3 | # Conditional build: | |
4 | %bcond_with tests # build with tests | |
578f0abc | 5 | %bcond_with benchmark # enable Google Benchmark |
b427c498 | 6 | %bcond_without static_libs # don't build static libraries |
dd1b7ced | 7 | %bcond_without tbb # Threading Building Blocks support |
b427c498 | 8 | |
c4a98ad2 JB |
9 | Summary: RocksDB: A Persistent Key-Value Store for Flash and RAM Storage |
10 | Summary(pl.UTF-8): RocksDB - trwała baza danych klucz-wartość dla pamięci Flash i RAM | |
11 | Name: rocksdb | |
02b6e674 JB |
12 | # NOTE: stick to 7.8.x for now; ceph 17.2.5 is not ready for rocksdb 7.10.x (or even 7.9.x?) due to cache changes |
13 | Version: 7.8.3 | |
578f0abc | 14 | Release: 1 |
c4a98ad2 JB |
15 | License: BSD |
16 | Group: Libraries | |
d120039a | 17 | #Source0Download: https://github.com/facebook/rocksdb/releases |
dd1b7ced | 18 | Source0: https://github.com/facebook/rocksdb/archive/v%{version}/%{name}-%{version}.tar.gz |
02b6e674 | 19 | # Source0-md5: 745d3b15e57e31670b5ea607c5bb82ff |
578f0abc JB |
20 | Patch0: %{name}-detect-flags.patch |
21 | Patch1: %{name}-pc.patch | |
4eda5fd3 JB |
22 | URL: https://rocksdb.org/ |
23 | BuildRequires: bzip2-devel >= 1.0.8 | |
c4a98ad2 | 24 | BuildRequires: gflags-devel |
578f0abc | 25 | %{?with_benchmark:BuildRequires: google-benchmark-devel} |
d120039a JB |
26 | # libtcmalloc also supported, but jemalloc is preferred |
27 | BuildRequires: jemalloc-devel | |
1225ec57 JB |
28 | %ifarch i386 i486 |
29 | BuildRequires: libatomic-devel | |
30 | %endif | |
c4a98ad2 | 31 | BuildRequires: libstdc++-devel >= 6:4.7 |
578f0abc | 32 | BuildRequires: liburing-devel |
4eda5fd3 | 33 | BuildRequires: lz4-devel >= 1:1.9.2 |
d120039a | 34 | BuildRequires: numactl-devel |
dfb5c736 | 35 | BuildRequires: rpmbuild(macros) >= 1.734 |
4eda5fd3 | 36 | BuildRequires: snappy-devel >= 1.1.8 |
dd1b7ced JB |
37 | %{?with_tbb:BuildRequires: tbb-devel} |
38 | BuildRequires: zlib-devel >= 1.2.11 | |
4eda5fd3 JB |
39 | BuildRequires: zstd-devel >= 1.4.4 |
40 | Requires: bzip2 >= 1.0.8 | |
41 | Requires: lz4 >= 1:1.9.2 | |
42 | Requires: snappy >= 1.1.8 | |
43 | Requires: zlib >= 1.2.11 | |
44 | Requires: zstd >= 1.4.4 | |
c4a98ad2 JB |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
47 | %description | |
48 | RocksDB is a Persistent Key-Value Store for Flash and RAM Storage. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | RocksDB to trwała baza danych klucz-wartość dla pamięci Flash i RAM. | |
52 | ||
53 | %package devel | |
54 | Summary: Header files for RocksDB library | |
55 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki RocksDB | |
56 | Group: Development/Libraries | |
57 | Requires: %{name} = %{version}-%{release} | |
58 | Requires: libstdc++-devel >= 6:4.7 | |
59 | ||
60 | %description devel | |
61 | Header files for RocksDB library. | |
62 | ||
63 | %description devel -l pl.UTF-8 | |
64 | Pliki nagłówkowe biblioteki RocksDB. | |
65 | ||
66 | %package static | |
67 | Summary: Static RocksDB library | |
68 | Summary(pl.UTF-8): Statyczna biblioteka RocksDB | |
69 | Group: Development/Libraries | |
70 | Requires: %{name}-devel = %{version}-%{release} | |
71 | ||
72 | %description static | |
73 | Static RocksDB library. | |
74 | ||
75 | %description static -l pl.UTF-8 | |
76 | Statyczna biblioteka RocksDB. | |
77 | ||
78 | %prep | |
dd1b7ced | 79 | %setup -q |
c4a98ad2 | 80 | %patch0 -p1 |
b427c498 | 81 | %patch1 -p1 |
c4a98ad2 JB |
82 | |
83 | %build | |
578f0abc JB |
84 | %if %{without benchmark} |
85 | export ROCKSDB_DISABLE_BENCHMARK=1 | |
86 | %endif | |
87 | %if %{without tbb} | |
88 | export ROCKSDB_DISABLE_TBB=1 | |
89 | %endif | |
90 | ||
7e2f6267 | 91 | for target in %{?with_static_libs:static_lib} shared_lib tools_lib tools %{?with_tests:check} ; do |
1225ec57 JB |
92 | %ifarch i386 i486 |
93 | PLATFORM_LDFLAGS="-latomic" \ | |
94 | %endif | |
7e2f6267 | 95 | %{__make} $target \ |
83ab867a | 96 | AM_DEFAULT_VERBOSITY=1 \ |
c4a98ad2 JB |
97 | CC="%{__cc}" \ |
98 | CXX="%{__cxx}" \ | |
e76d675c | 99 | %{!?with_debug:DEBUG_LEVEL=0} \ |
4907cb5a | 100 | EXTRA_CFLAGS="$(pkg-config --cflags liblz4)" \ |
c4a98ad2 | 101 | OPT="%{rpmcflags} %{!?debug:-DNDEBUG}" \ |
d120039a | 102 | PORTABLE=1 \ |
e76d675c | 103 | USE_RTTI=1 \ |
c4a98ad2 | 104 | WARNING_FLAGS="%{rpmcppflags} -Wall" |
7e2f6267 | 105 | done |
c4a98ad2 JB |
106 | |
107 | %install | |
108 | rm -rf $RPM_BUILD_ROOT | |
d120039a | 109 | |
578f0abc JB |
110 | %if %{without benchmark} |
111 | export ROCKSDB_DISABLE_BENCHMARK=1 | |
112 | %endif | |
113 | %if %{without tbb} | |
114 | export ROCKSDB_DISABLE_TBB=1 | |
115 | %endif | |
116 | ||
c4a98ad2 | 117 | %{__make} install \ |
d120039a | 118 | %{!?with_debug:DEBUG_LEVEL=0} \ |
578f0abc JB |
119 | PORTABLE=1 \ |
120 | DESTDIR=$RPM_BUILD_ROOT \ | |
121 | PREFIX=%{_prefix} \ | |
122 | LIBDIR=%{_libdir} | |
b136638d JB |
123 | |
124 | # reduntant symlink | |
02b6e674 | 125 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/librocksdb.so.7 |
c4a98ad2 JB |
126 | |
127 | %clean | |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
130 | %post -p /sbin/ldconfig | |
131 | %postun -p /sbin/ldconfig | |
132 | ||
133 | %files | |
134 | %defattr(644,root,root,755) | |
dd1b7ced | 135 | %doc AUTHORS DEFAULT_OPTIONS_HISTORY.md DUMP_FORMAT.md HISTORY.md LANGUAGE-BINDINGS.md LICENSE.leveldb README.md ROCKSDB_LITE.md USERS.md |
b136638d | 136 | %attr(755,root,root) %{_libdir}/librocksdb.so.*.*.* |
02b6e674 | 137 | %attr(755,root,root) %ghost %{_libdir}/librocksdb.so.7.8 |
c4a98ad2 JB |
138 | |
139 | %files devel | |
140 | %defattr(644,root,root,755) | |
b136638d | 141 | %attr(755,root,root) %{_libdir}/librocksdb.so |
c4a98ad2 | 142 | %{_includedir}/rocksdb |
578f0abc | 143 | %{_pkgconfigdir}/rocksdb.pc |
c4a98ad2 | 144 | |
b427c498 | 145 | %if %{with static_libs} |
c4a98ad2 JB |
146 | %files static |
147 | %defattr(644,root,root,755) | |
148 | %{_libdir}/librocksdb.a | |
b427c498 | 149 | %endif |