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: d62c97d5534394c365fe77978ce9cdd5
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: glib2-devel >= 1:2.46.0
23 BuildRequires: gobject-introspection-devel
24 BuildRequires: gtk-doc
25 BuildRequires: librepo-devel
26 %{?with_rhsm:BuildRequires: librhsm-devel}
27 BuildRequires: libsolv-devel >= 0.6.21
28 BuildRequires: pkgconfig
29 BuildRequires: rpm-devel
30 BuildRequires: rpm-pythonprov
31 BuildRequires: rpmbuild(macros) >= 1.714
32 BuildRequires: sphinx-pdg
33 BuildRequires: valgrind
34 Requires: glib2 >= 1:2.46.0
35 Requires: libsolv >= 0.6.21
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 # hawkey(3) man page shared between python-hawkey and python3-hawkey
39 %define _duplicate_files_terminate_build 0
42 Library providing simplified C and Python API to libsolv.
44 %description -l pl.UTF-8
45 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
48 Summary: Header files for libdnf library
49 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libdnf
50 Group: Development/Libraries
51 Requires: %{name} = %{version}-%{release}
52 Requires: glib2-devel >= 1:2.46.0
53 Requires: librepo-devel
54 Requires: libsolv-devel >= 0.6.21
55 Requires: rpm-devel >= 5
58 Header files for libdnf library.
60 %description devel -l pl.UTF-8
61 Pliki nagłówkowe biblioteki libdnf.
64 Summary: API documentation for libdnf library
65 Summary(pl.UTF-8): Dokumentacja API biblioteki libdnf
70 API documentation for libdnf library.
72 %description apidocs -l pl.UTF-8
73 Dokumentacja API biblioteki libdnf.
75 %package -n python-hawkey
76 Summary: Python 2.x bindings for hawkey library
77 Summary(pl.UTF-8): Wiązania Pythona 2.x do biblioteki hawkey
78 Group: Libraries/Python
79 Requires: %{name} = %{version}-%{release}
81 %description -n python-hawkey
82 Python 2.x bindings for hawkey library.
84 %description -n python-hawkey -l pl.UTF-8
85 Wiązania Pythona 2.x do biblioteki hawkey.
87 %package -n python-hawkey-test
88 Summary: Test module for hawkey library
89 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
90 Group: Development/Libraries
91 Requires: python-hawkey = %{version}-%{release}
93 %description -n python-hawkey-test
94 Test module for hawkey library.
96 %description -n python-hawkey-test -l pl.UTF-8
97 Moduł testowy dla biblioteki hawkey.
99 %package -n python3-hawkey
100 Summary: Python 3.x bindings for hawkey library
101 Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki hawkey
102 Group: Libraries/Python
103 Requires: %{name} = %{version}-%{release}
105 %description -n python3-hawkey
106 Python 3.x bindings for hawkey library.
108 %description -n python3-hawkey -l pl.UTF-8
109 Wiązania Pythona 3.x do biblioteki hawkey.
111 %package -n python3-hawkey-test
112 Summary: Test module for hawkey library
113 Summary(pl.UTF-8): Moduł testowy dla biblioteki hawkey
114 Group: Development/Libraries
115 Requires: python3-hawkey = %{version}-%{release}
117 %description -n python3-hawkey-test
118 Test module for hawkey library.
120 %description -n python3-hawkey-test -l pl.UTF-8
121 Moduł testowy dla biblioteki hawkey.
123 %package -n python-hawkey-apidocs
124 Summary: API documentation for Python hawkey module
125 Summary(pl.UTF-8): Dokumentacja API modułu Pythona hawkey
127 Obsoletes: hawkey-apidocs < 0.6.4-2
130 %description -n python-hawkey-apidocs
131 API documentation for Python hawkey module.
133 %description -n python-hawkey-apidocs -l pl.UTF-8
134 Dokumentacja API modułu Pythona hawkey.
138 %{?with_rpm5:%patch0 -p1}
141 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
142 install -d build %{?with_python3:build-py3}
145 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON}
153 %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
160 rm -rf $RPM_BUILD_ROOT
163 %{__make} -C build-py3 install \
164 DESTDIR=$RPM_BUILD_ROOT
166 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
167 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
170 %{__make} -C build install \
171 DESTDIR=$RPM_BUILD_ROOT
173 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
174 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
177 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
178 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
181 rm -rf $RPM_BUILD_ROOT
183 %post -p /sbin/ldconfig
184 %postun -p /sbin/ldconfig
187 %defattr(644,root,root,755)
188 %doc AUTHORS MAINTAINERS NEWS README.md docs/release_notes.rst
189 %attr(755,root,root) %{_libdir}/libdnf.so.1
190 %{_libdir}/girepository-1.0/Dnf-1.0.typelib
193 %defattr(644,root,root,755)
194 %attr(755,root,root) %{_libdir}/libdnf.so
195 %{_includedir}/libdnf
196 %{_datadir}/gir-1.0/Dnf-1.0.gir
197 %{_pkgconfigdir}/libdnf.pc
201 %defattr(644,root,root,755)
205 %files -n python-hawkey
206 %defattr(644,root,root,755)
207 %dir %{py_sitedir}/hawkey
208 %attr(755,root,root) %{py_sitedir}/hawkey/_hawkeymodule.so
209 %{py_sitedir}/hawkey/__init__.py[co]
210 %{_mandir}/man3/hawkey.3*
212 %files -n python-hawkey-test
213 %defattr(644,root,root,755)
214 %dir %{py_sitedir}/hawkey/test
215 %{py_sitedir}/hawkey/test/*.py[co]
216 %attr(755,root,root) %{py_sitedir}/hawkey/test/_hawkey_testmodule.so
219 %files -n python3-hawkey
220 %defattr(644,root,root,755)
221 %dir %{py3_sitedir}/hawkey
222 %attr(755,root,root) %{py3_sitedir}/hawkey/_hawkey.so
223 %{py3_sitedir}/hawkey/*.py
224 %{py3_sitedir}/hawkey/__pycache__
225 %{_mandir}/man3/hawkey.3*
227 %files -n python3-hawkey-test
228 %defattr(644,root,root,755)
229 %dir %{py3_sitedir}/hawkey/test
230 %{py3_sitedir}/hawkey/test/*.py
231 %{py3_sitedir}/hawkey/test/__pycache__
232 %attr(755,root,root) %{py3_sitedir}/hawkey/test/_hawkey_test.so
235 %files -n python-hawkey-apidocs
236 %defattr(644,root,root,755)
237 %doc build/docs/hawkey/html/{_static,*.html,*.js}