Andreas Schneider f4e47d0
%global gitexecdir %{_libexecdir}/git-core
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
Name:           git-filter-repo
Andreas Schneider 4d58a0c
Version:        2.38.0
Andreas Schneider 4d58a0c
Release:        1%{?dist}
Andreas Schneider f4e47d0
Summary:        Quickly rewrite git repository history (git-filter-branch replacement)
Andreas Schneider 4d58a0c
License:        GPL-2.0-only OR MIT
Andreas Schneider f4e47d0
Group:          Development/Tools/Version Control
Andreas Schneider f4e47d0
Url:            https://github.com/newren/git-filter-repo
Andreas Schneider f4e47d0
#
Andreas Schneider f4e47d0
Source0:        https://github.com/newren/git-filter-repo/releases/download/v%{version}/%{name}-%{version}.tar.xz
Andreas Schneider f4e47d0
#
Andreas Schneider f4e47d0
BuildArch:      noarch
Andreas Schneider f4e47d0
#
3cc271b
BuildRequires:  git-core >= 2.26.0
Andreas Schneider 32f4d4b
BuildRequires:  python3-rpm-macros
Andreas Schneider f4e47d0
BuildRequires:  python3-devel
07e2f72
BuildRequires:  python3-setuptools
59aceee
# test deps
59aceee
BuildRequires:  perl-interpreter
59aceee
BuildRequires:  rsync
Andreas Schneider f4e47d0
#
3cc271b
Requires:       git-core >= 2.26.0
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
%description
Andreas Schneider f4e47d0
git filter-repo is a versatile tool for rewriting history, which includes
Andreas Schneider f4e47d0
capabilities not found anywhere else. It roughly falls into the same space of
Andreas Schneider f4e47d0
tool as git filter-branch but without the capitulation-inducing poor
Andreas Schneider f4e47d0
performance, with far more capabilities, and with a design that scales
Andreas Schneider f4e47d0
usability-wise beyond trivial rewriting cases.
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
%prep
Andreas Schneider 4d58a0c
%autosetup -p1
Andreas Schneider f4e47d0
c98903e
# Remove shebang from the python module to avoid rpmlint warnings
c98903e
# (this is a symlink, but sed -i will break it, conveniently for us)
c98903e
sed -i '1,2d' git_filter_repo.py
c98903e
Andreas Schneider f4e47d0
# Change shebang in all relevant files in this directory and all subdirectories
Andreas Schneider f4e47d0
find -type f -exec sed -i '1s=^#!%{_bindir}/\(python\|env python\)[23]\?=#!%{_bindir}/python3=' {} +
Andreas Schneider f4e47d0
59aceee
# Fix shebang print_my_version(); it affects the --version output
59aceee
sed -Ei "s=#!/usr/bin/env python3=#!%{_bindir}/python3=" %{name} git_filter_repo.py
59aceee
c98903e
# Create setup.{cfg,py} to ensure we have egg-info for generating dependencies
c98903e
sed -e '/^setup_requires = setuptools_scm$/d' release/setup.cfg >setup.cfg
c98903e
c98903e
cat <<'EOF' >setup.py
c98903e
from setuptools import setup
c98903e
setup(name="%{name}", version="%{version}",
c98903e
      entry_points={'console_scripts': ['%{name} = git_filter_repo:main']})
