1 |
# TODO |
2 |
# split the tools from main package ? |
3 |
# split the doc ? |
4 |
%define url_ver %(echo %{version}|cut -d. -f1,2) |
5 |
|
6 |
# we don't want to provide private python extension libs |
7 |
%define _exclude_files_from_autoprov %{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so |
8 |
|
9 |
%global __provides_exclude perl\\( |
10 |
|
11 |
Name: bzr |
12 |
Epoch: 0 |
13 |
Version: 2.7.0 |
14 |
%define subrel 1 |
15 |
Release: %mkrel 1 |
16 |
Summary: Next-generation distributed version control |
17 |
Group: Development/Tools |
18 |
License: GPLv2+ |
19 |
URL: http://www.bazaar-vcs.org/ |
20 |
Source0: https://launchpad.net/bzr/%{url_ver}/%{version}/+download/bzr-%{version}.tar.gz |
21 |
Source1: https://launchpad.net/bzr/%{url_ver}/%{version}/+download/bzr-%{version}.tar.gz.sig |
22 |
Source2: bzr-icon-64.png |
23 |
# Patch from Ubuntu for MGA#21681 / https://usn.ubuntu.com/usn/usn-3411-1/ |
24 |
Patch1: 24_ssh_hostnames-lp1710979.patch |
25 |
BuildRequires: python-devel |
26 |
BuildRequires: python-paramiko |
27 |
BuildRequires: zlib-devel |
28 |
# For building documents |
29 |
BuildRequires: python-sphinx |
30 |
BuildRequires: gettext |
31 |
BuildRequires: python-cython |
32 |
Requires: python-pycurl |
33 |
Requires: python-lzma |
34 |
|
35 |
%description |
36 |
Bazaar is a distributed revision control system. It allows team members to |
37 |
branch and merge upstream code very easily. |
38 |
|
39 |
Distributed revision control systems allow multiple people to have their |
40 |
own branch of a project, and merge code efficiently between them. This |
41 |
enables new contributors to immediately have access to the full tools that |
42 |
previously have been limited to just the committers to a project. |
43 |
|
44 |
%prep |
45 |
%setup -q |
46 |
%patch1 -p1 |
47 |
|
48 |
sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/_patiencediff_py.py |
49 |
sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' bzrlib/weave.py |
50 |
|
51 |
# Remove Cython generated .c files |
52 |
find . -name '*_pyx.c' -exec rm \{\} \; |
53 |
|
54 |
%build |
55 |
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build |
56 |
|
57 |
# Build documents |
58 |
make docs-sphinx |
59 |
|
60 |
%install |
61 |
%{__python} setup.py install --skip-build --install-data %{_datadir} --root $RPM_BUILD_ROOT |
62 |
chmod -R a+rX contrib |
63 |
chmod 0644 contrib/debian/init.d |
64 |
chmod 0644 contrib/bzr_ssh_path_limiter |
65 |
chmod 0644 contrib/bzr_access |
66 |
chmod 0755 $RPM_BUILD_ROOT%{python_sitearch}/bzrlib/*.so |
67 |
|
68 |
install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/ |
69 |
install -m 0644 contrib/bash/bzr $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/ |
70 |
rm contrib/bash/bzr |
71 |
|
72 |
# This is included in %doc, remove redundancy here |
73 |
rm -rf $RPM_BUILD_ROOT%{python_sitearch}/bzrlib/doc/ |
74 |
|
75 |
# Use independently packaged python-elementtree instead |
76 |
rm -rf $RPM_BUILD_ROOT%{python_sitearch}/bzrlib/util/elementtree/ |
77 |
|
78 |
# Install documents |
79 |
install -d $RPM_BUILD_ROOT/%{_docdir}/%{name}/pdf |
80 |
cp -pr NEWS README TODO COPYING.txt contrib/ $RPM_BUILD_ROOT/%{_docdir}/%{name}/ |
81 |
cd doc |
82 |
for dir in *; do |
83 |
if [ -d $dir/_build/html ]; then |
84 |
cp -R $dir/_build/html $RPM_BUILD_ROOT%{_docdir}/%{name}/$dir |
85 |
rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/$dir/.buildinfo |
86 |
rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/$dir/_static/$dir/Makefile |
87 |
find $RPM_BUILD_ROOT%{_docdir}/%{name}/$dir -name '*.pdf' | while read pdf; do |
88 |
ln $pdf $RPM_BUILD_ROOT%{_docdir}/%{name}/pdf/ |
89 |
done |
90 |
fi |
91 |
done |
92 |
cd .. |
93 |
|
94 |
install -d $RPM_BUILD_ROOT%{_datadir}/pixmaps |
95 |
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps/bzr.png |
96 |
|
97 |
%find_lang %{name} |
98 |
|
99 |
%files -f %{name}.lang |
100 |
%doc %{_docdir}/%{name}/* |
101 |
%{_bindir}/bzr |
102 |
%{_datadir}/pixmaps/bzr.png |
103 |
%{python_sitearch}/bzrlib/ |
104 |
%{python_sitearch}/*egg-info |
105 |
%{_mandir}/man1/* |
106 |
%config(noreplace) %{_sysconfdir}/bash_completion.d/bzr |
107 |
|