File bzr.spec of Package bzr

#
# spec file for package bzr (Version 2.0.5)
#
# Copyright (c) 2010 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/
#

# norootforbuild


Name:           bzr
Version:        2.0.5
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-vcs.org/
Source:         http://bazaar-vcs.org/releases/src/bzr-%{version}.tar.bz2
Summary:        Friendly distributed version control system

%description
Bazaar-NG is a distributed revision control system that is powerful,
friendly,and scalable. It is the successor of the bazaar RCS which, in
turn, was a user-friendly reimplementation of GNU Arch.

Authors:
--------
    Martin Pool <mbp@canonical.com>
    Robert Collins <robert.collins@canonical.com>

%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

%clean
%{__rm} -rf %{buildroot}

%files -f %{name}.files
%defattr(-,root,root,-)
%{_docdir}/%{name}
%doc %{_mandir}/man1/%{name}.*
%{_sysconfdir}/bash_completion.d/%{name}

%changelog
openSUSE Build Service is sponsored by