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: e1abd04a23ca2fb35f0edda3a2e5556a
18 Patch0: %{name}-gpgme-pkgconfig.patch
19 Patch1: %{name}-rpm5.patch
20 URL: https://github.com/rpm-software-management/libdnf
21 BuildRequires: check-devel
22 BuildRequires: cmake >= 2.8.5
23 BuildRequires: cppunit-devel
24 BuildRequires: gettext-tools
25 BuildRequires: glib2-devel >= 1:2.46.0
26 BuildRequires: gobject-introspection-devel
27 BuildRequires: gpgme-devel
28 BuildRequires: gtk-doc
29 BuildRequires: json-c-devel
30 BuildRequires: libmodulemd-devel >= 2.12.0
31 BuildRequires: librepo-devel >= 1.13.0
32 %{?with_rhsm:BuildRequires: librhsm-devel >= 0.0.3}
33 BuildRequires: libsmartcols-devel
34 BuildRequires: libsolv-devel >= 0.7.17
35 BuildRequires: openssl-devel
36 BuildRequires: pkgconfig
37 BuildRequires: rpm-build >= 4.6
38 %{!?with_rpm5:BuildRequires: rpm-devel >= 1:4.15.0}
39 %{?with_rpm5:BuildRequires: rpm-devel >= 5}
40 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.714
42 BuildRequires: sphinx-pdg
43 BuildRequires: sqlite3-devel >= 3
45 BuildRequires: swig-python
46 BuildRequires: valgrind
47 BuildRequires: zchunk-devel >= 0.9.11
48 Requires: glib2 >= 1:2.46.0
49 Requires: libsolv >= 0.7.17
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 # PyErr_Format(HyExc_Exception, e.what());
53 %define filterout -Wformat -Werror=format-security
55 # hawkey(3) man page shared between python-hawkey and python3-hawkey
56 %define _duplicate_files_terminate_build 0
59 Library providing simplified C and Python API to libsolv.
61 %description -l pl.UTF-8
62 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
65 Summary: Header files for libdnf library
66 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libdnf
67 Group: Development/Libraries
68 Requires: %{name} = %{version}-%{release}
69 Requires: glib2-devel >= 1:2.46.0
70 Requires: librepo-devel >= 1.13.0
71 Requires: libsolv-devel >= 0.7.17
72 %{!?with_rpm5:Requires: rpm-devel >= 1:4.15.0}
73 %{?with_rpm5:Requires: rpm-devel >= 5}
76 Header files for libdnf library.
78 %description devel -l pl.UTF-8
79 Pliki nagłówkowe biblioteki libdnf.
82 Summary: API documentation for libdnf library
83 Summary(pl.UTF-8): Dokumentacja API biblioteki libdnf
88 API documentation for libdnf library.
90 %description apidocs -l pl.UTF-8
91 Dokumentacja API biblioteki libdnf.
93 %package -n python-hawkey
94 Summary: Python 2.x bindings for hawkey library
95 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki hawkey
96 Group: Libraries/Python
97 Requires: %{name} = %{version}-%{release}
99 %description -n python-hawkey
100 Python 2.x bindings for hawkey library.
102 %description -n python-hawkey -l pl.UTF-8
103 Wiązania Pythona 2.x do biblioteki hawkey.
105 %package -n python-hawkey-test
106 Summary: Test module for hawkey library
107 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
108 Group: Development/Libraries
109 Requires: python-hawkey = %{version}-%{release}
111 %description -n python-hawkey-test
112 Test module for hawkey library.
114 %description -n python-hawkey-test -l pl.UTF-8
115 Moduł testowy dla biblioteki hawkey.
117 %package -n python3-hawkey
118 Summary: Python 3.x bindings for hawkey library
119 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki hawkey
120 Group: Libraries/Python
121 Requires: %{name} = %{version}-%{release}
123 %description -n python3-hawkey
124 Python 3.x bindings for hawkey library.
126 %description -n python3-hawkey -l pl.UTF-8
127 Wiązania Pythona 3.x do biblioteki hawkey.
129 %package -n python3-hawkey-test
130 Summary: Test module for hawkey library
131 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
132 Group: Development/Libraries
133 Requires: python3-hawkey = %{version}-%{release}
135 %description -n python3-hawkey-test
136 Test module for hawkey library.
138 %description -n python3-hawkey-test -l pl.UTF-8
139 Moduł testowy dla biblioteki hawkey.
141 %package -n python-hawkey-apidocs
142 Summary: API documentation for Python hawkey module
143 Summary(pl.UTF-8): Dokumentacja API modułu Pythona hawkey
145 Obsoletes: hawkey-apidocs < 0.6.4-2
148 %description -n python-hawkey-apidocs
149 API documentation for Python hawkey module.
151 %description -n python-hawkey-apidocs -l pl.UTF-8
152 Dokumentacja API modułu Pythona hawkey.
154 %package -n python-libdnf
155 Summary: Python 2.x bindings for libdnf library
156 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki libdnf
157 Group: Libraries/Python
158 Requires: %{name} = %{version}-%{release}
160 %description -n python-libdnf
161 Python 2.x bindings for hawkey libdnf.
163 %description -n python-libdnf -l pl.UTF-8
164 Wiązania Pythona 2.x do biblioteki libdnf.
166 %package -n python3-libdnf
167 Summary: Python 3.x bindings for libdnf library
168 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki libdnf
169 Group: Libraries/Python
170 Requires: %{name} = %{version}-%{release}
172 %description -n python3-libdnf
173 Python 3.x bindings for hawkey library.
175 %description -n python3-libdnf -l pl.UTF-8
176 Wiązania Pythona 3.x do biblioteki libdnf.
181 %{?with_rpm5:%patch1 -p1}
184 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
185 install -d build %{?with_python3:build-py3}
188 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
197 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
204 rm -rf $RPM_BUILD_ROOT
207 %{__make} -C build-py3 install \
208 DESTDIR=$RPM_BUILD_ROOT
210 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
211 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
213 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
214 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
217 %{__make} -C build install \
218 DESTDIR=$RPM_BUILD_ROOT
220 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
221 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
223 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
224 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
227 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
228 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
233 rm -rf $RPM_BUILD_ROOT
235 %post -p /sbin/ldconfig
236 %postun -p /sbin/ldconfig
238 %files -f %{name}.lang
239 %defattr(644,root,root,755)
240 %doc AUTHORS README.md docs/release_notes.rst
241 %attr(755,root,root) %{_libdir}/libdnf.so.2
242 %dir %{_libdir}/libdnf
243 %dir %{_libdir}/libdnf/plugins
246 %defattr(644,root,root,755)
247 %attr(755,root,root) %{_libdir}/libdnf.so
248 %{_includedir}/libdnf
249 %{_pkgconfigdir}/libdnf.pc
253 %defattr(644,root,root,755)
257 %files -n python-hawkey
258 %defattr(644,root,root,755)
259 %dir %{py_sitedir}/hawkey
260 %attr(755,root,root) %{py_sitedir}/hawkey/_hawkeymodule.so
261 %{py_sitedir}/hawkey/__init__.py[co]
262 %{_mandir}/man3/hawkey.3*
264 %files -n python-hawkey-test
265 %defattr(644,root,root,755)
266 %dir %{py_sitedir}/hawkey/test
267 %{py_sitedir}/hawkey/test/*.py[co]
268 %attr(755,root,root) %{py_sitedir}/hawkey/test/_hawkey_testmodule.so
271 %files -n python3-hawkey
272 %defattr(644,root,root,755)
273 %dir %{py3_sitedir}/hawkey
274 %attr(755,root,root) %{py3_sitedir}/hawkey/_hawkey.so
275 %{py3_sitedir}/hawkey/*.py
276 %{py3_sitedir}/hawkey/__pycache__
277 %{_mandir}/man3/hawkey.3*
279 %files -n python3-hawkey-test
280 %defattr(644,root,root,755)
281 %dir %{py3_sitedir}/hawkey/test
282 %{py3_sitedir}/hawkey/test/*.py
283 %{py3_sitedir}/hawkey/test/__pycache__
284 %attr(755,root,root) %{py3_sitedir}/hawkey/test/_hawkey_test.so
287 %files -n python-hawkey-apidocs
288 %defattr(644,root,root,755)
289 %doc build/docs/hawkey/html/{_static,*.html,*.js}
291 %files -n python-libdnf
292 %defattr(644,root,root,755)
293 %dir %{py_sitedir}/libdnf
294 %{py_sitedir}/libdnf/*.py[co]
295 %attr(755,root,root) %{py_sitedir}/libdnf/*.so
297 %files -n python3-libdnf
298 %defattr(644,root,root,755)
299 %dir %{py3_sitedir}/libdnf
300 %{py3_sitedir}/libdnf/*.py
301 %{py3_sitedir}/libdnf/__pycache__
302 %attr(755,root,root) %{py3_sitedir}/libdnf/*.so