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: 1b43ad8d22b40c95441c0a6370141599
18 Patch0: %{name}-rpm5.patch
19 URL: https://github.com/rpm-software-management/libdnf
20 BuildRequires: check-devel
21 BuildRequires: cmake >= 2.4
22 BuildRequires: cppunit-devel
23 BuildRequires: gettext
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}
32 BuildRequires: libsmartcols-devel
33 BuildRequires: libsolv-devel >= 0.7.17
34 BuildRequires: openssl-devel
35 BuildRequires: pkgconfig
36 BuildRequires: rpm-devel
37 BuildRequires: rpm-pythonprov
38 BuildRequires: rpmbuild(macros) >= 1.714
39 BuildRequires: sphinx-pdg
40 BuildRequires: sqlite3-devel
41 BuildRequires: valgrind
42 BuildRequires: zchunk-devel >= 0.9.11
43 Requires: glib2 >= 1:2.46.0
44 Requires: libsolv >= 0.7.17
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 # PyErr_Format(HyExc_Exception, e.what());
48 %define filterout -Wformat -Werror=format-security
50 # hawkey(3) man page shared between python-hawkey and python3-hawkey
51 %define _duplicate_files_terminate_build 0
54 Library providing simplified C and Python API to libsolv.
56 %description -l pl.UTF-8
57 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
60 Summary: Header files for libdnf library
61 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libdnf
62 Group: Development/Libraries
63 Requires: %{name} = %{version}-%{release}
64 Requires: glib2-devel >= 1:2.46.0
65 Requires: librepo-devel
66 Requires: libsolv-devel >= 0.7.17
70 Header files for libdnf library.
72 %description devel -l pl.UTF-8
73 Pliki nagłówkowe biblioteki libdnf.
76 Summary: API documentation for libdnf library
77 Summary(pl.UTF-8): Dokumentacja API biblioteki libdnf
82 API documentation for libdnf library.
84 %description apidocs -l pl.UTF-8
85 Dokumentacja API biblioteki libdnf.
87 %package -n python-hawkey
88 Summary: Python 2.x bindings for hawkey library
89 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki hawkey
90 Group: Libraries/Python
91 Requires: %{name} = %{version}-%{release}
93 %description -n python-hawkey
94 Python 2.x bindings for hawkey library.
96 %description -n python-hawkey -l pl.UTF-8
97 Wiązania Pythona 2.x do biblioteki hawkey.
99 %package -n python-hawkey-test
100 Summary: Test module for hawkey library
101 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
102 Group: Development/Libraries
103 Requires: python-hawkey = %{version}-%{release}
105 %description -n python-hawkey-test
106 Test module for hawkey library.
108 %description -n python-hawkey-test -l pl.UTF-8
109 Moduł testowy dla biblioteki hawkey.
111 %package -n python3-hawkey
112 Summary: Python 3.x bindings for hawkey library
113 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki hawkey
114 Group: Libraries/Python
115 Requires: %{name} = %{version}-%{release}
117 %description -n python3-hawkey
118 Python 3.x bindings for hawkey library.
120 %description -n python3-hawkey -l pl.UTF-8
121 Wiązania Pythona 3.x do biblioteki hawkey.
123 %package -n python3-hawkey-test
124 Summary: Test module for hawkey library
125 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
126 Group: Development/Libraries
127 Requires: python3-hawkey = %{version}-%{release}
129 %description -n python3-hawkey-test
130 Test module for hawkey library.
132 %description -n python3-hawkey-test -l pl.UTF-8
133 Moduł testowy dla biblioteki hawkey.
135 %package -n python-hawkey-apidocs
136 Summary: API documentation for Python hawkey module
137 Summary(pl.UTF-8): Dokumentacja API modułu Pythona hawkey
139 Obsoletes: hawkey-apidocs < 0.6.4-2
142 %description -n python-hawkey-apidocs
143 API documentation for Python hawkey module.
145 %description -n python-hawkey-apidocs -l pl.UTF-8
146 Dokumentacja API modułu Pythona hawkey.
148 %package -n python-libdnf
149 Summary: Python 2.x bindings for libdnf library
150 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libdnf
151 Group: Libraries/Python
152 Requires: %{name} = %{version}-%{release}
154 %description -n python-libdnf
155 Python 2.x bindings for hawkey libdnf.
157 %description -n python-libdnf -l pl.UTF-8
158 Wiązania Pythona 2.x do biblioteki libdnf.
160 %package -n python3-libdnf
161 Summary: Python 3.x bindings for libdnf library
162 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libdnf
163 Group: Libraries/Python
164 Requires: %{name} = %{version}-%{release}
166 %description -n python3-libdnf
167 Python 3.x bindings for hawkey library.
169 %description -n python3-libdnf -l pl.UTF-8
170 Wiązania Pythona 3.x do biblioteki libdnf.
174 %{?with_rpm5:%patch0 -p1}
177 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
178 install -d build %{?with_python3:build-py3}
181 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
190 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
197 rm -rf $RPM_BUILD_ROOT
200 %{__make} -C build-py3 install \
201 DESTDIR=$RPM_BUILD_ROOT
203 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
204 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
210 %{__make} -C build install \
211 DESTDIR=$RPM_BUILD_ROOT
213 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
214 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
216 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
217 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
220 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
221 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
226 rm -rf $RPM_BUILD_ROOT
228 %post -p /sbin/ldconfig
229 %postun -p /sbin/ldconfig
231 %files -f %{name}.lang
232 %defattr(644,root,root,755)
233 %doc AUTHORS README.md docs/release_notes.rst
234 %attr(755,root,root) %{_libdir}/libdnf.so.2
235 %dir %{_libdir}/libdnf
236 %dir %{_libdir}/libdnf/plugins
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_libdir}/libdnf.so
241 %{_includedir}/libdnf
242 %{_pkgconfigdir}/libdnf.pc
246 %defattr(644,root,root,755)
250 %files -n python-hawkey
251 %defattr(644,root,root,755)
252 %dir %{py_sitedir}/hawkey
253 %attr(755,root,root) %{py_sitedir}/hawkey/_hawkeymodule.so
254 %{py_sitedir}/hawkey/__init__.py[co]
255 %{_mandir}/man3/hawkey.3*
257 %files -n python-hawkey-test
258 %defattr(644,root,root,755)
259 %dir %{py_sitedir}/hawkey/test
260 %{py_sitedir}/hawkey/test/*.py[co]
261 %attr(755,root,root) %{py_sitedir}/hawkey/test/_hawkey_testmodule.so
264 %files -n python3-hawkey
265 %defattr(644,root,root,755)
266 %dir %{py3_sitedir}/hawkey
267 %attr(755,root,root) %{py3_sitedir}/hawkey/_hawkey.so
268 %{py3_sitedir}/hawkey/*.py
269 %{py3_sitedir}/hawkey/__pycache__
270 %{_mandir}/man3/hawkey.3*
272 %files -n python3-hawkey-test
273 %defattr(644,root,root,755)
274 %dir %{py3_sitedir}/hawkey/test
275 %{py3_sitedir}/hawkey/test/*.py
276 %{py3_sitedir}/hawkey/test/__pycache__
277 %attr(755,root,root) %{py3_sitedir}/hawkey/test/_hawkey_test.so
280 %files -n python-hawkey-apidocs
281 %defattr(644,root,root,755)
282 %doc build/docs/hawkey/html/{_static,*.html,*.js}
284 %files -n python-libdnf
285 %defattr(644,root,root,755)
286 %dir %{py_sitedir}/libdnf
287 %{py_sitedir}/libdnf/*.py[co]
288 %attr(755,root,root) %{py_sitedir}/libdnf/*.so
290 %files -n python3-libdnf
291 %defattr(644,root,root,755)
292 %dir %{py3_sitedir}/libdnf
293 %{py3_sitedir}/libdnf/*.py
294 %{py3_sitedir}/libdnf/__pycache__
295 %attr(755,root,root) %{py3_sitedir}/libdnf/*.so