%global srcname grokmirror %global groupname mirror %global username mirror %global userhome %{_sharedstatedir}/grokmirror %global gitver 44decfbe52 Name: python-%{srcname} Version: 3.0 Release: 0.1.git%{gitver}%{?dist} Summary: Framework to smartly mirror git repositories License: GPLv3+ URL: https://git.kernel.org/pub/scm/utils/grokmirror/grokmirror.git Source0: https://www.kernel.org/pub/software/network/grokmirror/grokmirror-%{version}.tar.xz BuildArch: noarch %global _description %{expand: Grokmirror was written to make mirroring large git repository collections more efficient. Grokmirror uses the manifest file published by the master mirror in order to figure out which repositories to clone, and to track which repositories require updating. The process is extremely lightweight and efficient both for the master and for the mirrors.} %description %_description %package -n python3-%{srcname} Summary: %{summary} Requires(pre): shadow-utils Requires: git-core, python3-packaging, python3-requests BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: systemd Obsoletes: python-%{srcname} < 2, python2-%{srcname} < 2 %description -n python3-%{srcname} %_description %prep %autosetup -n %{srcname}-%{version} # EPEL 10's python3-setuptools (69.0.3) predates PEP 639: it rejects the SPDX # license-expression string and doesn't recognize license-files under # [project] at all. Downgrade to the classic {text = ...} table and drop # license-files (LICENSE.txt is still installed via %license below). sed -i -e 's/^license = "\(.*\)"/license = {text = "\1"}/' \ -e '/^license-files = /d' pyproject.toml # EPEL 9's python3-setuptools (53.0.0) predates PEP 621 entirely: it ignores # the whole [project] table and builds an "UNKNOWN-0.0.0" wheel. Give it a # classic setup.cfg with the same metadata so el9 and el10 both build the # same package; newer setuptools treats pyproject.toml's [project] as # authoritative and ignores the duplicate. cat > setup.cfg << 'EOF' [metadata] name = grokmirror version = 3.0.dev0 [options] package_dir = = src packages = find: python_requires = >=3.9 install_requires = packaging requests urllib3 [options.packages.find] where = src [options.entry_points] console_scripts = grok-bundle = grokmirror.bundle:command grok-dumb-pull = grokmirror.dumb_pull:command grok-fsck = grokmirror.fsck:command grok-manifest = grokmirror.manifest:command grok-pi-indexer = grokmirror.pi_indexer:command grok-pi-piper = grokmirror.pi_piper:command grok-pull = grokmirror.pull:command EOF %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %{__mkdir_p} -m 0755 \ %{buildroot}%{userhome} \ %{buildroot}%{_sysconfdir}/%{srcname} \ %{buildroot}%{_sysconfdir}/logrotate.d \ %{buildroot}%{_unitdir} \ %{buildroot}%{_bindir} \ %{buildroot}%{_tmpfilesdir} \ %{buildroot}%{_mandir}/man1 \ %{buildroot}%{_localstatedir}/log/%{srcname} \ %{buildroot}/run/%{srcname} %{__install} -m 0644 man/*.1 %{buildroot}/%{_mandir}/man1/ %{__install} -m 0644 contrib/*.service %{buildroot}/%{_unitdir}/ %{__install} -m 0644 contrib/*.timer %{buildroot}/%{_unitdir}/ %{__install} -m 0644 contrib/logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/grokmirror %{__install} -m 0644 grokmirror.conf %{buildroot}/%{_sysconfdir}/%{srcname}/grokmirror.conf.example echo "d /run/%{srcname} 0755 %{username} %{groupname}" > %{buildroot}/%{_tmpfilesdir}/%{srcname}.conf %pre -n python3-%{srcname} getent group %{groupname} >/dev/null || groupadd -r %{groupname} getent passwd %{username} >/dev/null || \ useradd -r -g %{groupname} -d %{userhome} -s /sbin/nologin \ -c "Grokmirror user" %{username} exit 0 %files -n python3-%{srcname} %license LICENSE.txt %doc README.rst grokmirror.conf pi-piper.conf %dir %attr(0750, %{username}, %{groupname}) %{userhome} %dir %attr(0755, %{username}, %{groupname}) %{_localstatedir}/log/%{srcname}/ %dir %attr(0755, %{username}, %{groupname}) /run/%{srcname}/ %config %{_sysconfdir}/%{srcname}/* %config %{_sysconfdir}/logrotate.d/* %{_tmpfilesdir}/%{srcname}.conf %{_unitdir}/* %{python3_sitelib}/%{srcname}-*.dist-info/ %{python3_sitelib}/%{srcname}/ %{_bindir}/* %{_mandir}/*/* %changelog * Wed Sep 02 2026 Konstantin Ryabitsev - 3.0-0.1.git44decfbe52 - Snapshot of 3.0-dev master (44decfbe52) for prerelease testing - Switch build to pyproject-rpm-macros: upstream dropped setup.py for a pyproject.toml + src/ layout - Add a setup.cfg shim in %prep so the build also works on EL9, whose setuptools (53.0.0) predates PEP 621 and can't read pyproject.toml's [project] table at all * Tue Jul 23 2024 Konstantin Ryabitsev - 2.0.12-1 - Update to 2.0.12 * Thu Mar 11 2021 Konstantin Ryabitsev - 2.0.8-1 - Update to 2.0.8 with fixes to symlink handling in manifests * Tue Jan 19 2021 Konstantin Ryabitsev - 2.0.7-1 - Update to 2.0.7 with improvements for very large repo collections * Thu Jan 07 2021 Konstantin Ryabitsev - 2.0.6-1 - Update to 2.0.6 with minor new features * Wed Nov 25 2020 Konstantin Ryabitsev - 2.0.5-1 - Update to 2.0.5 with minor new features * Wed Nov 04 2020 Konstantin Ryabitsev - 2.0.4-1 - Update to 2.0.4 with minor new features * Wed Nov 04 2020 Konstantin Ryabitsev - 2.0.3-1 - Update to 2.0.3 with minor new features * Tue Oct 06 2020 Konstantin Ryabitsev - 2.0.2-1 - Update to 2.0.2 - Install pi-piper into bindir * Wed Sep 30 2020 Konstantin Ryabitsev - 2.0.1-1 - Update to 2.0.1 * Mon Sep 21 2020 Konstantin Ryabitsev - 2.0.0-1 - Initial 2.0.0 packaging