churchyard / rpms / breezy

Forked from rpms/breezy 4 years ago
Clone

Blame breezy.spec

7f084c7
# All package versioning is found here:
7f084c7
# the actual version is composed from these below, including leading 0 for release candidates
7f084c7
#   bzrmajor:  main bzr version
7f084c7
#   Version: bzr version, add subrelease version here
7f084c7
#   bzrrc: release candidate version, if any, line starts with % for rc, # for stable releas (no %).
7f084c7
#   release: rpm subrelease (0.N for rc candidates, N for stable releases)
7f084c7
%global brzmajor 3.0
7f084c7
%global brzminor .1
7f084c7
#global brzrc b6
7f084c7
%global baserelease 1
7f084c7
7f084c7
# Turn this on to replace (obsoelte/provide) the bzr package
7f084c7
%bcond_with replace_bzr
7f084c7
7f084c7
Name:           breezy
7f084c7
Version:        %{brzmajor}%{?brzminor}
7f084c7
Release:        %{baserelease}%{?brzrc:.}%{?brzrc}%{?dist}
7f084c7
Summary:        Friendly distributed version control system
7f084c7
7f084c7
License:        GPLv2+
7f084c7
URL:            http://www.breezy-vcs.org/
7f084c7
Source0:        https://launchpad.net/brz/%{brzmajor}/%{version}%{?brzrc}/+download/%{name}-%{version}%{?brzrc}.tar.gz
7f084c7
Source1:        https://launchpad.net/brz/%{brzmajor}/%{version}%{?brzrc}/+download/%{name}-%{version}%{?brzrc}.tar.gz.asc
7f084c7
Source2:        brz-icon-64.png
7f084c7
7f084c7
BuildRequires:  python3-devel
7f084c7
BuildRequires:  python3-configobj
7f084c7
BuildRequires:  python3-Cython
7f084c7
BuildRequires:  python3-sphinx
7f084c7
BuildRequires:  python3-sphinx-epytext
7f084c7
BuildRequires:  python3-setuptools
7f084c7
BuildRequires:  zlib-devel
7f084c7
BuildRequires:  bash-completion
7f084c7
BuildRequires:  gcc
7f084c7
BuildRequires:  gettext
7f084c7
7f084c7
Requires:       python3-paramiko
7f084c7
7f084c7
# This is the name of the command, note that it is brz, not bzr
7f084c7
Provides:       brz = %{version}-%{release}
7f084c7
7f084c7
%if %{with replace_bzr}
7f084c7
# breezy is a fork of bzr and replaces it
7f084c7
Provides:       bzr = %{version}-%{release}
7f084c7
Obsoletes:      bzr < 3
7f084c7
Provides:       git-remote-bzr = %{version}-%{release}
7f084c7
Obsoletes:      git-remote-bzr < 3
7f084c7
%endif
7f084c7
7f084c7
# This is needed for launchpad support
7f084c7
Recommends:     python3-launchpadlib
7f084c7
7f084c7
# Docs are not needed, but some might want them
7f084c7
Suggests:       %{name}-doc = %{version}-%{release}
7f084c7
7f084c7
%description
7f084c7
Breezy (brz) is a decentralized revision control system, designed to be easy
7f084c7
for developers and end users alike.
7f084c7
7f084c7
By default, Breezy provides support for both the Bazaar and Git file formats.
7f084c7
7f084c7
7f084c7
%package doc
7f084c7
Summary:        Documentation for Breezy
7f084c7
BuildArch:      noarch
7f084c7
7f084c7
%description doc
7f084c7
This package contains the documentation for the Breezy version control system.
7f084c7
7f084c7
%prep
7f084c7
%autosetup -p1 -n %{name}-%{version}%{?brzrc}
7f084c7
7f084c7
# Remove unused shebangs
7f084c7
sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' \
7f084c7
    breezy/_patiencediff_py.py \
7f084c7
    breezy/git/git_remote_helper.py \
7f084c7
    breezy/git/tests/test_git_remote_helper.py \
7f084c7
    breezy/patiencediff.py \
7f084c7
    breezy/plugins/bash_completion/bashcomp.py \
7f084c7
    breezy/tests/ssl_certs/create_ssls.py \
