File bzr.spec of Package bzr
#
# spec file for package bzr
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright 2011 Canonical Ltd
#
# 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.4.1
Release: 1
License: GNU General Public License (GPL)
Group: Development/Tools/Version Control
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel zlib-devel
%if 0%{?suse_version} < 1030
BuildRequires: python-elementtree
Requires: python-elementtree
%endif
%if 0%{?suse_version} > 1020
BuildRequires: fdupes
%endif
%{py_requires}
Url: http://bazaar.canonical.com/
Source: http://launchpad.net/bzr/2.4/%{version}/+download/bzr-%{version}.tar.gz
Summary: Friendly distributed version control system
%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.
%prep
%setup -q
# Make rpmlint happy by removing the shebangs
%{__sed} -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/patiencediff.py
%{__sed} -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/_patiencediff_py.py
%{__sed} -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/tests/ssl_certs/create_ssls.py
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
%{__python} setup.py install --root %{buildroot} --prefix %{_prefix} --record-rpm %{name}.files --install-data %{_datadir}
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/
install -m 0644 contrib/bash/%{name} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/
rm contrib/bash/bzr
# Remove man page and directories from file list
%{__perl} -pi -e 's|%{_mandir}.*\n||g' %{name}.files
%{__mkdir} -p %{buildroot}/%{_defaultdocdir}/%{name}
%{__install} -m 644 -t %{buildroot}/%{_docdir}/%{name} *TODO COPYING.txt INSTALL NEWS* README *.ico
%{__cp} -av doc/* contrib %{buildroot}/%{_docdir}/%{name}
# Hardlink redundant docs
%if 0%{?suse_version} > 1020
%fdupes %{buildroot}/%{_docdir}/%{name}
%fdupes %{buildroot}/%{py_sitedir}
%endif
%files -f %{name}.files
%defattr(-,root,root,-)
%{_docdir}/%{name}
%doc %{_mandir}/man1/%{name}.*
%{_sysconfdir}/bash_completion.d/%{name}
%changelog