+# TODO: python3 when supported upstream (currently it uses cobjects, whith don't exist in python 3.2+)
+
Summary: Bazaar - a distributed revision control system
Summary(pl.UTF-8): Bazaar - rozproszony system kontroli wersji
Name: bzr
-Version: 2.1.0
+Version: 2.7.0
Release: 1
-License: GPL v2
+License: GPL v2+
Group: Development/Version Control
-Source0: http://launchpad.net/bzr/2.1/%{version}/+download/%{name}-%{version}.tar.gz
-# Source0-md5: ea184d6cfb22cf4e92ee275f593ca88d
+#Source0Download: https://launchpad.net/bzr/+download
+Source0: https://launchpad.net/bzr/2.7/%{version}/+download/%{name}-%{version}.tar.gz
+# Source0-md5: 8e5020502efd54f5925a14a456b88b89
+Patch0: locale-path.patch
+Patch1: ca-certificates.patch
URL: http://bazaar.canonical.com/
-BuildRequires: python >= 1:2.4
+BuildRequires: python >= 1:2.6
+BuildRequires: python-devel >= 1:2.6
+BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.219
-%pyrequires_eq python
-# pdb module required by bzr
-Requires: python-cElementTree
-Requires: python-devel-tools
-Requires: python-paramiko
-Requires: python-pycurl
-Obsoletes: bazaar
+BuildRequires: rpmbuild(macros) >= 1.714
+BuildRequires: zlib-devel
+Requires: python >= 1:2.6
+Requires: python-bzr = %{version}-%{release}
+Obsoletes: bazaar < 1.5
+Conflicts: qbzr < 0.22
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
systemów kontroli wersji, GUI są dostępne poprzez dodatkowe pakiety
rozszerzeń.
+%package -n python-bzr
+Summary: Bazaar library for Python 2
+Summary(pl.UTF-8): Biblioteka Bazaar dla Pythona 2
+Group: Libraries/Python
+# pdb module required by bzr
+Requires: python-devel-tools >= 1:2.6
+Requires: python-paramiko
+Requires: python-pycurl
+
+%description -n python-bzr
+Bazaar is a friendly distributed version control system.
+
+This package contains Python 2 library.
+
+%description -n python-bzr -l pl.UTF-8
+Bazaar to przyjazny, rozproszony system kontroli wersji.
+
+Ten pakiet zawiera bibliotekę Pythona 2.
+
+%package -n bash-completion-%{name}
+Summary: bash-completion for bzr
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: bash-completion
+BuildArch: noarch
+
+%description -n bash-completion-%{name}
+This package provides bash-completion for bzr.
+
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
+
+# move out of contrib, as we package contrib as doc
+%{__mv} contrib/bash/bzr bash_completion.sh
%build
-%{__python} setup.py build
+%py_build
+
+%if 0
+%py3_build
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
- --optimize=2 \
- --install-data %{_datadir} \
- --root=$RPM_BUILD_ROOT
+%if 0
+%py3_install \
+ --install-data %{_datadir}
+%endif
+
+%py_install \
+ --install-data %{_datadir}
%py_postclean
+# bash-completion
+install -d $RPM_BUILD_ROOT/etc/bash_completion.d
+install -p bash_completion.sh $RPM_BUILD_ROOT/etc/bash_completion.d/%{name}
+
+# don't package tests
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/bzrlib/plugins/bash_completion/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/bzrlib/plugins/launchpad/test_*.py*
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/bzrlib/plugins/netrc_credential_store/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/bzrlib/plugins/news_merge/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/bzrlib/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/bzrlib/util/tests
+
+%if 0
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/bzrlib/plugins/bash_completion/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/bzrlib/plugins/launchpad/test_*.py*
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/bzrlib/plugins/netrc_credential_store/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/bzrlib/plugins/news_merge/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/bzrlib/tests
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/bzrlib/util/tests
+%endif
+
+# sco locale is not supported by glibc
+%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/sco
+
+%find_lang %{name}
+
%clean
rm -rf $RPM_BUILD_ROOT
-%files
+%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc doc/*.txt NEWS README TODO
+%doc doc/*.txt NEWS README TODO contrib
%attr(755,root,root) %{_bindir}/bzr
%{_mandir}/man1/bzr.1*
-%{py_sitedir}/bzrlib
-%if "%{py_ver}" > "2.4"
-%{py_sitedir}/*.egg-info
-%endif
+
+%files -n python-bzr
+%defattr(644,root,root,755)
+%dir %{py_sitedir}/bzrlib
+%{py_sitedir}/bzrlib/*.py[co]
+%attr(755,root,root) %{py_sitedir}/bzrlib/_*.so
+%{py_sitedir}/bzrlib/bundle
+%{py_sitedir}/bzrlib/branchfmt
+%{py_sitedir}/bzrlib/doc
+%{py_sitedir}/bzrlib/doc_generate
+%{py_sitedir}/bzrlib/export
+%{py_sitedir}/bzrlib/filters
+%{py_sitedir}/bzrlib/help_topics
+%{py_sitedir}/bzrlib/plugins
+%{py_sitedir}/bzrlib/repofmt
+%{py_sitedir}/bzrlib/smart
+%{py_sitedir}/bzrlib/store
+%{py_sitedir}/bzrlib/transport
+%{py_sitedir}/bzrlib/ui
+%{py_sitedir}/bzrlib/util
+%{py_sitedir}/bzrlib/version_info_formats
+%{py_sitedir}/bzr-%{version}-py*.egg-info
+
+%files -n bash-completion-%{name}
+%defattr(644,root,root,755)
+/etc/bash_completion.d/%{name}