3 %bcond_without lmdb # LMDB module (64-bit only)
4 %bcond_without python2 # CPython 2.x interface
6 %ifnarch %{x8664} aarch64 alpha mips64 ppc64 s390x sparc64
7 # lmdb support requires 64-bit size_t
10 %define talloc_version 2:2.1.16
11 %define tdb_version 2:1.3.18
12 %define tevent_version 0.9.39
13 Summary: LDAP-like embedded database
14 Summary(pl.UTF-8): Wbudowana baza danych podobna do LDAP
20 Source0: https://www.samba.org/ftp/ldb/%{name}-%{version}.tar.gz
21 # Source0-md5: fc58ef432c1fcb03fc3bb6cccce08977
22 URL: https://ldb.samba.org/
23 BuildRequires: cmocka-devel >= 1.1.3
24 BuildRequires: docbook-style-xsl
25 BuildRequires: libxslt-progs
26 %{?with_lmdb:BuildRequires: lmdb-devel >= 0.9.16}
27 BuildRequires: openldap-devel
28 BuildRequires: popt-devel >= 1.6
30 BuildRequires: python-devel >= 1:2.4.2
31 BuildRequires: python-talloc-devel >= %{talloc_version}
32 BuildRequires: python-tdb >= %{tdb_version}
33 BuildRequires: python-tevent >= %{tevent_version}
35 BuildRequires: python3-devel >= 1:3.2
36 BuildRequires: python3-talloc-devel >= %{talloc_version}
37 BuildRequires: python3-tdb >= %{tdb_version}
38 BuildRequires: python3-tevent >= %{tevent_version}
39 BuildRequires: rpmbuild(macros) >= 1.507
40 BuildRequires: talloc-devel >= %{talloc_version}
41 BuildRequires: tdb-devel >= %{tdb_version}
42 BuildRequires: tevent-devel >= %{tevent_version}
43 %{?with_lmdb:Requires: lmdb >= 0.9.16}
44 Requires: talloc >= %{talloc_version}
45 Requires: tdb >= %{tdb_version}
46 Requires: tevent >= %{tevent_version}
48 Provides: libldb = %{version}-%{release}
49 Obsoletes: libldb < 1.1.0-3
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 # %{_includedir}/pyldb.h shared between python*-ldb-devel
53 %define _duplicate_files_terminate_build 0
56 An extensible library that implements an LDAP like API to access
57 remote LDAP servers, or use local tdb databases.
59 %description -l pl.UTF-8
60 Rozszerzalna biblioteka implementująca API podobne do LDAP pozwalające
61 na dostęp do zdalnych serwerów LDAP lub wykorzystanie lokalnych baz
65 Summary: Tools to manage LDB files
66 Summary(pl.UTF-8): Narzędzia do zarządzania plikami LDB
67 Group: Applications/Databases
68 Requires: %{name} = %{version}-%{release}
71 Tools to manage LDB files.
73 %description tools -l pl.UTF-8
74 Narzędzia do zarządzania plikami LDB.
77 Summary: Header files for the LDB library
78 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki LDB
79 Group: Development/Libraries
80 Requires: %{name} = %{version}-%{release}
81 Requires: talloc-devel >= %{talloc_version}
82 Requires: tdb-devel >= %{tdb_version}
83 Requires: tevent-devel >= %{tevent_version}
84 Provides: libldb-devel = %{version}-%{release}
85 Obsoletes: libldb-devel < 1.1.0-3
88 Header files needed to develop programs that link against the LDB
91 %description devel -l pl.UTF-8
92 Pliki nagłówkowe potrzebne do tworzenia programów wykorzystujących
95 %package -n python-ldb
96 Summary: Python 2 bindings for the LDB library
97 Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki LDB
98 Group: Libraries/Python
99 Requires: %{name} = %{version}-%{release}
100 Requires: python-libs >= 1:2.4.2
101 Requires: python-tdb >= %{tdb_version}
104 %description -n python-ldb
105 Python 2 bindings for the LDB library.
107 %description -n python-ldb -l pl.UTF-8
108 Wiązania Pythona 2 do biblioteki LDB.
110 %package -n python-ldb-devel
111 Summary: Development files for the Python 2 bindings for the LDB library
112 Summary(pl.UTF-8): Pliki programistyczne wiązań Pythona 2 do biblioteki LDB
113 Group: Development/Libraries
114 Requires: python-ldb = %{version}-%{release}
116 %description -n python-ldb-devel
117 Development files for the Python 2 bindings for the LDB library.
119 %description -n python-ldb-devel -l pl.UTF-8
120 Pliki programistyczne wiązań Pythona 2 do biblioteki LDB.
122 %package -n python3-ldb
123 Summary: Python 3 bindings for the LDB library
124 Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki LDB
125 Group: Libraries/Python
126 Requires: %{name} = %{version}-%{release}
127 Requires: python3-tdb >= %{tdb_version}
130 %description -n python3-ldb
131 Python 3 bindings for the LDB library.
133 %description -n python3-ldb -l pl.UTF-8
134 Wiązania Pythona 3 do biblioteki LDB.
136 %package -n python3-ldb-devel
137 Summary: Development files for the Python 3 bindings for the LDB library
138 Summary(pl.UTF-8): Pliki programistyczne wiązań Pythona 3 do biblioteki LDB
139 Group: Development/Libraries
140 Requires: python3-ldb = %{version}-%{release}
142 %description -n python3-ldb-devel
143 Development files for the Python 3 bindings for the LDB library.
145 %description -n python3-ldb-devel -l pl.UTF-8
146 Pliki programistyczne wiązań Pythona 3 do biblioteki LDB.
153 CFLAGS="%{rpmcflags}" \
155 --prefix=%{_prefix} \
156 --libdir=%{_libdir} \
157 --with-modulesdir=%{_libdir}/ldb/modules \
158 --with-privatelibdir=%{_libdir}/ldb \
159 --bundled-libraries=NONE \
161 --disable-rpath-install \
162 %{?with_python2:--extra-python=%{__python}}
168 rm -rf $RPM_BUILD_ROOT
170 DESTDIR=$RPM_BUILD_ROOT
173 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
174 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
178 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
179 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
181 # Shared libraries need to be marked executable for
182 # rpmbuild to strip them and include them in debuginfo
183 find $RPM_BUILD_ROOT -name "*.so*" -exec chmod -c +x {} ';'
186 rm -rf $RPM_BUILD_ROOT
188 %post -p /sbin/ldconfig
189 %postun -p /sbin/ldconfig
191 %post -n python-ldb -p /sbin/ldconfig
192 %postun -n python-ldb -p /sbin/ldconfig
194 %post -n python3-ldb -p /sbin/ldconfig
195 %postun -n python3-ldb -p /sbin/ldconfig
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_libdir}/libldb.so.*.*.*
200 %attr(755,root,root) %ghost %{_libdir}/libldb.so.1
202 %attr(755,root,root) %{_libdir}/ldb/libldb-key-value.so
203 %attr(755,root,root) %{_libdir}/ldb/libldb-tdb-err-map.so
204 %attr(755,root,root) %{_libdir}/ldb/libldb-tdb-int.so
205 %{?with_lmdb:%attr(755,root,root) %{_libdir}/ldb/libldb-mdb-int.so}
206 %dir %{_libdir}/ldb/modules
207 %dir %{_libdir}/ldb/modules/ldb
208 %attr(755,root,root) %{_libdir}/ldb/modules/ldb/*.so
211 %defattr(644,root,root,755)
212 %attr(755,root,root) %{_bindir}/ldbadd
213 %attr(755,root,root) %{_bindir}/ldbdel
214 %attr(755,root,root) %{_bindir}/ldbedit
215 %attr(755,root,root) %{_bindir}/ldbmodify
216 %attr(755,root,root) %{_bindir}/ldbrename
217 %attr(755,root,root) %{_bindir}/ldbsearch
218 %attr(755,root,root) %{_libdir}/ldb/libldb-cmdline.so
219 %{_mandir}/man1/ldbadd.1*
220 %{_mandir}/man1/ldbdel.1*
221 %{_mandir}/man1/ldbedit.1*
222 %{_mandir}/man1/ldbmodify.1*
223 %{_mandir}/man1/ldbrename.1*
224 %{_mandir}/man1/ldbsearch.1*
227 %defattr(644,root,root,755)
228 %attr(755,root,root) %{_libdir}/libldb.so
229 %{_includedir}/ldb_module.h
230 %{_includedir}/ldb_handlers.h
231 %{_includedir}/ldb_errors.h
232 %{_includedir}/ldb_version.h
234 %{_pkgconfigdir}/ldb.pc
235 %{_mandir}/man3/ldb.3*
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_libdir}/libpyldb-util.so.*.*.*
241 %attr(755,root,root) %ghost %{_libdir}/libpyldb-util.so.1
242 %attr(755,root,root) %{py_sitedir}/ldb.so
243 %{py_sitedir}/_ldb_text.py[co]
245 %files -n python-ldb-devel
246 %defattr(644,root,root,755)
247 %attr(755,root,root) %{_libdir}/libpyldb-util.so
248 %{_includedir}/pyldb.h
249 %{_pkgconfigdir}/pyldb-util.pc
252 %files -n python3-ldb
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_libdir}/libpyldb-util.cpython-3*.so.*.*.*
255 %attr(755,root,root) %ghost %{_libdir}/libpyldb-util.cpython-3*.so.1
256 %attr(755,root,root) %{py3_sitedir}/ldb.cpython-*.so
257 %{py3_sitedir}/_ldb_text.py
258 %{py3_sitedir}/__pycache__/_ldb_text.cpython-*.py[co]
260 %files -n python3-ldb-devel
261 %defattr(644,root,root,755)
262 %attr(755,root,root) %{_libdir}/libpyldb-util.cpython-3*.so
263 %{_includedir}/pyldb.h
264 %{_pkgconfigdir}/pyldb-util.cpython-3*.pc