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