From: Michael Schroeder Date: Thu, 14 Jul 2011 10:28:47 +0000 (+0200) Subject: - build binding subpackages X-Git-Tag: BASE-SuSE-Code-12_1-Branch~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb91a45776f6efef02083a58c7a335fef82fa328;p=thirdparty%2Flibsolv.git - build binding subpackages --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1afd2eb0..c2d9fb9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,14 @@ PROJECT (libsolv) 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) diff --git a/package/libsolv.spec.in b/package/libsolv.spec.in index 610f17d5..decffc28 100644 --- a/package/libsolv.spec.in +++ b/package/libsolv.spec.in @@ -8,13 +8,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build 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 @@ -33,6 +36,18 @@ BuildRequires: expat-devel %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 @@ -103,6 +118,29 @@ Requires: gpg2 %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} @@ -120,6 +158,10 @@ cmake $CMAKE_FLAGS \ -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} @@ -154,4 +196,23 @@ rm -rf "$RPM_BUILD_ROOT" %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