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 %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"]')
72 BuildRequires: ruby-devel
75 %if %{with python_binding}
76 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
77 BuildRequires: python-devel
81 Summary: A new approach to package dependency solving
83 Group: Development/Libraries/C and C++
86 A new approach to package dependency solving
88 %if !%{with disable_shared}
89 %package -n libsolv@LIBSOLV_SOVERSION@
90 Summary: A new approach to package dependency solving
91 Group: Development/Libraries/C and C++
93 %description -n libsolv@LIBSOLV_SOVERSION@
94 A new approach to package dependency solving
98 Summary: A new approach to package dependency solving
99 Group: Development/Libraries/C and C++
100 Requires: libsolv-tools = %version
101 %if !%{with disable_shared}
102 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
107 Development files for libsolv, a new approach to package dependency solving
110 Summary: A new approach to package dependency solving
111 Group: Development/Libraries/C and C++
112 Obsoletes: satsolver-tools < 0.18
113 Provides: satsolver-tools = 0.18
114 Requires: gzip bzip2 coreutils findutils
117 A new approach to package dependency solving.
120 Summary: Applications demoing the libsolv library
121 Group: System/Management
123 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
126 %if 0%{?suse_version}
131 Applications demoing the libsolv library.
133 %package -n ruby-solv
134 Summary: Ruby bindings for the libsolv library
135 Group: Development/Languages/Ruby
137 %description -n ruby-solv
138 Ruby bindings for sat solver.
140 %package -n python-solv
141 %if 0%{?py_requires:1}
144 Summary: Python bindings for the libsolv library
145 Group: Development/Languages/Python
147 %description -n python-solv
148 Python bindings for sat solver.
150 %package -n perl-solv
151 Requires: perl = %{perl_version}
152 Summary: Perl bindings for the libsolv library
153 Group: Development/Languages/Perl
155 %description -n perl-solv
156 Perl bindings for sat solver.
159 %setup -n libsolv-%{version}
162 export CFLAGS="$RPM_OPT_FLAGS"
163 export CXXFLAGS="$CFLAGS"
166 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
167 CMAKE_FLAGS="-DFEDORA=1"
171 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
173 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
174 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
175 %{?with_enable_static:-DENABLE_STATIC=1} \
176 %{?with_disable_shared:-DDISABLE_SHARED=1} \
177 %{?with_perl_binding:-DENABLE_PERL=1} \
178 %{?with_python_binding:-DENABLE_PYTHON=1} \
179 %{?with_ruby_binding:-DENABLE_RUBY=1} \
182 make %{?jobs:-j %jobs}
185 make DESTDIR=$RPM_BUILD_ROOT install
186 %if %{with python_binding}
187 %if 0%{?suse_version}
188 pushd $RPM_BUILD_ROOT/%{python_sitearch}
189 python %py_libdir/py_compile.py *.py
190 python -O %py_libdir/py_compile.py *.py
194 # we want to leave the .a file untouched
195 export NO_BRP_STRIP_DEBUG=true
198 rm -rf "$RPM_BUILD_ROOT"
200 %if !%{with disable_shared}
201 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
203 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
205 %files -n libsolv@LIBSOLV_SOVERSION@
206 %defattr(-,root,root)
208 %{_libdir}/libsolv.so.*
209 %{_libdir}/libsolvext.so.*
213 %defattr(-,root,root)
214 %exclude %{_bindir}/helix2solv
215 %exclude %{_bindir}/solv
219 %defattr(-,root,root)
220 %if %{with enable_static}
222 %{_libdir}/libsolvext.a
224 %if !%{with disable_shared}
225 %{_libdir}/libsolv.so
226 %{_libdir}/libsolvext.so
229 %{_bindir}/helix2solv
230 %{_datadir}/cmake/Modules/*
233 %defattr(-,root,root)
236 %if %{with perl_binding}
238 %defattr(-,root,root)
242 %if %{with ruby_binding}
244 %defattr(-,root,root)
248 %if %{with python_binding}
249 %files -n python-solv
250 %defattr(-,root,root)