7f084c7
    contrib/brz_access
7f084c7
7f084c7
# Remove Cython generated .c files
7f084c7
find . -name '*_pyx.c' -exec rm \{\} \;
7f084c7
7f084c7
%build
7f084c7
%py3_build
7f084c7
7f084c7
chmod a-x contrib/bash/brzbashprompt.sh
7f084c7
7f084c7
# Build documents
7f084c7
make docs-sphinx PYTHON=%{__python3}
7f084c7
rm doc/*/_build/html/.buildinfo
7f084c7
rm -f doc/*/_build/html/_static/*/Makefile
7f084c7
pushd doc
7f084c7
for dir in *; do
7f084c7
  test -d $dir/_build/html && mv $dir/_build/html ../$dir
7f084c7
done
7f084c7
popd
7f084c7
7f084c7
7f084c7
%install
7f084c7
%py3_install
7f084c7
chmod -R a+rX contrib
7f084c7
chmod 0644 contrib/debian/init.d
7f084c7
chmod 0644 contrib/bzr_ssh_path_limiter  # note the bzr here
7f084c7
chmod 0644 contrib/brz_access
7f084c7
chmod 0755 %{buildroot}%{python3_sitearch}/%{name}/*.so
7f084c7
7f084c7
bashcompdir=$(pkg-config --variable=completionsdir bash-completion)
7f084c7
install -Dpm 0644 contrib/bash/brz %{buildroot}$bashcompdir/brz
7f084c7
rm contrib/bash/brz
7f084c7
7f084c7
install -d %{buildroot}%{_datadir}/pixmaps
7f084c7
install -m 0644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/brz.png
7f084c7
7f084c7
# weird man page location
7f084c7
mv %{buildroot}%{_prefix}/man %{buildroot}%{_datadir}
7f084c7
7f084c7
# move git-remote-bzr to avoid conflict
7f084c7
mv %{buildroot}%{_bindir}/git-remote-bzr %{buildroot}%{_bindir}/git-remote-brz
7f084c7
mv %{buildroot}%{_mandir}/man1/git-remote-bzr.1 %{buildroot}%{_mandir}/man1/git-remote-brz.1
7f084c7
7f084c7
%if %{with replace_bzr}
7f084c7
# backwards compatible symbolic links
7f084c7
ln -s brz %{buildroot}%{_bindir}/bzr
7f084c7
ln -s git-remote-brz %{buildroot}%{_bindir}/git-remote-bzr
7f084c7
echo ".so man1/brz.1" > %{buildroot}%{_mandir}/man1/bzr.1
7f084c7
echo ".so man1/git-remote-brz.1" > %{buildroot}%{_mandir}/man1/git-remote-bzr.1
7f084c7
%endif
7f084c7
7f084c7
7f084c7
7f084c7
# locales: all the .po files have empty msgstrs, so this doesn't do anything
7f084c7
#mv %%{name}/locale %%{buildroot}%%{_datadir}
7f084c7
#%%find_lang %%{name}
7f084c7
7f084c7
7f084c7
%files
7f084c7
# ... -f %%{name}.lang
7f084c7
%license COPYING.txt
7f084c7
%doc NEWS README.rst TODO contrib/
7f084c7
%{_bindir}/brz
7f084c7
%{_bindir}/bzr-*-pack
7f084c7
%{_bindir}/git-remote-brz
7f084c7
%if %{with replace_bzr}
7f084c7
%{_bindir}/bzr
7f084c7
%{_bindir}/git-remote-bzr
7f084c7
%endif
7f084c7
%{_mandir}/man1/*
7f084c7
%{python3_sitearch}/%{name}/
7f084c7
%{python3_sitearch}/*.egg-info/
7f084c7
%{_datadir}/bash-completion/
7f084c7
%{_datadir}/pixmaps/brz.png
7f084c7
7f084c7
7f084c7
%files doc
7f084c7
%license COPYING.txt
7f084c7
%doc en developers
7f084c7
7f084c7
7f084c7
%changelog
7f084c7
* Wed Sep 04 2019 Miro HronĨok <mhroncok@redhat.com> - 3.0.1-1
7f084c7
- Package breezy