c98903e
EOF
c98903e
c98903e
# Fix links to git docs since we don't install git-filter-repo.html into the
c98903e
# git htmldir
c98903e
sed -Ei 's,(a href=")(git),\1%{_docdir}/git/\2,g' Documentation/html/git-filter-repo.html
c98903e
Andreas Schneider f4e47d0
%build
c98903e
%py3_build
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
%install
c98903e
%py3_install -- --install-scripts %{gitexecdir}
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
install -d -m 0755 %{buildroot}%{_mandir}/man1
Andreas Schneider f4e47d0
install -m 0644 Documentation/man1/git-filter-repo.1 %{buildroot}%{_mandir}/man1/git-filter-repo.1
Andreas Schneider f4e47d0
59aceee
%check
59aceee
t/run_tests
59aceee
Andreas Schneider f4e47d0
%files
Andreas Schneider f4e47d0
%license COPYING
2a16d97
%doc README.md Documentation/*.md Documentation/html/*.html contrib/filter-repo-demos
Andreas Schneider f4e47d0
%{gitexecdir}/git-filter-repo
c98903e
%pycached %{python3_sitelib}/git_filter_repo.py
c98903e
%{python3_sitelib}/git_filter_repo-%{version}-*.egg-info/
Andreas Schneider f4e47d0
%{_mandir}/man1/git-filter-repo.1*
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
%changelog
Andreas Schneider 4d58a0c
* Sun Mar 05 2023 Andreas Schneider <asn@redhat.com> - 2.38.0-1
Andreas Schneider 4d58a0c
- Update to version 2.38.0
Andreas Schneider 4d58a0c
7184114
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.34.0-6
7184114
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
7184114
c98903e
* Fri Sep 23 2022 Todd Zullinger <tmz@pobox.com> - 2.34.0-5
c98903e
- improve python provides
3cc271b
- require git-core rather than git
2a16d97
- include additional documentation
59aceee
- run the test suite
c98903e
ca86857
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.34.0-4
ca86857
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
ca86857
5f56f2b
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.34.0-3
5f56f2b
- Rebuilt for Python 3.11
5f56f2b
624f9b7
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.34.0-2
624f9b7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
624f9b7
Andreas Schneider af34186
* Thu Dec 23 2021 Andreas Schneider <asn@redhat.com> - 2.34.0-1
Andreas Schneider af34186
- Update to version 2.34.0
Andreas Schneider af34186
b95bfb6
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.29.0-4
b95bfb6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
b95bfb6
04e1575
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.29.0-3
04e1575
- Rebuilt for Python 3.10
04e1575
Andreas Schneider 2cf91d9
* Mon Mar 15 2021 Andreas Schneider <asn@redhat.com> - 0.29.0-1
Andreas Schneider 2cf91d9
- Update to version 2.29.0
Andreas Schneider 2cf91d9
5ec8ffc
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.28.0-2
5ec8ffc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
5ec8ffc
Andreas Schneider b0d53fd
* Thu Aug 06 2020 Andreas Schneider <asn@redhat.com> - 2.28.0-1
Andreas Schneider b0d53fd
- Update to version 2.28.0
Andreas Schneider b0d53fd
800d978
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.27.0-2
800d978
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
800d978
Andreas Schneider 751d496
* Tue Jun 02 2020 Andreas Schneider <asn@redhat.com> - 2.27.0-1
Andreas Schneider 751d496
- Update to version 2.27.0
Andreas Schneider 751d496
de896e5
* Tue May 26 2020 Miro HronĨok <mhroncok@redhat.com> - 2.25.0-5
de896e5
- Rebuilt for Python 3.9
de896e5
Andreas Schneider 32f4d4b
* Thu Jan 30 2020 Andreas Schneider <asn@redhat.com> - 2.25.0-4
Andreas Schneider 32f4d4b
- Add missing BR for python3-rpm-macros
Andreas Schneider 32f4d4b
e042588
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.25.0-3
e042588
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
e042588
Andreas Schneider 916c086
* Tue Jan 21 2020 Andreas Schneider <asn@redhat.com> - 2.25.0-1
Andreas Schneider 916c086
- Update to version 2.25.0
Andreas Schneider 916c086
- Fix installation to python3 sitelib
Andreas Schneider 916c086
Andreas Schneider f4e47d0
* Fri Dec 20 2019 Andreas Schneider <asn@redhat.com> - 2.24.0-2
Andreas Schneider f4e47d0
- Fixed source tarball permissions
Andreas Schneider f4e47d0
- Fixed souperfluous space in Summary
Andreas Schneider f4e47d0
Andreas Schneider f4e47d0
* Thu Dec 19 2019 Andreas Schneider <asn@redhat.com> - 2.24.0-1
Andreas Schneider f4e47d0
- Initial version 2.24.0