2 # spec file for package libsolv
4 # Copyright (c) 2012 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: A new approach to package dependency solving
106 License: BSD-3-Clause
107 Group: Development/Libraries/C and C++
110 A new approach to package dependency solving
112 %if !%{with disable_shared}
113 %package -n libsolv@LIBSOLV_SOVERSION@
114 Summary: A new approach to package dependency solving
115 Group: Development/Libraries/C and C++
117 %description -n libsolv@LIBSOLV_SOVERSION@
118 A new approach to package dependency solving
122 Summary: A new approach to package dependency solving
123 Group: Development/Libraries/C and C++
124 %if !%{with disable_shared}
125 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
128 Conflicts: libsatsolver-devel
131 Development files for libsolv, a new approach to package dependency solving
134 Summary: A new approach to package dependency solving
135 Group: Development/Libraries/C and C++
136 Obsoletes: satsolver-tools < 0.18
137 Provides: satsolver-tools = 0.18
138 Conflicts: satsolver-tools-obsolete
139 Requires: gzip bzip2 coreutils findutils
142 A new approach to package dependency solving.
145 Summary: Applications demoing the libsolv library
146 Group: System/Management
148 %if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?mageia}
151 %if 0%{?suse_version}
154 Conflicts: libsatsolver-demo
157 Applications demoing the libsolv library.
159 %package -n ruby-solv
160 Summary: Ruby bindings for the libsolv library
161 Group: Development/Languages/Ruby
163 %description -n ruby-solv
164 Ruby bindings for sat solver.
166 %package -n python-solv
167 %if 0%{?py_requires:1} && %{with python_binding}
170 Summary: Python bindings for the libsolv library
171 Group: Development/Languages/Python
173 %description -n python-solv
174 Python bindings for sat solver.
176 %package -n python3-solv
177 Summary: Python3 bindings for the libsolv library
178 Group: Development/Languages/Python
180 %description -n python3-solv
181 Python3 bindings for sat solver.
183 %package -n perl-solv
184 Requires: perl = %{perl_version}
185 Summary: Perl bindings for the libsolv library
186 Group: Development/Languages/Perl
188 %description -n perl-solv
189 Perl bindings for sat solver.
192 %setup -n libsolv-%{version}
195 export CFLAGS="$RPM_OPT_FLAGS"
196 export CXXFLAGS="$CFLAGS"
199 %if 0%{?fedora} || 0%{?rhel} >= 6
200 CMAKE_FLAGS="-DFEDORA=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
203 CMAKE_FLAGS="-DMAGEIA=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
205 %if 0%{?suse_version}
206 CMAKE_FLAGS="-DSUSE=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
210 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
212 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
213 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
215 %{?with_enable_static:-DENABLE_STATIC=1} \
216 %{?with_disable_shared:-DDISABLE_SHARED=1} \
217 %{?with_perl_binding:-DENABLE_PERL=1} \
218 %{?with_python_binding:-DENABLE_PYTHON=1} \
219 %{?with_python3_binding:-DENABLE_PYTHON3=1} \
220 %{?with_ruby_binding:-DENABLE_RUBY=1} \
221 %{?with_bz2:-DENABLE_BZIP2_COMPRESSION=1} \
222 %{?with_xz:-DENABLE_LZMA_COMPRESSION=1} \
223 %{?with_richdeps:-DENABLE_COMPLEX_DEPS=1} \
224 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
230 make DESTDIR=$RPM_BUILD_ROOT install
231 %if 0%{?suse_version}
232 %if %{with python_binding}
233 pushd $RPM_BUILD_ROOT/%{python_sitearch}
234 python %py_libdir/py_compile.py *.py
235 python -O %py_libdir/py_compile.py *.py
238 %if %{with python3_binding}
239 %py3_compile $RPM_BUILD_ROOT/%{python3_sitearch}
242 %if %{with disable_shared}
243 # we want to leave the .a file untouched
244 export NO_BRP_STRIP_DEBUG=true
248 rm -rf "$RPM_BUILD_ROOT"
250 %if !%{with disable_shared}
251 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
253 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
255 %files -n libsolv@LIBSOLV_SOVERSION@
256 %defattr(-,root,root)
258 %{_libdir}/libsolv.so.*
259 %{_libdir}/libsolvext.so.*
263 %defattr(-,root,root)
264 %if 0%{?suse_version}
265 %exclude %{_bindir}/helix2solv
266 %exclude %{_mandir}/man1/helix2solv*
268 %exclude %{_bindir}/solv
273 %defattr(-,root,root)
274 %if %{with enable_static}
276 %{_libdir}/libsolvext.a
278 %if !%{with disable_shared}
279 %{_libdir}/libsolv.so
280 %{_libdir}/libsolvext.so
283 %if 0%{?suse_version}
284 %{_bindir}/helix2solv
285 %{_mandir}/man1/helix2solv*
287 %{_datadir}/cmake/Modules/*
288 %{_libdir}/pkgconfig/libsolv*.pc
292 %defattr(-,root,root)
295 %if %{with perl_binding}
297 %defattr(-,root,root)
301 %if %{with ruby_binding}
303 %defattr(-,root,root)
307 %if %{with python_binding}
308 %files -n python-solv
309 %defattr(-,root,root)
313 %if %{with python3_binding}
314 %files -n python3-solv
315 %defattr(-,root,root)
316 %{python3_sitearch}/*solv*
317 %if 0%{?suse_version}
318 %{python3_sitearch}/*/*solv*