2 # spec file for package libsolv
4 # Copyright (c) 2011 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/
22 Url: git://gitorious.org/opensuse/libsolv.git
23 Source: libsolv-%{version}.tar.bz2
24 BuildRoot: %{_tmppath}/%{name}-%{version}-build
25 Group: Development/Libraries/C and C++
27 %bcond_without enable_static
28 %bcond_without disable_shared
29 %bcond_without perl_binding
30 %bcond_without python_binding
31 %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: db4-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
55 BuildRequires: cmake rpm-devel gcc-c++
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 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
67 %global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')
69 %global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"]')
71 BuildRequires: ruby ruby-devel
74 %if %{with python_binding}
75 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
76 BuildRequires: python-devel
80 Summary: A new approach to package dependency solving
84 A new approach to package dependency solving
86 %if !%{with disable_shared}
87 %package -n libsolv@LIBSOLV_SOVERSION@
88 Summary: A new approach to package dependency solving
89 Group: Development/Libraries/C and C++
91 %description -n libsolv@LIBSOLV_SOVERSION@
92 A new approach to package dependency solving
96 Summary: A new approach to package dependency solving
97 Group: Development/Libraries/C and C++
98 Requires: libsolv-tools = %version
99 %if !%{with disable_shared}
100 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
105 Development files for libsolv, a new approach to package dependency solving
108 Summary: A new approach to package dependency solving
109 Group: Development/Libraries/C and C++
110 Obsoletes: satsolver-tools < 0.18
111 Provides: satsolver-tools = 0.18
112 Requires: gzip bzip2 coreutils
115 A new approach to package dependency solving.
118 Summary: Applications demoing the libsolv library
119 Group: System/Management
121 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
124 %if 0%{?suse_version}
129 Applications demoing the libsolv library.
131 %package -n ruby-solv
132 Summary: Ruby bindings for the libsolv library
133 Group: Development/Languages/Ruby
135 %description -n ruby-solv
136 Ruby bindings for sat solver.
138 %package -n python-solv
139 %if 0%{?py_requires:1}
142 Summary: Python bindings for the libsolv library
143 Group: Development/Languages/Python
145 %description -n python-solv
146 Python bindings for sat solver.
148 %package -n perl-solv
149 Requires: perl = %{perl_version}
150 Summary: Perl bindings for the libsolv library
151 Group: Development/Languages/Perl
153 %description -n perl-solv
154 Perl bindings for sat solver.
157 %setup -n libsolv-%{version}
160 export CFLAGS="$RPM_OPT_FLAGS"
161 export CXXFLAGS="$CFLAGS"
164 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
165 CMAKE_FLAGS="-DFEDORA=1"
169 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
171 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
172 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
173 %{?with_enable_static:-DENABLE_STATIC=1} \
174 %{?with_disable_shared:-DDISABLE_SHARED=1} \
175 %{?with_perl_binding:-DENABLE_PERL=1} \
176 %{?with_python_binding:-DENABLE_PYTHON=1} \
177 %{?with_ruby_binding:-DENABLE_RUBY=1} \
180 make %{?jobs:-j %jobs}
183 make DESTDIR=$RPM_BUILD_ROOT install
184 %if %{with python_binding}
185 %if 0%{?suse_version}
186 pushd $RPM_BUILD_ROOT/%{python_sitearch}
187 python %py_libdir/py_compile.py *.py
188 python -O %py_libdir/py_compile.py *.py
192 # we want to leave the .a file untouched
193 export NO_BRP_STRIP_DEBUG=true
196 rm -rf "$RPM_BUILD_ROOT"
198 %if !%{with disable_shared}
199 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
201 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
203 %files -n libsolv@LIBSOLV_SOVERSION@
204 %defattr(-,root,root)
206 %{_libdir}/libsolv.so.*
207 %{_libdir}/libsolvext.so.*
211 %defattr(-,root,root)
212 %exclude %{_bindir}/helix2solv
213 %exclude %{_bindir}/solv
217 %defattr(-,root,root)
218 %if %{with enable_static}
220 %{_libdir}/libsolvext.a
222 %if !%{with disable_shared}
223 %{_libdir}/libsolv.so
224 %{_libdir}/libsolvext.so
227 %{_bindir}/helix2solv
228 %{_datadir}/cmake/Modules/*
231 %defattr(-,root,root)
234 %if %{with perl_binding}
236 %defattr(-,root,root)
240 %if %{with ruby_binding}
242 %defattr(-,root,root)
246 %if %{with python_binding}
247 %files -n python-solv
248 %defattr(-,root,root)