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