]>
Commit | Line | Data |
---|---|---|
48e6f7d6 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without static_libs # static libraries | |
4 | %bcond_without python3 # Python 3.x bindings | |
409c8105 | 5 | %bcond_with rpm5 # rpm5 fork instead of rpm.org |
c3036d16 | 6 | %bcond_without ruby # Ruby bindings |
f3674f2d | 7 | %bcond_without tcl # Tcl bindings |
c3036d16 | 8 | |
48e6f7d6 JB |
9 | Summary: Package dependency solver |
10 | Summary(pl.UTF-8): Biblioteka do rozwiązywania zależności pakietów | |
11 | Name: libsolv | |
6aaf0d53 | 12 | Version: 0.7.22 |
31fe7649 | 13 | Release: 3 |
48e6f7d6 JB |
14 | License: BSD |
15 | Group: Libraries | |
6aaf0d53 | 16 | #Source0Download: https://github.com/openSUSE/libsolv/tags |
ddf7b6ba | 17 | Source0: https://github.com/openSUSE/libsolv/archive/%{version}/%{name}-%{version}.tar.gz |
6aaf0d53 | 18 | # Source0-md5: b58659b65c3a2dbb9eed7845ab93cf3a |
951d8ff0 | 19 | Patch0: ruby.patch |
ce97d5b0 | 20 | Patch1: %{name}-python.patch |
8163445e | 21 | Patch2: %{name}-rpm5.patch |
ed361b0e | 22 | Patch3: uname-cpuinfo-deps.patch |
48e6f7d6 JB |
23 | URL: https://github.com/openSUSE/libsolv |
24 | BuildRequires: bzip2-devel | |
38386207 | 25 | BuildRequires: cmake >= 2.8.5 |
48e6f7d6 JB |
26 | BuildRequires: db-devel |
27 | BuildRequires: expat-devel | |
48e6f7d6 JB |
28 | BuildRequires: perl-devel |
29 | BuildRequires: pkgconfig | |
30 | BuildRequires: python-devel >= 2 | |
31 | %{?with_python3:BuildRequires: python3-devel >= 3} | |
7fe69439 | 32 | BuildRequires: rpm-devel |
48e6f7d6 JB |
33 | BuildRequires: rpm-perlprov |
34 | BuildRequires: rpm-pythonprov | |
409c8105 | 35 | BuildRequires: rpmbuild(macros) >= 1.745 |
c3036d16 ER |
36 | BuildRequires: swig-perl |
37 | BuildRequires: swig-python | |
f3674f2d | 38 | %{?with_tcl:BuildRequires: swig-tcl} |
48e6f7d6 | 39 | BuildRequires: tar >= 1:1.22 |
f3674f2d | 40 | %{?with_tcl:BuildRequires: tcl-devel} |
48e6f7d6 JB |
41 | BuildRequires: xz |
42 | BuildRequires: xz-devel | |
38386207 | 43 | BuildRequires: zchunk-devel |
48e6f7d6 | 44 | BuildRequires: zlib-devel |
38386207 | 45 | BuildRequires: zstd-devel |
c3036d16 ER |
46 | %if %{with ruby} |
47 | BuildRequires: rpm-rubyprov | |
48 | BuildRequires: ruby-devel | |
49 | BuildRequires: swig-ruby | |
50 | %endif | |
48e6f7d6 JB |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
52 | ||
e8a70a90 AM |
53 | %define specflags -D_GNU_SOURCE=1 |
54 | ||
48e6f7d6 JB |
55 | %description |
56 | A free package dependency solver using a satisfiability algorithm. The | |
57 | library is based on two major, but independent, blocks: | |
58 | ||
59 | - Using a dictionary approach to store and retrieve package and | |
60 | dependency information. | |
61 | ||
62 | - Using satisfiability, a well known and researched topic, for | |
63 | resolving package dependencies. | |
64 | ||
65 | %description -l pl.UTF-8 | |
66 | Wolnodostępna biblioteka do rozwiązywania zależności pakietów przy | |
67 | użyciu algorytmu spełnialności. Biblioteka jest podzielona na dwa | |
68 | główne, niezależne bloki: | |
69 | ||
c3036d16 ER |
70 | - wykorzystanie podejścia słownikowego do przechowywania i odtwarzania |
71 | informacji o pakietach i zależnościach, | |
48e6f7d6 JB |
72 | |
73 | - wykorzystanie spełnialności - dobrze znanego i zbadanego tematu do | |
74 | rozwiązywania zależności pakietów. | |
75 | ||
76 | %package devel | |
77 | Summary: Header files for libsolv libraries | |
78 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek libsolv | |
79 | Group: Development/Libraries | |
80 | Requires: %{name} = %{version}-%{release} | |
7fe69439 | 81 | Requires: rpm-devel |
48e6f7d6 JB |
82 | |
83 | %description devel | |
84 | Development files for libsolv. | |
85 | ||
86 | %description devel -l pl.UTF-8 | |
87 | Pliki programistyczne biblioetk libsolv. | |
88 | ||
89 | %package static | |
90 | Summary: Static libsolv libraries | |
91 | Summary(pl.UTF-8): Statyczne biblioteki libsolv | |
92 | Group: Development/Libraries | |
93 | Requires: %{name}-devel = %{version}-%{release} | |
94 | ||
95 | %description static | |
96 | Static libsolv libraries. | |
97 | ||
98 | %description static -l pl.UTF-8 | |
99 | Statyczne biblioteki libsolv. | |
100 | ||
101 | %package tools | |
102 | Summary: Package dependency solver tools | |
103 | Summary(pl.UTF-8): Narzędzia do rozwiązywania zależności pakietów | |
104 | Group: Applications/System | |
105 | Requires: %{name} = %{version}-%{release} | |
106 | Requires: bzip2 | |
107 | Requires: coreutils | |
108 | Requires: gzip | |
109 | ||
110 | %description tools | |
111 | Package dependency solver tools. | |
112 | ||
113 | %description tools -l pl.UTF-8 | |
114 | Narzędzia do rozwiązywania zależności pakietów. | |
115 | ||
116 | %package -n perl-solv | |
117 | Summary: Perl bindings for the libsolv libraries | |
118 | Summary(pl.UTF-8): Wiązania Perla do bibliotek libsolv | |
119 | Group: Development/Languages/Perl | |
120 | Requires: %{name} = %{version}-%{release} | |
121 | ||
122 | %description -n perl-solv | |
123 | Perl bindings for the libsolv libraries. | |
124 | ||
125 | %description -n perl-solv -l pl.UTF-8 | |
126 | Wiązania Perla do bibliotek libsolv. | |
127 | ||
128 | %package -n python-solv | |
129 | Summary: Python 2.x bindings for the libsolv library | |
130 | Summary(pl.UTF-8): Wiązania Pythona 2.x do bibliotek libsolv | |
131 | Group: Development/Languages/Python | |
132 | Requires: %{name} = %{version}-%{release} | |
133 | Requires: python-libs | |
134 | ||
135 | %description -n python-solv | |
136 | Python 2.x bindings for the libsolv library. | |
137 | ||
138 | %description -n python-solv -l pl.UTF-8 | |
139 | Wiązania Pythona 2.x do bibliotek libsolv. | |
140 | ||
141 | %package -n python3-solv | |
142 | Summary: Python 3.x bindings for the libsolv library | |
143 | Summary(pl.UTF-8): Wiązania Pythona 2.x do bibliotek libsolv | |
144 | Group: Development/Languages/Python | |
145 | Requires: %{name} = %{version}-%{release} | |
146 | Requires: python-libs | |
147 | ||
148 | %description -n python3-solv | |
149 | Python 3.x bindings for the libsolv library. | |
150 | ||
151 | %description -n python3-solv -l pl.UTF-8 | |
152 | Wiązania Pythona 3.x do bibliotek libsolv. | |
153 | ||
154 | %package -n ruby-solv | |
155 | Summary: Ruby bindings for the libsolv libraries | |
156 | Summary(pl.UTF-8): Wiązania języka Ruby do bibliotek libsolv | |
157 | Group: Development/Languages | |
158 | Requires: %{name} = %{version}-%{release} | |
159 | ||
160 | %description -n ruby-solv | |
161 | Ruby bindings for the libsolv libraries. | |
162 | ||
163 | %description -n ruby-solv -l pl.UTF-8 | |
164 | Wiązania języka Ruby do bibliotek libsolv. | |
165 | ||
f3674f2d JB |
166 | %package -n tcl-solv |
167 | Summary: Tcl bindings for the libsolv libraries | |
168 | Summary(pl.UTF-8): Wiązania języka Tcl do bibliotek libsolv | |
169 | Group: Development/Languages | |
170 | Requires: %{name} = %{version}-%{release} | |
171 | Requires: tcl | |
172 | ||
173 | %description -n tcl-solv | |
174 | Tcl bindings for the libsolv libraries. | |
175 | ||
176 | %description -n tcl-solv -l pl.UTF-8 | |
177 | Wiązania języka Tcl do bibliotek libsolv. | |
178 | ||
48e6f7d6 | 179 | %prep |
c087059a | 180 | %setup -q |
951d8ff0 | 181 | %patch0 -p1 |
ce97d5b0 | 182 | %patch1 -p1 |
7fe69439 | 183 | %{?with_rpm5:%patch2 -p1} |
ed361b0e | 184 | %patch3 -p1 |
48e6f7d6 | 185 | |
a43c9d7a | 186 | # use system one |
ce97d5b0 | 187 | %{__rm} cmake/modules/FindRuby.cmake |
a43c9d7a | 188 | |
48e6f7d6 | 189 | %build |
8163445e JB |
190 | %define common_opts \\\ |
191 | -DENABLE_APPDATA=ON \\\ | |
192 | -DENABLE_BZIP2_COMPRESSION=ON \\\ | |
f5a13d2b | 193 | -DENABLE_COMPLEX_DEPS=ON \\\ |
8163445e JB |
194 | -DENABLE_HELIXREPO=ON \\\ |
195 | -DENABLE_LZMA_COMPRESSION=ON \\\ | |
196 | -DENABLE_PUBKEY=ON \\\ | |
197 | -DENABLE_RPMDB=ON \\\ | |
efdbc54e | 198 | %{?with_rpm5:-DRPM5=ON} \\\ |
ccd8528e | 199 | %{?with_rpm5:-DENABLE_RPMDB_BDB=ON} \\\ |
efdbc54e | 200 | %{?with_rpm5:-DENABLE_RPMPKG=ON} \\\ |
ccd8528e JR |
201 | %{!?with_rpm5:-DENABLE_RPMDB_LIBRPM=ON} \\\ |
202 | %{!?with_rpm5:-DENABLE_RPMPKG_LIBRPM=ON} \\\ | |
8163445e JB |
203 | -DENABLE_RPMDB_BYRPMHEADER=ON \\\ |
204 | -DENABLE_RPMMD=ON \\\ | |
205 | %{?with_static_libs:-DENABLE_STATIC=ON} \\\ | |
38386207 JB |
206 | -DENABLE_ZCHUNK_COMPRESSION=ON \\\ |
207 | -DENABLE_ZSTD_COMPRESSION=ON \\\ | |
38386207 | 208 | -DWITH_SYSTEM_ZCHUNK=ON \\\ |
8163445e JB |
209 | %{nil} |
210 | ||
48e6f7d6 JB |
211 | install -d build %{?with_python3:build-py3} |
212 | cd build | |
213 | %cmake .. \ | |
8163445e | 214 | %{common_opts} \ |
48e6f7d6 | 215 | -DENABLE_PERL=ON \ |
48e6f7d6 | 216 | -DENABLE_PYTHON=ON \ |
c3036d16 | 217 | %{?with_ruby:-DENABLE_RUBY=ON} \ |
f3674f2d | 218 | %{?with_tcl:-DENABLE_TCL=ON} \ |
48e6f7d6 | 219 | -DPythonLibs_FIND_VERSION=2 \ |
ce97d5b0 | 220 | -DPythonLibs_FIND_VERSION_MAJOR=2 \ |
48e6f7d6 JB |
221 | -DUSE_VENDORDIRS=ON |
222 | ||
223 | %{__make} | |
224 | %if %{with python3} | |
225 | cd ../build-py3 | |
226 | %cmake .. \ | |
8163445e | 227 | %{common_opts} \ |
48e6f7d6 | 228 | -DENABLE_PYTHON=ON \ |
48e6f7d6 | 229 | -DPythonLibs_FIND_VERSION=3 \ |
8163445e | 230 | -DPythonLibs_FIND_VERSION_MAJOR=3 |
48e6f7d6 JB |
231 | |
232 | %{__make} | |
233 | %endif | |
234 | ||
235 | %install | |
236 | rm -rf $RPM_BUILD_ROOT | |
237 | ||
238 | %if %{with python3} | |
239 | %{__make} -C build-py3/bindings/python install \ | |
240 | DESTDIR=$RPM_BUILD_ROOT | |
241 | %endif | |
242 | ||
243 | %{__make} -C build install \ | |
244 | DESTDIR=$RPM_BUILD_ROOT | |
245 | ||
246 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
247 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} | |
248 | %py_postclean | |
249 | ||
250 | %clean | |
251 | rm -rf $RPM_BUILD_ROOT | |
252 | ||
253 | %post -p /sbin/ldconfig | |
254 | %postun -p /sbin/ldconfig | |
255 | ||
256 | %files | |
257 | %defattr(644,root,root,755) | |
8c8e63d4 JR |
258 | %doc CREDITS LICENSE.BSD NEWS README |
259 | %attr(755,root,root) %{_libdir}/libsolv.so.1 | |
260 | %attr(755,root,root) %{_libdir}/libsolvext.so.1 | |
48e6f7d6 JB |
261 | |
262 | %files devel | |
263 | %defattr(644,root,root,755) | |
48e6f7d6 JB |
264 | %attr(755,root,root) %{_libdir}/libsolv.so |
265 | %attr(755,root,root) %{_libdir}/libsolvext.so | |
266 | %{_includedir}/solv | |
f3674f2d | 267 | %{_pkgconfigdir}/libsolv.pc |
05212f1a | 268 | %{_pkgconfigdir}/libsolvext.pc |
48e6f7d6 JB |
269 | %{_datadir}/cmake/Modules/FindLibSolv.cmake |
270 | %{_mandir}/man3/libsolv*.3* | |
271 | ||
272 | %if %{with static_libs} | |
273 | %files static | |
274 | %defattr(644,root,root,755) | |
275 | %{_libdir}/libsolv.a | |
276 | %{_libdir}/libsolvext.a | |
277 | %endif | |
278 | ||
279 | %files tools | |
280 | %defattr(644,root,root,755) | |
c3036d16 | 281 | %attr(755,root,root) %{_bindir}/appdata2solv |
48e6f7d6 JB |
282 | %attr(755,root,root) %{_bindir}/deltainfoxml2solv |
283 | %attr(755,root,root) %{_bindir}/dumpsolv | |
1735d117 | 284 | %attr(755,root,root) %{_bindir}/helix2solv |
48e6f7d6 JB |
285 | %attr(755,root,root) %{_bindir}/installcheck |
286 | %attr(755,root,root) %{_bindir}/mergesolv | |
8c8e63d4 | 287 | %attr(755,root,root) %{_bindir}/repo2solv |
48e6f7d6 JB |
288 | %attr(755,root,root) %{_bindir}/repomdxml2solv |
289 | %attr(755,root,root) %{_bindir}/rpmdb2solv | |
290 | %attr(755,root,root) %{_bindir}/rpmmd2solv | |
291 | %attr(755,root,root) %{_bindir}/rpms2solv | |
48e6f7d6 JB |
292 | %attr(755,root,root) %{_bindir}/testsolv |
293 | %attr(755,root,root) %{_bindir}/updateinfoxml2solv | |
c087059a JR |
294 | %{_mandir}/man1/appdata2solv.1* |
295 | %{_mandir}/man1/deltainfoxml2solv.1* | |
296 | %{_mandir}/man1/dumpsolv.1* | |
1735d117 | 297 | %{_mandir}/man1/helix2solv.1* |
c087059a JR |
298 | %{_mandir}/man1/installcheck.1* |
299 | %{_mandir}/man1/mergesolv.1* | |
8c8e63d4 | 300 | %{_mandir}/man1/repo2solv.1* |
c087059a JR |
301 | %{_mandir}/man1/repomdxml2solv.1* |
302 | %{_mandir}/man1/rpmdb2solv.1* | |
303 | %{_mandir}/man1/rpmmd2solv.1* | |
304 | %{_mandir}/man1/rpms2solv.1* | |
8c8e63d4 | 305 | %{_mandir}/man1/solv.1* |
c087059a JR |
306 | %{_mandir}/man1/testsolv.1* |
307 | %{_mandir}/man1/updateinfoxml2solv.1* | |
48e6f7d6 JB |
308 | |
309 | %files -n perl-solv | |
310 | %defattr(644,root,root,755) | |
311 | %doc examples/p5solv | |
312 | %attr(755,root,root) %{perl_vendorarch}/solv.so | |
313 | %{perl_vendorarch}/solv.pm | |
314 | ||
315 | %files -n python-solv | |
316 | %defattr(644,root,root,755) | |
317 | %doc examples/pysolv | |
318 | %attr(755,root,root) %{py_sitedir}/_solv.so | |
319 | %{py_sitedir}/solv.py[co] | |
320 | ||
321 | %if %{with python3} | |
322 | %files -n python3-solv | |
323 | %defattr(644,root,root,755) | |
324 | %doc examples/pysolv | |
325 | %attr(755,root,root) %{py3_sitedir}/_solv.so | |
326 | %{py3_sitedir}/solv.py | |
327 | %endif | |
328 | ||
c3036d16 | 329 | %if %{with ruby} |
48e6f7d6 JB |
330 | %files -n ruby-solv |
331 | %defattr(644,root,root,755) | |
332 | %doc examples/rbsolv | |
333 | %attr(755,root,root) %{ruby_vendorarchdir}/solv.so | |
c3036d16 | 334 | %endif |
f3674f2d JB |
335 | |
336 | %if %{with tcl} | |
337 | %files -n tcl-solv | |
338 | %defattr(644,root,root,755) | |
339 | %doc examples/tclsolv | |
340 | %attr(755,root,root) %{_prefix}/lib/tcl8/8.*/solv-%{version}.so | |
341 | %{_prefix}/lib/tcl8/8.*/solv-%{version}.tm | |
342 | %endif |