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
32 %if 0%{?mandriva_version}
33 # force this version on mandriva
34 BuildRequires: libneon0.26-devel
36 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
37 BuildRequires: db4-devel
40 %if 0%{?suse_version} < 1030
43 BuildRequires: libexpat-devel
45 %if 0%{?suse_version} < 1100
46 BuildRequires: graphviz
48 %if 0%{?suse_version} > 1020
52 BuildRequires: expat-devel
55 BuildRequires: gcc-c++
56 BuildRequires: rpm-devel
57 BuildRequires: zlib-devel
59 %if %{with perl_binding}
61 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
62 BuildRequires: perl-devel
66 %if %{with ruby_binding}
67 %global ruby_vendorarch %(ruby -r rbconfig -e "puts Config::CONFIG['vendorarchdir'].nil? ? Config::CONFIG['sitearchdir'] : Config::CONFIG['vendorarchdir']")
69 BuildRequires: ruby-devel
72 %if %{with python_binding}
73 %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True);")
74 BuildRequires: python-devel
78 Summary: A new approach to package dependency solving
80 Group: Development/Libraries/C and C++
83 A new approach to package dependency solving
85 %if !%{with disable_shared}
86 %package -n libsolv@LIBSOLV_SOVERSION@
87 Summary: A new approach to package dependency solving
88 Group: Development/Libraries/C and C++
90 %description -n libsolv@LIBSOLV_SOVERSION@
91 A new approach to package dependency solving
95 Summary: A new approach to package dependency solving
96 Group: Development/Libraries/C and C++
97 Requires: libsolv-tools = %version
98 %if !%{with disable_shared}
99 Requires: libsolv@LIBSOLV_SOVERSION@ = %version
102 Conflicts: libsatsolver-devel
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 Conflicts: satsolver-tools-obsolete
113 Requires: gzip bzip2 coreutils findutils
116 A new approach to package dependency solving.
119 Summary: Applications demoing the libsolv library
120 Group: System/Management
122 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
125 %if 0%{?suse_version}
128 Conflicts: libsatsolver-demo
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} && %{with python_binding}
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"
169 %if 0%{?suse_version}
170 CMAKE_FLAGS="-DSUSE=1"
174 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
176 -DCMAKE_VERBOSE_MAKEFILE=TRUE \
177 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
178 %{?with_enable_static:-DENABLE_STATIC=1} \
179 %{?with_disable_shared:-DDISABLE_SHARED=1} \
180 %{?with_perl_binding:-DENABLE_PERL=1} \
181 %{?with_python_binding:-DENABLE_PYTHON=1} \
182 %{?with_ruby_binding:-DENABLE_RUBY=1} \
183 %{?with_zypp:-DENABLE_SUSEREPO=1 -DENABLE_HELIXREPO=1} \
186 make %{?jobs:-j %jobs}
189 make DESTDIR=$RPM_BUILD_ROOT install
190 %if %{with python_binding}
191 %if 0%{?suse_version}
192 pushd $RPM_BUILD_ROOT/%{python_sitearch}
193 python %py_libdir/py_compile.py *.py
194 python -O %py_libdir/py_compile.py *.py
198 %if %{with disable_shared}
199 # we want to leave the .a file untouched
200 export NO_BRP_STRIP_DEBUG=true
204 rm -rf "$RPM_BUILD_ROOT"
206 %if !%{with disable_shared}
207 %post -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
209 %postun -n libsolv@LIBSOLV_SOVERSION@ -p /sbin/ldconfig
211 %files -n libsolv@LIBSOLV_SOVERSION@
212 %defattr(-,root,root)
214 %{_libdir}/libsolv.so.*
215 %{_libdir}/libsolvext.so.*
219 %defattr(-,root,root)
220 %if 0%{?suse_version}
221 %exclude %{_bindir}/helix2solv
223 %exclude %{_bindir}/solv
227 %defattr(-,root,root)
228 %if %{with enable_static}
230 %{_libdir}/libsolvext.a
232 %if !%{with disable_shared}
233 %{_libdir}/libsolv.so
234 %{_libdir}/libsolvext.so
237 %if 0%{?suse_version}
238 %{_bindir}/helix2solv
240 %{_datadir}/cmake/Modules/*
244 %defattr(-,root,root)
247 %if %{with perl_binding}
249 %defattr(-,root,root)
253 %if %{with ruby_binding}
255 %defattr(-,root,root)
259 %if %{with python_binding}
260 %files -n python-solv
261 %defattr(-,root,root)