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%{?mandriva_version}
34 # force this version on mandriva
35 BuildRequires: libneon0.26-devel
37 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
38 BuildRequires: db-devel
40 BuildRequires: libxml2-devel
41 %if 0%{?suse_version} && 0%{?suse_version} < 1100
42 BuildRequires: graphviz
44 %if 0%{?suse_version} > 1020
48 BuildRequires: gcc-c++
49 BuildRequires: rpm-devel
50 BuildRequires: zlib-devel
52 %if %{with perl_binding}
54 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
55 BuildRequires: perl-devel
59 %if %{with ruby_binding}
60 %global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']")
62 BuildRequires: ruby-devel
65 %if %{with python_binding}
66 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
67 BuildRequires: python-devel
70 %if %{with python3_binding}
71 %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
72 BuildRequires: python3-devel
75 Summary: A new approach to package dependency solving
77 Group: Development/Libraries/C and C++
80 A new approach to package dependency solving
82 %if !%{with disable_shared}
83 %package -n libsolv@LIBSOLV_SOVERSION@
84 Summary: A new approach to package dependency solving
85 Group: Development/Libraries/C and C++
87 %description -n libsolv@LIBSOLV_SOVERSION@
88 A new approach to package dependency solving
92 Summary: A new approach to package dependency solving
93 Group: Development/Libraries/C and C++
94 %if !%{with disable_shared}
95 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
98 Conflicts: libsatsolver-devel
101 Development files for libsolv, a new approach to package dependency solving
104 Summary: A new approach to package dependency solving
105 Group: Development/Libraries/C and C++
106 Obsoletes: satsolver-tools < 0.18
107 Provides: satsolver-tools = 0.18
108 Conflicts: satsolver-tools-obsolete
109 Requires: gzip bzip2 coreutils findutils
112 A new approach to package dependency solving.
115 Summary: Applications demoing the libsolv library
116 Group: System/Management
118 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
121 %if 0%{?suse_version}
124 Conflicts: libsatsolver-demo
127 Applications demoing the libsolv library.
129 %package -n ruby-solv
130 Summary: Ruby bindings for the libsolv library
131 Group: Development/Languages/Ruby
133 %description -n ruby-solv
134 Ruby bindings for sat solver.
136 %package -n python-solv
137 %if 0%{?py_requires:1} && %{with python_binding}
140 Summary: Python bindings for the libsolv library
141 Group: Development/Languages/Python
143 %description -n python-solv
144 Python bindings for sat solver.
146 %package -n python3-solv
147 Summary: Python3 bindings for the libsolv library
148 Group: Development/Languages/Python
150 %description -n python3-solv
151 Python3 bindings for sat solver.
153 %package -n perl-solv
154 Requires: perl = %{perl_version}
155 Summary: Perl bindings for the libsolv library
156 Group: Development/Languages/Perl
158 %description -n perl-solv
159 Perl bindings for sat solver.
162 %setup -n libsolv-%{version}
165 export CFLAGS="$RPM_OPT_FLAGS"
166 export CXXFLAGS="$CFLAGS"
169 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
170 CMAKE_FLAGS="-DFEDORA=1"
172 %if 0%{?suse_version}
173 CMAKE_FLAGS="-DSUSE=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
177 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
179 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
180 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
182 %{?with_enable_static:-DENABLE_STATIC=1} \
183 %{?with_disable_shared:-DDISABLE_SHARED=1} \
184 %{?with_perl_binding:-DENABLE_PERL=1} \
185 %{?with_python_binding:-DENABLE_PYTHON=1} \
186 %{?with_python3_binding:-DENABLE_PYTHON3=1} \
187 %{?with_ruby_binding:-DENABLE_RUBY=1} \
188 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
191 make %{?jobs:-j %jobs}
194 make DESTDIR=$RPM_BUILD_ROOT install
195 %if 0%{?suse_version}
196 %if %{with python_binding}
197 pushd $RPM_BUILD_ROOT/%{python_sitearch}
198 python %py_libdir/py_compile.py *.py
199 python -O %py_libdir/py_compile.py *.py
202 %if %{with python3_binding}
203 %py3_compile $RPM_BUILD_ROOT/%{python3_sitearch}
206 %if %{with disable_shared}
207 # we want to leave the .a file untouched
208 export NO_BRP_STRIP_DEBUG=true
212 rm -rf "$RPM_BUILD_ROOT"
214 %if !%{with disable_shared}
215 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
217 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
219 %files -n libsolv@LIBSOLV_SOVERSION@
220 %defattr(-,root,root)
222 %{_libdir}/libsolv.so.*
223 %{_libdir}/libsolvext.so.*
227 %defattr(-,root,root)
228 %if 0%{?suse_version}
229 %exclude %{_bindir}/helix2solv
230 %exclude %{_mandir}/man1/helix2solv*
232 %exclude %{_bindir}/solv
237 %defattr(-,root,root)
238 %if %{with enable_static}
240 %{_libdir}/libsolvext.a
242 %if !%{with disable_shared}
243 %{_libdir}/libsolv.so
244 %{_libdir}/libsolvext.so
247 %if 0%{?suse_version}
248 %{_bindir}/helix2solv
249 %{_mandir}/man1/helix2solv*
251 %{_datadir}/cmake/Modules/*
252 %{_libdir}/pkgconfig/libsolv*.pc
256 %defattr(-,root,root)
259 %if %{with perl_binding}
261 %defattr(-,root,root)
265 %if %{with ruby_binding}
267 %defattr(-,root,root)
271 %if %{with python_binding}
272 %files -n python-solv
273 %defattr(-,root,root)
277 %if %{with python3_binding}
278 %files -n python3-solv
279 %defattr(-,root,root)
280 %{python3_sitearch}/*solv*
281 %if 0%{?suse_version}
282 %{python3_sitearch}/*/*solv*