]> git.pld-linux.org Git - packages/libdnf.git/blob - libdnf.spec
- unconditional noarch subpackages
[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.11.1
12 Release:        7
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:  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)
37
38 # hawkey(3) man page shared between python-hawkey and python3-hawkey
39 %define         _duplicate_files_terminate_build        0
40
41 %description
42 Library providing simplified C and Python API to libsolv.
43
44 %description -l pl.UTF-8
45 Biblioteka zapewniająca uproszczone API C i Pythona do libsolv.
46
47 %package devel
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
56
57 %description devel
58 Header files for libdnf library.
59
60 %description devel -l pl.UTF-8
61 Pliki nagłówkowe biblioteki libdnf.
62
63 %package apidocs
64 Summary:        API documentation for libdnf library
65 Summary(pl.UTF-8):      Dokumentacja API biblioteki libdnf
66 Group:          Documentation
67 BuildArch:      noarch
68
69 %description apidocs
70 API documentation for libdnf library.
71
72 %description apidocs -l pl.UTF-8
73 Dokumentacja API biblioteki libdnf.
74
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}
80
81 %description -n python-hawkey
82 Python 2.x bindings for hawkey library.
83
84 %description -n python-hawkey -l pl.UTF-8
85 Wiązania Pythona 2.x do biblioteki hawkey.
86
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}
92
93 %description -n python-hawkey-test
94 Test module for hawkey library.
95
96 %description -n python-hawkey-test -l pl.UTF-8
97 Moduł testowy dla biblioteki hawkey.
98
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}
104
105 %description -n python3-hawkey
106 Python 3.x bindings for hawkey library.
107
108 %description -n python3-hawkey -l pl.UTF-8
109 Wiązania Pythona 3.x do biblioteki hawkey.
110
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}
116
117 %description -n python3-hawkey-test
118 Test module for hawkey library.
119
120 %description -n python3-hawkey-test -l pl.UTF-8
121 Moduł testowy dla biblioteki hawkey.
122
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
126 Group:          Documentation
127 Obsoletes:      hawkey-apidocs < 0.6.4-2
128 BuildArch:      noarch
129
130 %description -n python-hawkey-apidocs
131 API documentation for Python hawkey module.
132
133 %description -n python-hawkey-apidocs -l pl.UTF-8
134 Dokumentacja API modułu Pythona hawkey.
135
136 %prep
137 %setup -q
138 %{?with_rpm5:%patch0 -p1}
139
140 %build
141 export CFLAGS="%{rpmcflags} -D_GNU_SOURCE}"
142 install -d build %{?with_python3:build-py3}
143 cd build
144 %cmake .. \
145         %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON}
146
147 %{__make}
148 %{__make} doc-html
149
150 %if %{with python3}
151 cd ../build-py3
152 %cmake .. \
153         %{?with_rhsm:-DENABLE_RHSM_SUPPORT=ON} \
154         -DPYTHON_DESIRED=3
155
156 %{__make}
157 %endif
158
159 %install
160 rm -rf $RPM_BUILD_ROOT
161
162 %if %{with python3}
163 %{__make} -C build-py3 install \
164         DESTDIR=$RPM_BUILD_ROOT
165
166 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
167 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/hawkey
168 %endif
169
170 %{__make} -C build install \
171         DESTDIR=$RPM_BUILD_ROOT
172
173 %py_comp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
174 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/hawkey
175 %py_postclean
176
177 install -d $RPM_BUILD_ROOT%{_gtkdocdir}
178 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/* $RPM_BUILD_ROOT%{_gtkdocdir}
179
180 %clean
181 rm -rf $RPM_BUILD_ROOT
182
183 %post   -p /sbin/ldconfig
184 %postun -p /sbin/ldconfig
185
186 %files
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
191
192 %files devel
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
198
199 %if %{with apidocs}
200 %files apidocs
201 %defattr(644,root,root,755)
202 %{_gtkdocdir}/libdnf
203 %endif
204
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*
211
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
217
218 %if %{with python3}
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*
226
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
233 %endif
234
235 %files -n python-hawkey-apidocs
236 %defattr(644,root,root,755)
237 %doc build/docs/hawkey/html/{_static,*.html,*.js}
This page took 0.100192 seconds and 3 git commands to generate.