File bzr.spec of Package bzr

#
# spec file for package bzr
#
# 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 http://bugs.opensuse.org/
#


Name:           bzr
Version:        2.5.1
Release:        0
Summary:        Friendly distributed version control system
License:        GPL-2.0
Group:          Development/Tools/Version Control
Url:            http://bazaar.canonical.com/
Source:         https://launchpad.net/bzr/2.5/2.5.1/+download/bzr-2.5.1.tar.gz
BuildRequires:  fdupes
BuildRequires:  python-Cython
BuildRequires:  python-devel
# Testsuite requirements:
# For httplib.HTTPSConnection SSL:
#BuildRequires:  python
#BuildRequires:  python-testtools
#BuildRequires:  python-xml
Requires:       python-xml
Recommends:     %{name}-lang = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif

%description
Bazaar is a distributed version control system designed to be easy to
use and intuitive, able to adapt to many workflows, reliable, and
easily extendable.

%package test
Summary:        Friendly distributed version control system - Testsuite
Group:          Development/Tools/Version Control
Requires:       %{name} = %{version}

%description test
This package contains testsuite files for %{name}.

%lang_package

%prep
%setup -q
sed -i "s|\"share/locale\"|\"locale\"|" setup.py # Fix the locale installation path

%build
CFLAGS="%{optflags}" python setup.py build
# TODO: generate documentation:
#make docs

%install
python setup.py install --root %{buildroot} --prefix %{_prefix} --install-data %{_datadir}

# Install bash completion
install -D -m 0644 contrib/bash/bzr %{buildroot}%{_sysconfdir}/bash_completion.d/bzr
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
rm -r %{buildroot}%{_prefix}/share/locale/sco
%endif

%find_lang %{name}

# TODO: Disable for now, takes ages:
#%%check
#python bzr selftest 

%files
%defattr(-,root,root,-)
%doc COPYING.txt NEWS* README
%{_bindir}/bzr
%{python_sitearch}/bzrlib
%{python_sitearch}/bzr-%{version}-*.egg-info
%exclude %{python_sitearch}/bzrlib/tests
%{_mandir}/man1/%{name}.*
%{_sysconfdir}/bash_completion.d/%{name}

%files lang -f %{name}.lang
%defattr(-,root,root,-)

%files test
%defattr(-,root,root,-)
%{python_sitearch}/bzrlib/tests

%changelog
openSUSE Build Service is sponsored by