]> git.pld-linux.org Git - packages/libdnf.git/blob - libdnf.spec
e5985b8df70a50ecf72018ad6dbc8224d70bc529
[packages/libdnf.git] / libdnf.spec
1 #
2 # Conditional build:
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
7 #
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
10 Name:           libdnf
11 Version:        0.60.0
12 Release:        3
13 License:        LGPL v2.1+
14 Group:          Libraries
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)
46
47 # PyErr_Format(HyExc_Exception, e.what());
48 %define         filterout       -Wformat -Werror=format-security
49
50 # hawkey(3) man page shared between python-hawkey and python3-hawkey
51 %define         _duplicate_files_terminate_build        0
52
53 %description
54 Library providing simplified C and Python API to libsolv.
55
56 %description -l pl.UTF-8
57 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
58
59 %package devel
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
67 Requires:       rpm-devel
68
69 %description devel
70 Header files for libdnf library.
71
72 %description devel -l pl.UTF-8
73 Pliki nagłówkowe biblioteki libdnf.
74
75 %package apidocs
76 Summary:        API documentation for libdnf library
77 Summary(pl.UTF-8):      Dokumentacja API biblioteki libdnf
78 Group:          Documentation
79 BuildArch:      noarch
80
81 %description apidocs
82 API documentation for libdnf library.
83
84 %description apidocs -l pl.UTF-8
85 Dokumentacja API biblioteki libdnf.
86
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}
92
93 %description -n python-hawkey
94 Python 2.x bindings for hawkey library.
95
96 %description -n python-hawkey -l pl.UTF-8
97 Wiązania Pythona 2.x do biblioteki hawkey.
98
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}
104
105 %description -n python-hawkey-test
106 Test module for hawkey library.
107
108 %description -n python-hawkey-test -l pl.UTF-8
109 Moduł testowy dla biblioteki hawkey.
110
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}
116
117 %description -n python3-hawkey
118 Python 3.x bindings for hawkey library.
119
120 %description -n python3-hawkey -l pl.UTF-8
121 Wiązania Pythona 3.x do biblioteki hawkey.
122
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}
128
129 %description -n python3-hawkey-test
130 Test module for hawkey library.
131
132 %description -n python3-hawkey-test -l pl.UTF-8
133 Moduł testowy dla biblioteki hawkey.
134
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
138 Group:          Documentation
139 Obsoletes:      hawkey-apidocs < 0.6.4-2
140 BuildArch:      noarch
141
142 %description -n python-hawkey-apidocs
143 API documentation for Python hawkey module.
144
145 %description -n python-hawkey-apidocs -l pl.UTF-8
146 Dokumentacja API modułu Pythona hawkey.
147
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}
153
154 %description -n python-libdnf
155 Python 2.x bindings for hawkey libdnf.
156
157 %description -n python-libdnf -l pl.UTF-8
158 Wiązania Pythona 2.x do biblioteki libdnf.
159
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}
165
166 %description -n python3-libdnf
167 Python 3.x bindings for hawkey library.
168
169 %description -n python3-libdnf -l pl.UTF-8
170 Wiązania Pythona 3.x do biblioteki libdnf.
171
172 %prep
173 %setup -q
174 %{?with_rpm5:%patch0 -p1}
175
176 %build
177 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
178 install -d build %{?with_python3:build-py3}
179 cd build
180 %cmake .. \
181         %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
182         -DPYTHON_DESIRED=2
183
184 %{__make}
185 %{__make} doc-html
186
187 %if %{with python3}
188 cd ../build-py3
189 %cmake .. \
190         %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
191         -DPYTHON_DESIRED=3
192
193 %{__make}
194 %endif
195
196 %install
197 rm -rf $RPM_BUILD_ROOT
198
199 %if %{with python3}
200 %{__make} -C build-py3 install \
201         DESTDIR=$RPM_BUILD_ROOT
202
203 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
204 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
205
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
208 %endif
209
210 %{__make} -C build install \
211         DESTDIR=$RPM_BUILD_ROOT
212
213 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
214 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
215
216 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
217 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
218 %py_postclean
219
220 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
221 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
222
223 %find_lang %{name}
224
225 %clean
226 rm -rf $RPM_BUILD_ROOT
227
228 %post   -p /sbin/ldconfig
229 %postun -p /sbin/ldconfig
230
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
237
238 %files devel
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_libdir}/libdnf.so
241 %{_includedir}/libdnf
242 %{_pkgconfigdir}/libdnf.pc
243
244 %if %{with apidocs}
245 %files apidocs
246 %defattr(644,root,root,755)
247 %{_gtkdocdir}/libdnf
248 %endif
249
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*
256
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
262
263 %if %{with python3}
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*
271
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
278 %endif
279
280 %files -n python-hawkey-apidocs
281 %defattr(644,root,root,755)
282 %doc build/docs/hawkey/html/{_static,*.html,*.js}
283
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
289
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
This page took 0.067983 seconds and 2 git commands to generate.