]> git.pld-linux.org Git - packages/libdnf.git/blob - libdnf.spec
7afee26ca93acddb6bbbc49be60ced0af524055b
[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.67.0
12 Release:        1
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:  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)
48
49 # PyErr_Format(HyExc_Exception, e.what());
50 %define         filterout       -Wformat -Werror=format-security
51
52 # hawkey(3) man page shared between python-hawkey and python3-hawkey
53 %define         _duplicate_files_terminate_build        0
54
55 %description
56 Library providing simplified C and Python API to libsolv.
57
58 %description -l pl.UTF-8
59 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
60
61 %package devel
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}
71
72 %description devel
73 Header files for libdnf library.
74
75 %description devel -l pl.UTF-8
76 Pliki nagłówkowe biblioteki libdnf.
77
78 %package apidocs
79 Summary:        API documentation for libdnf library
80 Summary(pl.UTF-8):      Dokumentacja API biblioteki libdnf
81 Group:          Documentation
82 BuildArch:      noarch
83
84 %description apidocs
85 API documentation for libdnf library.
86
87 %description apidocs -l pl.UTF-8
88 Dokumentacja API biblioteki libdnf.
89
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}
95
96 %description -n python-hawkey
97 Python 2.x bindings for hawkey library.
98
99 %description -n python-hawkey -l pl.UTF-8
100 Wiązania Pythona 2.x do biblioteki hawkey.
101
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}
107
108 %description -n python-hawkey-test
109 Test module for hawkey library.
110
111 %description -n python-hawkey-test -l pl.UTF-8
112 Moduł testowy dla biblioteki hawkey.
113
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}
119
120 %description -n python3-hawkey
121 Python 3.x bindings for hawkey library.
122
123 %description -n python3-hawkey -l pl.UTF-8
124 Wiązania Pythona 3.x do biblioteki hawkey.
125
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}
131
132 %description -n python3-hawkey-test
133 Test module for hawkey library.
134
135 %description -n python3-hawkey-test -l pl.UTF-8
136 Moduł testowy dla biblioteki hawkey.
137
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
141 Group:          Documentation
142 Obsoletes:      hawkey-apidocs < 0.6.4-2
143 BuildArch:      noarch
144
145 %description -n python-hawkey-apidocs
146 API documentation for Python hawkey module.
147
148 %description -n python-hawkey-apidocs -l pl.UTF-8
149 Dokumentacja API modułu Pythona hawkey.
150
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}
156
157 %description -n python-libdnf
158 Python 2.x bindings for hawkey libdnf.
159
160 %description -n python-libdnf -l pl.UTF-8
161 Wiązania Pythona 2.x do biblioteki libdnf.
162
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}
168
169 %description -n python3-libdnf
170 Python 3.x bindings for hawkey library.
171
172 %description -n python3-libdnf -l pl.UTF-8
173 Wiązania Pythona 3.x do biblioteki libdnf.
174
175 %prep
176 %setup -q
177 %{?with_rpm5:%patch0 -p1}
178
179 %build
180 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
181 install -d build %{?with_python3:build-py3}
182 cd build
183 %cmake .. \
184         %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
185         -DPYTHON_DESIRED=2
186
187 %{__make}
188 %{__make} doc-html
189
190 %if %{with python3}
191 cd ../build-py3
192 %cmake .. \
193         %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
194         -DPYTHON_DESIRED=3
195
196 %{__make}
197 %endif
198
199 %install
200 rm -rf $RPM_BUILD_ROOT
201
202 %if %{with python3}
203 %{__make} -C build-py3 install \
204         DESTDIR=$RPM_BUILD_ROOT
205
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
208
209 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
210 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/libdnf
211 %endif
212
213 %{__make} -C build install \
214         DESTDIR=$RPM_BUILD_ROOT
215
216 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
217 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
218
219 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
220 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/libdnf
221 %py_postclean
222
223 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
224 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
225
226 %find_lang %{name}
227
228 %clean
229 rm -rf $RPM_BUILD_ROOT
230
231 %post   -p /sbin/ldconfig
232 %postun -p /sbin/ldconfig
233
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
240
241 %files devel
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_libdir}/libdnf.so
244 %{_includedir}/libdnf
245 %{_pkgconfigdir}/libdnf.pc
246
247 %if %{with apidocs}
248 %files apidocs
249 %defattr(644,root,root,755)
250 %{_gtkdocdir}/libdnf
251 %endif
252
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*
259
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
265
266 %if %{with python3}
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*
274
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
281 %endif
282
283 %files -n python-hawkey-apidocs
284 %defattr(644,root,root,755)
285 %doc build/docs/hawkey/html/{_static,*.html,*.js}
286
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
292
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
This page took 0.100061 seconds and 2 git commands to generate.