CMAKE_MINIMUM_REQUIRED (VERSION 2.4)
-OPTION(ENABLE_STATIC "Build a static version of the libraries?" OFF)
-OPTION(DISABLE_SHARED "Do not build a shared version of the libraries?" OFF)
+OPTION (ENABLE_STATIC "Build a static version of the libraries?" OFF)
+OPTION (DISABLE_SHARED "Do not build a shared version of the libraries?" OFF)
-OPTION(ENABLE_PERL "Build the perl bindings?" OFF)
-OPTION(ENABLE_PYTHON "Build the python bindings?" OFF)
-OPTION(ENABLE_RUBY "Build the ruby bindings?" OFF)
+OPTION (ENABLE_PERL "Build the perl bindings?" OFF)
+OPTION (ENABLE_PYTHON "Build the python bindings?" OFF)
+OPTION (ENABLE_RUBY "Build the ruby bindings?" OFF)
+
+OPTION (USE_VENDORDIRS "Install the bindings in vendor directories?" OFF)
#IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
#ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERISION} GREATER 2.4)
Group: Development/Libraries/C and C++
Prefix: /usr
-BuildRequires: doxygen
+%bcond_without perl_binding
+%bcond_without python_binding
+%bcond_without ruby_binding
+
%if 0%{?mandriva_version}
# force this version on mandriva
BuildRequires: libneon0.26-devel
%endif
%if 0%{?fedora_version}
-BuildRequires: db4-devel ruby ruby-rdoc
+BuildRequires: db4-devel
%endif
%if 0%{?suse_version}
%if 0%{?suse_version} < 1030
%endif
BuildRequires: cmake rpm-devel gcc-c++
BuildRequires: zlib-devel
+
+%if %{with perl_binding}
+BuildRequires: perl
+%endif
+%if %{with ruby_binding}
+%global ruby_vendorarch %(ruby -rrbconfig -e 'puts Config::CONFIG["vendorarchdir"] ')}
+BuildRequires: ruby-devel
+%endif
+%if %{with python_binding}
+BuildRequires: python-devel
+%endif
+
Summary: A new approach to package dependency solving
%description demo
Applications demoing the libsolv library.
+%package -n ruby-solv
+Summary: Ruby bindings for the libsolv library
+Group: Development/Languages/Ruby
+
+%description -n ruby-solv
+Ruby bindings for sat solver.
+
+%package -n python-solv
+%py_requires
+Summary: Python bindings for the libsolv library
+Group: Development/Languages/Python
+
+%description -n python-solv
+Python bindings for sat solver.
+
+%package -n perl-solv
+Requires: perl = %{perl_version}
+Summary: Perl bindings for the libsolv library
+Group: Development/Languages/Perl
+
+%description -n perl-solv
+Perl bindings for sat solver.
+
%prep
%setup -n libsolv-%{version}
-DLIB=%{_lib} \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCMAKE_BUILD_TYPE=Release \
+ %{?with_perl_binding:-DENABLE_PERL=1} \
+ %{?with_python_binding:-DENABLE_PYTHON=1} \
+ %{?with_ruby_binding:-DENABLE_RUBYL=1} \
+ -DUSE_VENDORDIRS=1 \
-DCMAKE_SKIP_RPATH=1
make %{?jobs:-j %jobs}
%defattr(-,root,root)
/usr/bin/solv
+%if %{with perl_binding}
+%files -n perl-solv
+%defattr(-,root,root)
+%{perl_vendorarch}/*
+%endif
+
+%if %{with ruby_binding}
+%files -n ruby-solv
+%defattr(-,root,root)
+%{ruby_vendorarch}/*
+%endif
+
+%if %{with python_binding}
+%files -n python-solv
+%{ruby_vendorarch}/*
+%defattr(-,root,root)
+%{py_sitedir}/*
+%endif
+
%changelog