2 # spec file for package libsolv
4 # Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
21 Url: https://github.com/openSUSE/libsolv
22 Source: libsolv-%{version}.tar.bz2
23 BuildRoot: %{_tmppath}/%{name}-%{version}-build
25 %bcond_without enable_static
26 %bcond_without disable_shared
27 %bcond_without perl_binding
28 %bcond_without python_binding
29 %bcond_without python3_binding
30 %bcond_without ruby_binding
33 %if 0%{?leap_version} >= 420300 || 0%{?sle_version} >= 120300 || 0%{?suse_version} >= 1330 || !0%{?suse_version}
41 %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?mageia} >= 6 || 0%{?suse_version} >= 1330
42 %bcond_without richdeps
47 %if 0%{?mandriva_version}
48 # force this version on mandriva
49 BuildRequires: libneon0.26-devel
51 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
52 BuildRequires: db-devel
54 BuildRequires: libxml2-devel
55 %if 0%{?suse_version} && 0%{?suse_version} < 1100
56 BuildRequires: graphviz
58 %if 0%{?suse_version} > 1020 || 0%{?fedora} || 0%{?mageia}
62 BuildRequires: gcc-c++
63 BuildRequires: rpm-devel
64 BuildRequires: zlib-devel
66 %if %{with perl_binding}
68 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
69 BuildRequires: perl-devel
74 %if %{with ruby_binding}
75 %global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']")
77 BuildRequires: ruby-devel
81 %if %{with python_binding}
82 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
83 BuildRequires: python-devel
87 %if %{with python3_binding}
88 %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
89 BuildRequires: python3-devel
94 BuildRequires: libbz2-devel
96 BuildRequires: bzip2-devel
101 BuildRequires: xz-devel
105 Summary: Package dependency solver using a satisfiability algorithm
106 License: BSD-3-Clause
107 Group: Development/Libraries/C and C++
110 libsolv is a library for solving packages and reading repositories.
111 The solver uses a satisfiability algorithm.
113 %if !%{with disable_shared}
114 %package -n libsolv@LIBSOLV_SOVERSION@
115 Summary: Package dependency solver using a satisfiability algorithm
116 Group: System/Libraries
118 %description -n libsolv@LIBSOLV_SOVERSION@
119 libsolv is a library for solving packages and reading repositories.
120 It consists of two central blocks: Using a dictionary approach to
121 store and retrieve package and dependency information, and, using a
122 so-called satisfiability algorithm for resolving package
127 Summary: Development files for libsolv, a package solver
128 Group: Development/Libraries/C and C++
129 %if !%{with disable_shared}
130 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
133 Conflicts: libsatsolver-devel
136 Development files for libsolv, a library for solving packages and
137 reading repositories.
140 Summary: Utilities to work with .solv files
141 Group: System/Management
142 Obsoletes: satsolver-tools < 0.18
143 Provides: satsolver-tools = 0.18
144 Conflicts: satsolver-tools-obsolete
145 Requires: gzip bzip2 coreutils findutils
148 libsolv is a library for solving packages and reading repositories.
150 This subpackage contains utilities to create and work with the .solv
151 files used by libsolv.
154 Summary: Applications demoing the libsolv library
155 Group: System/Management
157 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
160 %if 0%{?suse_version}
163 Conflicts: libsatsolver-demo
166 Applications demoing the libsolv library.
168 %package -n ruby-solv
169 Summary: Ruby bindings for the libsolv library
170 Group: Development/Languages/Ruby
172 %description -n ruby-solv
173 Ruby bindings for libsolv.
175 %package -n python-solv
176 %if 0%{?py_requires:1} && %{with python_binding}
179 Summary: Python bindings for the libsolv library
180 Group: Development/Languages/Python
182 %description -n python-solv
183 Python bindings for libsolv.
185 %package -n python3-solv
186 Summary: Python3 bindings for the libsolv library
187 Group: Development/Languages/Python
189 %description -n python3-solv
190 Python3 bindings for libsolv.
192 %package -n perl-solv
193 Requires: perl = %{perl_version}
194 Summary: Perl bindings for the libsolv library
195 Group: Development/Languages/Perl
197 %description -n perl-solv
198 Perl bindings for libsolv.
201 %setup -n libsolv-%{version}
204 export CFLAGS="%{optflags}"
205 export CXXFLAGS="$CFLAGS"
208 %if 0%{?fedora} || 0%{?rhel} >= 6
209 CMAKE_FLAGS="-DFEDORA=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
212 CMAKE_FLAGS="-DMAGEIA=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
214 %if 0%{?suse_version}
215 CMAKE_FLAGS="-DSUSE=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
219 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
221 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
222 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
224 %{?with_enable_static:-DENABLE_STATIC=1} \
225 %{?with_disable_shared:-DDISABLE_SHARED=1} \
226 %{?with_perl_binding:-DENABLE_PERL=1} \
227 %{?with_python_binding:-DENABLE_PYTHON=1} \
228 %{?with_python3_binding:-DENABLE_PYTHON3=1} \
229 %{?with_ruby_binding:-DENABLE_RUBY=1} \
230 %{?with_bz2:-DENABLE_BZIP2_COMPRESSION=1} \
231 %{?with_xz:-DENABLE_LZMA_COMPRESSION=1} \
232 %{?with_richdeps:-DENABLE_COMPLEX_DEPS=1} \
233 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
239 make DESTDIR=%{buildroot} install
240 %if 0%{?suse_version}
241 %if %{with python_binding}
242 pushd %{buildroot}/%{python_sitearch}
243 python %py_libdir/py_compile.py *.py
244 python -O %py_libdir/py_compile.py *.py
247 %if %{with python3_binding}
248 %py3_compile %{buildroot}/%{python3_sitearch}
251 %if %{with disable_shared}
252 # we want to leave the .a file untouched
253 export NO_BRP_STRIP_DEBUG=true
256 %if !%{with disable_shared}
257 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
259 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
261 %files -n libsolv@LIBSOLV_SOVERSION@
262 %defattr(-,root,root)
264 %{_libdir}/libsolv.so.*
265 %{_libdir}/libsolvext.so.*
269 %defattr(-,root,root)
270 %if 0%{?suse_version}
271 %exclude %{_bindir}/helix2solv
272 %exclude %{_mandir}/man1/helix2solv*
274 %exclude %{_bindir}/solv
279 %defattr(-,root,root)
280 %if %{with enable_static}
282 %{_libdir}/libsolvext.a
284 %if !%{with disable_shared}
285 %{_libdir}/libsolv.so
286 %{_libdir}/libsolvext.so
289 %if 0%{?suse_version}
290 %{_bindir}/helix2solv
291 %{_mandir}/man1/helix2solv*
293 %{_datadir}/cmake/Modules/*
294 %{_libdir}/pkgconfig/libsolv*.pc
298 %defattr(-,root,root)
301 %if %{with perl_binding}
303 %defattr(-,root,root)
307 %if %{with ruby_binding}
309 %defattr(-,root,root)
313 %if %{with python_binding}
314 %files -n python-solv
315 %defattr(-,root,root)
319 %if %{with python3_binding}
320 %files -n python3-solv
321 %defattr(-,root,root)
322 %{python3_sitearch}/*solv*
323 %if 0%{?suse_version}
324 %{python3_sitearch}/*/*solv*