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 %).
aded0c8
#   baserelease: rpm release number (0.N for rc candidates, N for stable releases)
62085ec
%global brzmajor 3.3
62085ec
%global brzminor .3
7f084c7
#global brzrc b6
62085ec
%global baserelease 1
7f084c7
7f084c7
Name:           breezy
7f084c7
Version:        %{brzmajor}%{?brzminor}
7f084c7
Release:        %{baserelease}%{?brzrc:.}%{?brzrc}%{?dist}
7f084c7
Summary:        Friendly distributed version control system
7f084c7
62085ec
# breezy is GPL-2.0-or-later, but it has Rust dependencies
62085ec
# see packaged LICENSE.dependencies for details
62085ec
License:        GPL-2.0-or-later AND (MIT OR Apache-2.0) AND Unicode-DFS-2016 AND Apache-2.0 AND MIT AND (Unlicense OR MIT)
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
62085ec
BuildRequires:  rust-packaging >= 21
7f084c7
BuildRequires:  zlib-devel
7f084c7
BuildRequires:  bash-completion
7f084c7
BuildRequires:  gcc
7f084c7
BuildRequires:  gettext
15db656
BuildRequires:  make
7f084c7
7f084c7
# This is the name of the command, note that it is brz, not bzr
7f084c7
Provides:       brz = %{version}-%{release}
7f084c7
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
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
62085ec
License:        GPL-2.0-or-later
7f084c7
BuildArch:      noarch
7f084c7
7f084c7
%description doc
7f084c7
This package contains the documentation for the Breezy version control system.
7f084c7
7f084c7
%prep
277576b
%autosetup -p0 -n %{name}-%{version}%{?brzrc}
7f084c7
62085ec
%cargo_prep
62085ec
7f084c7
# Remove unused shebangs
7f084c7
sed -i '1{/#![[:space:]]*\/usr\/bin\/\(python\|env\)/d}' \
684b20f
    breezy/__main__.py \
7f084c7
    breezy/git/git_remote_helper.py \
7f084c7
    breezy/git/tests/test_git_remote_helper.py \
7f084c7
    breezy/plugins/bash_completion/bashcomp.py \
684b20f
    breezy/plugins/zsh_completion/zshcomp.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
62085ec
62085ec
%generate_buildrequires
62085ec
%cargo_generate_buildrequires
62085ec
%pyproject_buildrequires -x doc
62085ec
62085ec
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
62085ec
# Add Rust licenses
62085ec
%{cargo_license} > LICENSE.dependencies
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
# 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
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
62085ec
%license COPYING.txt LICENSE.dependencies
7f084c7
%doc NEWS README.rst TODO contrib/
7f084c7
%{_bindir}/brz
7f084c7
%{_bindir}/bzr-*-pack
7f084c7
%{_bindir}/git-remote-brz
7f084c7
%{_bindir}/bzr
7f084c7
%{_bindir}/git-remote-bzr
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
62085ec
%license COPYING.txt LICENSE.dependencies
7f084c7
%doc en developers
7f084c7
7f084c7
7f084c7
%changelog
62085ec
* Mon Jul 24 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 3.3.3-1
62085ec
- Update to 3.3.3
62085ec
- Modernizes specfile, now using automatic buildrequires
62085ec
- Resolves: #2219952, #2133259
62085ec
ee85fc6
* Sun Jul 23 2023 Python Maint <python-maint@redhat.com> - 3.2.2-10
ee85fc6
- Rebuilt for Python 3.12
ee85fc6
c323337
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-9
c323337
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
c323337
5dab3c4
* Mon Jun 26 2023 Ondrej Pohorelsky <opohorel@redhat.com> - 3.2.2-8
5dab3c4
- Migrate license to SPDX format
5dab3c4
ebea6ef
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-7
ebea6ef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
ebea6ef
f044802
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-6
f044802
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
f044802
26b9641
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 3.2.2-5
26b9641
- Rebuilt for Python 3.11
26b9641
72cbb44
* Tue Jun 07 2022 Ondrej Pohorelsky <opohorel@redhat.com> - 3.2.2-4
72cbb44
- Update to 3.2.2
72cbb44
- Resolves: #2070029
72cbb44
5bc3ebd
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.1-3
5bc3ebd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
5bc3ebd
eb1fffe
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.1-2
eb1fffe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
eb1fffe
de23369
* Tue Jul 13 2021 Ondrej Pohorelsky <opohorel@redhat.com> - 3.2.1-1
de23369
- Update to 3.2.1
de23369
- Resolves: #1980401
de23369
d053c8a
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 3.2.0-2
d053c8a
- Rebuilt for Python 3.10
d053c8a
15db656
* Wed May 05 2021 Ondrej Pohorelsky <opohorel@redhat.com> - 3.2.0-1
15db656
- Update to 3.2.0
15db656
87e1089
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
87e1089
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
87e1089
b788a03
* Mon Oct 26 2020 Ondrej Pohorelsky <opohorel@redhat.com> - 3.1.0-1
b788a03
- Update to 3.1.0
b788a03
63e5622
* Thu Oct 22 2020 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-5
63e5622
- Replace bazaar in ELN as well
63e5622
92bfb6a
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-4
92bfb6a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
92bfb6a
35946d4
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-3
35946d4
- Rebuilt for Python 3.9
35946d4
485e53e
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
485e53e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
485e53e
aded0c8
* Sun Dec 01 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-1
aded0c8
- Update to 3.0.2
aded0c8
514c489
* Thu Oct 24 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.1-4
514c489
- On Fedora 32+, replace bazaar with breezy
514c489
  https://fedoraproject.org/wiki/Changes/ReplaceBazaarWithBreezy
514c489
277576b
* Thu Oct 17 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.1-3
277576b
- Reenable all extension modules
277576b
0eae794
* Thu Oct 10 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.1-2
0eae794
- Disable the _static_tuple_c extension module to workaround Python 3.8 problems (#1760260)
0eae794
- Other disabled modules depending on the above:
0eae794
  _chk_map_pyx, _dirstate_helpers_pyx, _bencode_pyx, _btree_serializer_pyx
0eae794
7f084c7
* Wed Sep 04 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.1-1
7f084c7
- Package breezy