3 %bcond_without apidocs # do not build and package API docs
4 %bcond_without python3 # CPython 3.x module
5 %bcond_with rhsm # Red Had Subscription Management support
6 %bcond_with rpm5 # build with rpm5
8 Summary: Library providing simplified C and Python API to libsolv
9 Summary(pl.UTF-8): Biblioteka zapewniająca uproszczone API C i Pythona do libsolv
15 #Source0Download: https://github.com/rpm-software-management/libdnf/releases
16 Source0: https://github.com/rpm-software-management/libdnf/archive/%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5: 85c11f8e69c68b62a605300602137663
18 Patch0: %{name}-rpm5.patch
19 URL: https://github.com/rpm-software-management/libdnf
20 BuildRequires: check-devel
21 BuildRequires: cmake >= 2.8.5
22 BuildRequires: cppunit-devel
23 BuildRequires: gettext-tools
24 BuildRequires: glib2-devel >= 1:2.46.0
25 BuildRequires: gobject-introspection-devel
26 BuildRequires: gpgme-devel
27 BuildRequires: gtk-doc
28 BuildRequires: json-c-devel
29 BuildRequires: libmodulemd-devel >= 2.12.0
30 BuildRequires: librepo-devel >= 1.13.0
31 %{?with_rhsm:BuildRequires: librhsm-devel >= 0.0.3}
32 BuildRequires: libsmartcols-devel
33 BuildRequires: libsolv-devel >= 0.7.17
34 BuildRequires: openssl-devel
35 BuildRequires: pkgconfig
36 BuildRequires: rpm-build >= 4.6
37 %{!?with_rpm5:BuildRequires: rpm-devel >= 1:4.11.0}
38 %{?with_rpm5:BuildRequires: rpm-devel >= 5}
39 BuildRequires: rpm-pythonprov
40 BuildRequires: rpmbuild(macros) >= 1.714
41 BuildRequires: sphinx-pdg
42 BuildRequires: sqlite3-devel >= 3
43 BuildRequires: valgrind
44 BuildRequires: zchunk-devel >= 0.9.11
45 Requires: glib2 >= 1:2.46.0
46 Requires: libsolv >= 0.7.17
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 # PyErr_Format(HyExc_Exception, e.what());
50 %define filterout -Wformat -Werror=format-security
52 # hawkey(3) man page shared between python-hawkey and python3-hawkey
53 %define _duplicate_files_terminate_build 0
56 Library providing simplified C and Python API to libsolv.
58 %description -l pl.UTF-8
59 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
62 Summary: Header files for libdnf library
63 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libdnf
64 Group: Development/Libraries
65 Requires: %{name} = %{version}-%{release}
66 Requires: glib2-devel >= 1:2.46.0
67 Requires: librepo-devel >= 1.13.0
68 Requires: libsolv-devel >= 0.7.17
69 %{!?with_rpm5:Requires: rpm-devel >= 1:4.11.0}
70 %{?with_rpm5:Requires: rpm-devel >= 5}
73 Header files for libdnf library.
75 %description devel -l pl.UTF-8
76 Pliki nagłówkowe biblioteki libdnf.
79 Summary: API documentation for libdnf library
80 Summary(pl.UTF-8): Dokumentacja API biblioteki libdnf
85 API documentation for libdnf library.
87 %description apidocs -l pl.UTF-8
88 Dokumentacja API biblioteki libdnf.
90 %package -n python-hawkey
91 Summary: Python 2.x bindings for hawkey library
92 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki hawkey
93 Group: Libraries/Python
94 Requires: %{name} = %{version}-%{release}
96 %description -n python-hawkey
97 Python 2.x bindings for hawkey library.
99 %description -n python-hawkey -l pl.UTF-8
100 Wiązania Pythona 2.x do biblioteki hawkey.
102 %package -n python-hawkey-test
103 Summary: Test module for hawkey library
104 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
105 Group: Development/Libraries
106 Requires: python-hawkey = %{version}-%{release}
108 %description -n python-hawkey-test
109 Test module for hawkey library.
111 %description -n python-hawkey-test -l pl.UTF-8
112 Moduł testowy dla biblioteki hawkey.
114 %package -n python3-hawkey
115 Summary: Python 3.x bindings for hawkey library
116 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki hawkey
117 Group: Libraries/Python
118 Requires: %{name} = %{version}-%{release}
120 %description -n python3-hawkey
121 Python 3.x bindings for hawkey library.
123 %description -n python3-hawkey -l pl.UTF-8
124 Wiązania Pythona 3.x do biblioteki hawkey.
126 %package -n python3-hawkey-test
127 Summary: Test module for hawkey library
128 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
129 Group: Development/Libraries
130 Requires: python3-hawkey = %{version}-%{release}
132 %description -n python3-hawkey-test
133 Test module for hawkey library.
135 %description -n python3-hawkey-test -l pl.UTF-8
136 Moduł testowy dla biblioteki hawkey.
138 %package -n python-hawkey-apidocs
139 Summary: API documentation for Python hawkey module
140 Summary(pl.UTF-8): Dokumentacja API modułu Pythona hawkey
142 Obsoletes: hawkey-apidocs < 0.6.4-2
145 %description -n python-hawkey-apidocs
146 API documentation for Python hawkey module.
148 %description -n python-hawkey-apidocs -l pl.UTF-8
149 Dokumentacja API modułu Pythona hawkey.
151 %package -n python-libdnf
152 Summary: Python 2.x bindings for libdnf library
153 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libdnf
154 Group: Libraries/Python
155 Requires: %{name} = %{version}-%{release}
157 %description -n python-libdnf
158 Python 2.x bindings for hawkey libdnf.
160 %description -n python-libdnf -l pl.UTF-8
161 Wiązania Pythona 2.x do biblioteki libdnf.
163 %package -n python3-libdnf
164 Summary: Python 3.x bindings for libdnf library
165 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libdnf
166 Group: Libraries/Python
167 Requires: %{name} = %{version}-%{release}
169 %description -n python3-libdnf
170 Python 3.x bindings for hawkey library.
172 %description -n python3-libdnf -l pl.UTF-8
173 Wiązania Pythona 3.x do biblioteki libdnf.
177 %{?with_rpm5:%patch0 -p1}
180 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
181 install -d build %{?with_python3:build-py3}
184 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
193 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
200 rm -rf $RPM_BUILD_ROOT
203 %{__make} -C build-py3 install \
204 DESTDIR=$RPM_BUILD_ROOT
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
209 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
210 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
213 %{__make} -C build install \
214 DESTDIR=$RPM_BUILD_ROOT
216 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
217 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
219 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
220 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
223 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
224 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
229 rm -rf $RPM_BUILD_ROOT
231 %post -p /sbin/ldconfig
232 %postun -p /sbin/ldconfig
234 %files -f %{name}.lang
235 %defattr(644,root,root,755)
236 %doc AUTHORS README.md docs/release_notes.rst
237 %attr(755,root,root) %{_libdir}/libdnf.so.2
238 %dir %{_libdir}/libdnf
239 %dir %{_libdir}/libdnf/plugins
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_libdir}/libdnf.so
244 %{_includedir}/libdnf
245 %{_pkgconfigdir}/libdnf.pc
249 %defattr(644,root,root,755)
253 %files -n python-hawkey
254 %defattr(644,root,root,755)
255 %dir %{py_sitedir}/hawkey
256 %attr(755,root,root) %{py_sitedir}/hawkey/_hawkeymodule.so
257 %{py_sitedir}/hawkey/__init__.py[co]
258 %{_mandir}/man3/hawkey.3*
260 %files -n python-hawkey-test
261 %defattr(644,root,root,755)
262 %dir %{py_sitedir}/hawkey/test
263 %{py_sitedir}/hawkey/test/*.py[co]
264 %attr(755,root,root) %{py_sitedir}/hawkey/test/_hawkey_testmodule.so
267 %files -n python3-hawkey
268 %defattr(644,root,root,755)
269 %dir %{py3_sitedir}/hawkey
270 %attr(755,root,root) %{py3_sitedir}/hawkey/_hawkey.so
271 %{py3_sitedir}/hawkey/*.py
272 %{py3_sitedir}/hawkey/__pycache__
273 %{_mandir}/man3/hawkey.3*
275 %files -n python3-hawkey-test
276 %defattr(644,root,root,755)
277 %dir %{py3_sitedir}/hawkey/test
278 %{py3_sitedir}/hawkey/test/*.py
279 %{py3_sitedir}/hawkey/test/__pycache__
280 %attr(755,root,root) %{py3_sitedir}/hawkey/test/_hawkey_test.so
283 %files -n python-hawkey-apidocs
284 %defattr(644,root,root,755)
285 %doc build/docs/hawkey/html/{_static,*.html,*.js}
287 %files -n python-libdnf
288 %defattr(644,root,root,755)
289 %dir %{py_sitedir}/libdnf
290 %{py_sitedir}/libdnf/*.py[co]
291 %attr(755,root,root) %{py_sitedir}/libdnf/*.so
293 %files -n python3-libdnf
294 %defattr(644,root,root,755)
295 %dir %{py3_sitedir}/libdnf
296 %{py3_sitedir}/libdnf/*.py
297 %{py3_sitedir}/libdnf/__pycache__
298 %attr(755,root,root) %{py3_sitedir}/libdnf/*.so