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
41 %if 0%{?suse_version} < 1030
44 BuildRequires: libexpat-devel
46 %if 0%{?suse_version} < 1100
47 BuildRequires: graphviz
49 %if 0%{?suse_version} > 1020
53 BuildRequires: expat-devel
56 BuildRequires: gcc-c++
57 BuildRequires: rpm-devel
58 BuildRequires: zlib-devel
60 %if %{with perl_binding}
62 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
63 BuildRequires: perl-devel
67 %if %{with ruby_binding}
68 %global ruby_vendorarch %(ruby -r rbconfig -e "puts RbConfig::CONFIG['vendorarchdir'].nil? ? RbConfig::CONFIG['sitearchdir'] : RbConfig::CONFIG['vendorarchdir']")
70 BuildRequires: ruby-devel
73 %if %{with python_binding}
74 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
75 BuildRequires: python-devel
78 %if %{with python3_binding}
79 %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))")
80 BuildRequires: python3-devel
83 Summary: A new approach to package dependency solving
85 Group: Development/Libraries/C and C++
88 A new approach to package dependency solving
90 %if !%{with disable_shared}
91 %package -n libsolv@LIBSOLV_SOVERSION@
92 Summary: A new approach to package dependency solving
93 Group: Development/Libraries/C and C++
95 %description -n libsolv@LIBSOLV_SOVERSION@
96 A new approach to package dependency solving
100 Summary: A new approach to package dependency solving
101 Group: Development/Libraries/C and C++
102 %if !%{with disable_shared}
103 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
106 Conflicts: libsatsolver-devel
109 Development files for libsolv, a new approach to package dependency solving
112 Summary: A new approach to package dependency solving
113 Group: Development/Libraries/C and C++
114 Obsoletes: satsolver-tools < 0.18
115 Provides: satsolver-tools = 0.18
116 Conflicts: satsolver-tools-obsolete
117 Requires: gzip bzip2 coreutils findutils
120 A new approach to package dependency solving.
123 Summary: Applications demoing the libsolv library
124 Group: System/Management
126 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
129 %if 0%{?suse_version}
132 Conflicts: libsatsolver-demo
135 Applications demoing the libsolv library.
137 %package -n ruby-solv
138 Summary: Ruby bindings for the libsolv library
139 Group: Development/Languages/Ruby
141 %description -n ruby-solv
142 Ruby bindings for sat solver.
144 %package -n python-solv
145 %if 0%{?py_requires:1} && %{with python_binding}
148 Summary: Python bindings for the libsolv library
149 Group: Development/Languages/Python
151 %description -n python-solv
152 Python bindings for sat solver.
154 %package -n python3-solv
155 Summary: Python3 bindings for the libsolv library
156 Group: Development/Languages/Python
158 %description -n python3-solv
159 Python3 bindings for sat solver.
161 %package -n perl-solv
162 Requires: perl = %{perl_version}
163 Summary: Perl bindings for the libsolv library
164 Group: Development/Languages/Perl
166 %description -n perl-solv
167 Perl bindings for sat solver.
170 %setup -n libsolv-%{version}
173 export CFLAGS="$RPM_OPT_FLAGS"
174 export CXXFLAGS="$CFLAGS"
177 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
178 CMAKE_FLAGS="-DFEDORA=1"
180 %if 0%{?suse_version}
181 CMAKE_FLAGS="-DSUSE=1 -DENABLE_APPDATA=1 -DENABLE_COMPS=1"
185 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
187 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
188 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
189 %{?with_enable_static:-DENABLE_STATIC=1} \
190 %{?with_disable_shared:-DDISABLE_SHARED=1} \
191 %{?with_perl_binding:-DENABLE_PERL=1} \
192 %{?with_python_binding:-DENABLE_PYTHON=1} \
193 %{?with_python3_binding:-DENABLE_PYTHON3=1} \
194 %{?with_ruby_binding:-DENABLE_RUBY=1} \
195 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
198 make %{?jobs:-j %jobs}
201 make DESTDIR=$RPM_BUILD_ROOT install
202 %if 0%{?suse_version}
203 %if %{with python_binding}
204 pushd $RPM_BUILD_ROOT/%{python_sitearch}
205 python %py_libdir/py_compile.py *.py
206 python -O %py_libdir/py_compile.py *.py
209 %if %{with python3_binding}
210 %py3_compile $RPM_BUILD_ROOT/%{python3_sitearch}
213 %if %{with disable_shared}
214 # we want to leave the .a file untouched
215 export NO_BRP_STRIP_DEBUG=true
219 rm -rf "$RPM_BUILD_ROOT"
221 %if !%{with disable_shared}
222 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
224 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
226 %files -n libsolv@LIBSOLV_SOVERSION@
227 %defattr(-,root,root)
229 %{_libdir}/libsolv.so.*
230 %{_libdir}/libsolvext.so.*
234 %defattr(-,root,root)
235 %if 0%{?suse_version}
236 %exclude %{_bindir}/helix2solv
237 %exclude %{_mandir}/man1/helix2solv*
239 %exclude %{_bindir}/solv
244 %defattr(-,root,root)
245 %if %{with enable_static}
247 %{_libdir}/libsolvext.a
249 %if !%{with disable_shared}
250 %{_libdir}/libsolv.so
251 %{_libdir}/libsolvext.so
254 %if 0%{?suse_version}
255 %{_bindir}/helix2solv
256 %{_mandir}/man1/helix2solv*
258 %{_datadir}/cmake/Modules/*
259 %{_libdir}/pkgconfig/libsolv.pc
263 %defattr(-,root,root)
266 %if %{with perl_binding}
268 %defattr(-,root,root)
272 %if %{with ruby_binding}
274 %defattr(-,root,root)
278 %if %{with python_binding}
279 %files -n python-solv
280 %defattr(-,root,root)
284 %if %{with python3_binding}
285 %files -n python3-solv
286 %defattr(-,root,root)
287 %{python3_sitearch}/*solv*
288 %if 0%{?suse_version}
289 %{python3_sitearch}/*/*solv*