File perl-BSSolv.spec of Package perl-BSSolv

# spec file for package perl-BSSolv
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           perl-BSSolv
Version:        0.18.2
Release:        0
Source:         libsolv-0.1.0.tar.bz2
Source1:        Makefile.PL
Source3:        BSSolv.xs
Source4:        typemap
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%if 0%{?mandriva_version}
# force this version on mandriva
BuildRequires:  libneon0.26-devel
%if 0%{?fedora_version}
BuildRequires:  db4-devel
BuildRequires:  perl-devel
%if 0%{?suse_version}
Requires:       perl = %perl_version
%if 0%{?suse_version} < 1030
BuildRequires:  expat
BuildRequires:  libexpat-devel
BuildRequires:  expat-devel
%if 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  db4-devel
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  perl
BuildRequires:  rpm-devel
BuildRequires:  zlib-devel
BuildRequires:  xz-devel
#RHEL6 moved ExtUtils::MakeMaker outside the main perl package
BuildRequires:  perl(ExtUtils::MakeMaker)
# the testsuite uses the check framework
BuildRequires:  check-devel
Summary:        A new approach to package dependency solving
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
# probably needed for rhel/centos on x86_64
%if 0%{!?perl_vendorarch}
%define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)

Using a Satisfyability Solver to compute package dependencies.

%setup -c
ln -s libsolv-* libsolv
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .
pushd libsolv


%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}

%if 0%{?rhel_version} || 0%{?centos_version}

pushd libsolv
cmake   $CMAKE_FLAGS \
pushd src ; make ; popd
pushd ext ; make ; popd
perl Makefile.PL

make DESTDIR=$RPM_BUILD_ROOT install_vendor
%if 0%{?suse_version}  
find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} \;  
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;  
find $RPM_BUILD_ROOT -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'  
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;  
%{_fixperms} $RPM_BUILD_ROOT/*  


%if 0%{?suse_version}
%if 0%{?suse_version} < 1140