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