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: git://gitorious.org/opensuse/libsolv.git
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 ruby_binding
31 %if 0%{?mandriva_version}
32 # force this version on mandriva
33 BuildRequires: libneon0.26-devel
35 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
36 BuildRequires: db4-devel
39 %if 0%{?suse_version} < 1030
42 BuildRequires: libexpat-devel
44 %if 0%{?suse_version} < 1100
45 BuildRequires: graphviz
47 %if 0%{?suse_version} > 1020
51 BuildRequires: expat-devel
54 BuildRequires: gcc-c++
55 BuildRequires: rpm-devel
56 BuildRequires: zlib-devel
58 %if %{with perl_binding}
60 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
61 BuildRequires: perl-devel
65 %if %{with ruby_binding}
66 %global ruby_vendorarch %(ruby -r rbconfig -e "puts Config::CONFIG['vendorarchdir'].nil? ? Config::CONFIG['sitearchdir'] : Config::CONFIG['vendorarchdir']")
68 BuildRequires: ruby-devel
71 %if %{with python_binding}
72 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
73 BuildRequires: python-devel
77 Summary: A new approach to package dependency solving
79 Group: Development/Libraries/C and C++
82 A new approach to package dependency solving
84 %if !%{with disable_shared}
85 %package -n libsolv@LIBSOLV_SOVERSION@
86 Summary: A new approach to package dependency solving
87 Group: Development/Libraries/C and C++
89 %description -n libsolv@LIBSOLV_SOVERSION@
90 A new approach to package dependency solving
94 Summary: A new approach to package dependency solving
95 Group: Development/Libraries/C and C++
96 Requires: libsolv-tools = %version
97 %if !%{with disable_shared}
98 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
103 Development files for libsolv, a new approach to package dependency solving
106 Summary: A new approach to package dependency solving
107 Group: Development/Libraries/C and C++
108 Obsoletes: satsolver-tools < 0.18
109 Provides: satsolver-tools = 0.18
110 Requires: gzip bzip2 coreutils findutils
113 A new approach to package dependency solving.
116 Summary: Applications demoing the libsolv library
117 Group: System/Management
119 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
122 %if 0%{?suse_version}
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}
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 perl-solv
147 Requires: perl = %{perl_version}
148 Summary: Perl bindings for the libsolv library
149 Group: Development/Languages/Perl
151 %description -n perl-solv
152 Perl bindings for sat solver.
155 %setup -n libsolv-%{version}
158 export CFLAGS="$RPM_OPT_FLAGS"
159 export CXXFLAGS="$CFLAGS"
162 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
163 CMAKE_FLAGS="-DFEDORA=1"
165 %if 0%{?suse_version}
166 CMAKE_FLAGS="-DSUSE=1"
170 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
172 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
173 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
174 %{?with_enable_static:-DENABLE_STATIC=1} \
175 %{?with_disable_shared:-DDISABLE_SHARED=1} \
176 %{?with_perl_binding:-DENABLE_PERL=1} \
177 %{?with_python_binding:-DENABLE_PYTHON=1} \
178 %{?with_ruby_binding:-DENABLE_RUBY=1} \
181 make %{?jobs:-j %jobs}
184 make DESTDIR=$RPM_BUILD_ROOT install
185 %if %{with python_binding}
186 %if 0%{?suse_version}
187 pushd $RPM_BUILD_ROOT/%{python_sitearch}
188 python %py_libdir/py_compile.py *.py
189 python -O %py_libdir/py_compile.py *.py
193 # we want to leave the .a file untouched
194 export NO_BRP_STRIP_DEBUG=true
197 rm -rf "$RPM_BUILD_ROOT"
199 %if !%{with disable_shared}
200 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
202 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
204 %files -n libsolv@LIBSOLV_SOVERSION@
205 %defattr(-,root,root)
207 %{_libdir}/libsolv.so.*
208 %{_libdir}/libsolvext.so.*
212 %defattr(-,root,root)
213 %if 0%{?suse_version}
214 %exclude %{_bindir}/helix2solv
216 %exclude %{_bindir}/solv
220 %defattr(-,root,root)
221 %if %{with enable_static}
223 %{_libdir}/libsolvext.a
225 %if !%{with disable_shared}
226 %{_libdir}/libsolv.so
227 %{_libdir}/libsolvext.so
230 %if 0%{?suse_version}
231 %{_bindir}/helix2solv
233 %{_datadir}/cmake/Modules/*
236 %defattr(-,root,root)
239 %if %{with perl_binding}
241 %defattr(-,root,root)
245 %if %{with ruby_binding}
247 %defattr(-,root,root)
251 %if %{with python_binding}
252 %files -n python-solv
253 %defattr(-,root,root)