Compare commits

...

4 Commits

Author SHA1 Message Date
eabdullin
5209f06b59 Merge branch 'epel10' into a10s-epel10 2025-06-16 11:29:15 +03:00
eabdullin
67dd97431e Update to 0.8.1 2025-06-16 10:34:15 +03:00
eabdullin
f1d608b9f6 AlmaLinux change:Add AlmaLinux OS change identifier 2025-04-17 13:13:02 +03:00
eabdullin
67c7252627 Import form EPEL10 2025-04-17 10:18:50 +03:00
6 changed files with 725 additions and 211 deletions

View File

@ -0,0 +1,217 @@
From 887d32899f8528b4681895dd2f922a4f056e9f70 Mon Sep 17 00:00:00 2001
From: eabdullin <ed.abdullin.1@gmail.com>
Date: Fri, 6 Dec 2024 09:44:47 +0300
Subject: [PATCH] Added AlmaLinux change identifier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When modifying a package in AlmaLinux relative to upstream, we do not increment the packages version/release number. Instead, we use almalinux.{almalinux_release_number}.
Therefore, the ability to identify AlmaLinux-specific changes was added, using the comment "AlmaLinux change: ".
If this comment is used, the base release number of the package remains unchanged, but the suffix almalinux.{almalinux_release_number} is appended.
The almalinux_release_number counter increments with each AlmaLinux-specific change to the package and resets upon version/release updates of the package.
---
rpmautospec/changelog.py | 2 +
rpmautospec/magic_comments.py | 7 ++-
rpmautospec/pkg_history.py | 52 ++++++++++++++++++-
rpmautospec/subcommands/process_distgit.py | 9 +++-
.../subcommands/test_process_distgit.py | 3 +-
tests/rpmautospec/test_magic_comments.py | 1 +
6 files changed, 69 insertions(+), 5 deletions(-)
diff --git a/rpmautospec/changelog.py b/rpmautospec/changelog.py
index cb3e74f..599df6f 100644
--- a/rpmautospec/changelog.py
+++ b/rpmautospec/changelog.py
@@ -106,6 +106,8 @@ class ChangelogEntry(dict):
changelog_evr = f" - {entry_info['epoch-version']}"
if entry_info["release-complete"]:
changelog_evr += f"-{entry_info['release-complete']}"
+ if "almalinux-release-complete" in entry_info and entry_info["almalinux-release-complete"]:
+ changelog_evr += f".{entry_info['almalinux-release-complete']}"
else:
changelog_evr = ""
changelog_header = f"* {changelog_date} {entry_info['authorblurb']}{changelog_evr}"
diff --git a/rpmautospec/magic_comments.py b/rpmautospec/magic_comments.py
index d56086e..4c1c06c 100644
--- a/rpmautospec/magic_comments.py
+++ b/rpmautospec/magic_comments.py
@@ -3,19 +3,24 @@ from typing import NamedTuple
magic_comment_re = re.compile(r"^\s*\[(?P<magic>.*)\]\s*$")
skip_changelog_re = re.compile(r"\s*skip\s+changelog\s*")
+is_almalinux_re = re.compile(r"almalinux\s+change", re.IGNORECASE)
bump_release_re = re.compile(r"\s*bump\s+release\s*(?::\s*)?(?P<bump_value>\d+)\s*")
class MagicCommentResult(NamedTuple):
skip_changelog: bool
+ is_almalinux: bool
bump_release: int
def parse_magic_comments(message: str) -> MagicCommentResult:
skip_changelog = False
+ is_almalinux = False
bump_release = 0
for line in message.split("\n"):
+ if is_almalinux_re.match(line):
+ is_almalinux = True
if l_match := magic_comment_re.match(line):
for part in l_match.group("magic").split(","):
if skip_changelog_re.match(part):
@@ -23,4 +28,4 @@ def parse_magic_comments(message: str) -> MagicCommentResult:
if br_match := bump_release_re.match(part):
bump_release = max(bump_release, int(br_match.group("bump_value")))
- return MagicCommentResult(skip_changelog=skip_changelog, bump_release=bump_release)
+ return MagicCommentResult(skip_changelog=skip_changelog, bump_release=bump_release, is_almalinux=is_almalinux)
diff --git a/rpmautospec/pkg_history.py b/rpmautospec/pkg_history.py
index 6527ffe..91bd080 100644
--- a/rpmautospec/pkg_history.py
+++ b/rpmautospec/pkg_history.py
@@ -311,13 +311,55 @@ class PkgHistoryProcessor:
)
release_number = max(parent_release_numbers, default=0)
- if self.specfile.name in commit.tree:
+ if (
+ self.specfile.name in commit.tree
+ and (
+ not commit_result["magic-comment-result"].is_almalinux
+ )
+ ):
release_number += 1
release_number = max(release_number, commit_result["magic-comment-result"].bump_release)
commit_result["release-number"] = release_number
+ is_almalinux_commit = (
+ commit_result["magic-comment-result"].is_almalinux
+ )
+
+ if is_almalinux_commit:
+ log.debug("\tHas AlmaLinux changes")
+
+ parent_almalinux_release_numbers = tuple(
+ (
+ res.get("almalinux-release-number", 0)
+ if res and (
+ epoch_version is None or res["epoch-version"] is None or epoch_version == res["epoch-version"]
+ )
+ else 0
+ )
+ for res in parent_results
+ )
+ almalinux_release_number = max(parent_almalinux_release_numbers, default=0)
+
+ if commit_result["magic-comment-result"].is_almalinux:
+ almalinux_release_number += 1
+
+ if (
+ release_number > max(parent_release_numbers, default=0)
+ ):
+ almalinux_release_number = 1
+ elif epoch_version != commit_verflags.get("epoch-version"):
+ almalinux_release_number = 1
+
+ commit_result["almalinux-release-number"] = almalinux_release_number
+ almalinux_release_number_with_base = almalinux_release_number + base - 1
+ commit_result["almalinux-release-complete"] = f"alma.{almalinux_release_number_with_base}"
+ log.debug("\talmalinux_release_number: %s", almalinux_release_number)
+ else:
+ commit_result["almalinux-release-number"] = 0
+ commit_result["almalinux-release-complete"] = ""
+
log.debug("\trelease_number: %s", release_number)
prerel_str = "0." if prerelease else ""
@@ -382,6 +424,10 @@ class PkgHistoryProcessor:
# care. If it didn't change, we don't know how to continue and need to flag that.
merge_unresolvable = not changelog_changed
+ if merge_unresolvable and commit.message.lower().startswith("almalinux changes:"):
+ merge_unresolvable = False
+ parent_to_follow = commit.parents[1]
+
our_child_must_continue = (
not (changelog_changed and changelog_blob or merge_unresolvable) and child_must_continue
)
@@ -408,6 +454,7 @@ class PkgHistoryProcessor:
"commitlog": commit.message,
"epoch-version": commit_result["epoch-version"],
"release-complete": commit_result["release-complete"],
+ "almalinux-release-complete": commit_result["almalinux-release-complete"]
}
)
@@ -450,6 +497,9 @@ class PkgHistoryProcessor:
log.debug("\tskip_for_changelog: %s", skip_for_changelog)
+ if skip_for_changelog and commit.message.lower().startswith("almalinux changes:"):
+ skip_for_changelog = False
+
changelog_entry["skip"] = skip_for_changelog
if not skip_for_changelog:
diff --git a/rpmautospec/subcommands/process_distgit.py b/rpmautospec/subcommands/process_distgit.py
index ab8ca20..94c4e20 100644
--- a/rpmautospec/subcommands/process_distgit.py
+++ b/rpmautospec/subcommands/process_distgit.py
@@ -26,7 +26,7 @@ AUTORELEASE_TEMPLATE = """
release_number = {autorelease_number:d};
base_release_number = tonumber(rpm.expand("%{{?-b*}}%{{!?-b:1}}"));
print(release_number + base_release_number - 1);
-}}%{{?-e:.%{{-e*}}}}%{{?-s:.%{{-s*}}}}%{{!?-n:%{{?dist}}}}""" # noqa: E501
+}}%{{?-e:.%{{-e*}}}}%{{?-s:.%{{-s*}}}}%{{!?-n:%{{?dist}}}}{almalinux_suffix}""" # noqa: E501
def do_process_distgit(
@@ -94,9 +94,14 @@ def do_process_distgit(
# Process the spec file into a temporary file...
used_features = []
+ almalinux_suffix = ""
+ if result.get("almalinux-release-complete", False):
+ almalinux_suffix = f'.{result["almalinux-release-complete"]}'
+
if features.has_autorelease:
autorelease_blurb_if_needed = AUTORELEASE_TEMPLATE.format(
- autorelease_number=autorelease_number
+ autorelease_number=autorelease_number,
+ almalinux_suffix=almalinux_suffix
)
used_features.append("autorelease")
else:
diff --git a/tests/rpmautospec/subcommands/test_process_distgit.py b/tests/rpmautospec/subcommands/test_process_distgit.py
index 9b049e8..11b8b48 100644
--- a/tests/rpmautospec/subcommands/test_process_distgit.py
+++ b/tests/rpmautospec/subcommands/test_process_distgit.py
@@ -124,7 +124,8 @@ def fuzz_spec_file(
new_spec_file_path.open("w", encoding="utf-8") as new,
):
if is_processed:
- autorelease_blurb = process_distgit.AUTORELEASE_TEMPLATE.format(autorelease_number=15)
+ almalinux_suffix = ""
+ autorelease_blurb = process_distgit.AUTORELEASE_TEMPLATE.format(autorelease_number=15, almalinux_suffix=almalinux_suffix)
print(
process_distgit.RPMAUTOSPEC_TEMPLATE.format(
version=__version__,
diff --git a/tests/rpmautospec/test_magic_comments.py b/tests/rpmautospec/test_magic_comments.py
index 2801cd7..7a8b7f5 100644
--- a/tests/rpmautospec/test_magic_comments.py
+++ b/tests/rpmautospec/test_magic_comments.py
@@ -26,6 +26,7 @@ def _read_commitlog_magic_comments_testdata():
MagicCommentResult(
skip_changelog=d.get("skip_changelog", False),
bump_release=d.get("bump_release", 0),
+ is_almalinux=False,
),
id=f"commit-{variant}",
)
--
2.39.5 (Apple Git-154)

View File

@ -1,3 +0,0 @@
# python-rpmautospec
The python-rpmautospec package

142
changelog
View File

@ -1,142 +0,0 @@
* Wed Jul 27 2022 Nils Philippsen <nils@redhat.com> - 0.3.0-1
- Update to 0.3.0
* Wed Jun 08 2022 Nils Philippsen <nils@redhat.com>
- Generally BR: python3-pytest-xdist, also on EL9
* Mon May 16 2022 Nils Philippsen <nils@redhat.com> - 0.2.8-1
- Update to 0.2.8
- Don't require python3-pytest-xdist for building on EL9
* Mon May 16 2022 Nils Philippsen <nils@redhat.com> - 0.2.7-1
- Update to 0.2.7
* Mon Apr 25 2022 Nils Philippsen <nils@redhat.com> - 0.2.6-1
- Update to 0.2.6
- Require python3-pytest-xdist for building
- Remove EL7 quirks, pkg isn't built there
* Fri Mar 04 2022 Nils Philippsen <nils@redhat.com>
- require python3-pyyaml for building
* Sun Nov 07 2021 Nils Philippsen <nils@redhat.com>
- require python3-babel and glibc langpacks (the latter for testing)
* Fri Aug 06 2021 Nils Philippsen <nils@redhat.com> - 0.2.5-1
- Update to 0.2.5
* Thu Aug 05 2021 Nils Philippsen <nils@redhat.com> - 0.2.4-1
- Update to 0.2.4
* Wed Jun 16 2021 Nils Philippsen <nils@redhat.com> - 0.2.3-1
- Update to 0.2.3
* Fri Jun 04 2021 Nils Philippsen <nils@redhat.com> - 0.2.2-1
- Update to 0.2.2
* Thu May 27 2021 Nils Philippsen <nils@redhat.com> - 0.2.1-1
- Update to 0.2.1
* Thu May 27 2021 Stephen Coady <scoady@redhat.com> - 0.2.0-1
- Update to 0.2.0
* Thu May 27 2021 Nils Philippsen <nils@redhat.com>
- don't ship obsolete Koji configuration snippet
* Wed May 19 2021 Nils Philippsen <nils@redhat.com>
- remove git-core, fix RPM related dependencies
* Wed May 12 2021 Nils Philippsen <nils@redhat.com>
- depend on python3-pygit2
* Thu Apr 22 2021 Nils Philippsen <nils@redhat.com>
- remove the hub plugin
* Thu Apr 15 2021 Nils Philippsen <nils@redhat.com> - 0.1.5-1
- Update to 0.1.5
- Have lowercase URLs, because Pagure d'oh
* Thu Apr 15 2021 Nils Philippsen <nils@redhat.com> - 0.1.4-1
- Update to 0.1.4
- explicitly BR: python3-setuptools
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.3-1
- Update to 0.1.3
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.2-1
- Update to 0.1.2
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.1-1
- Update to 0.1.1
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.0-1
- Update to 0.1.0
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.23-1
- Update to 0.023
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.22-1
- Update to 0.0.22
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.21-1
- Update to 0.0.21
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.20-1
- Update to 0.0.20
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.19-1
- Update to 0.0.19
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.18-1
- Update to 0.0.18
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.17-1
- Update to 0.0.17
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.16-1
- Update to 0.0.16
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.15-1
- Update to 0.0.15
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.14-1
- Update to 0.0.14
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.13-1
- Update to 0.0.13
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.12-1
- Update to 0.0.12
* Mon Apr 06 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.11-1
- Update to 0.0.11
* Fri Apr 03 2020 Nils Philippsen <nils@redhat.com> - 0.0.10-1
- Update to 0.0.10
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.9-1
- Update to 0.0.9
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.8-1
- Update to 0.0.8
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.7-1
- Update to 0.0.7
* Thu Apr 02 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.6-1
- Update to 0.0.6
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.5-1
- Update to 0.0.5
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.4-1
- Update to 0.0.4
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.3-1
- Update to 0.0.3
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.2-1
- Update to 0.0.2
* Wed Mar 18 2020 Adam Saleh <asaleh@redhat.com> - 0.0.1-1
- initial package for Fedora

View File

@ -1,3 +1,13 @@
## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 11;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}.alma.1
## END: Set by rpmautospec
# Polyfill %%bcond() macro for platforms without it
%if 0%{!?bcond:1}
%define bcond() %[ (%2)\
@ -6,8 +16,25 @@
]
%endif
# The pytest-xdist package is not available when bootstrapping or for EL builds
%bcond xdist %{undefined rhel}
# Set this to 1 when bootstrapping
%bcond bootstrap 0
%bcond tests 1
# Which packages to mask and which tests to do with native wrappers
%global wrapped_pkgs pygit2 rpm
%global wrappers_relevant_tests tests/rpmautospec/test_pkg_history.py tests/rpmautospec/subcommands/
# The pytest-xdist package is not available when bootstrapping or on RHEL
%bcond xdist %[%{without bootstrap} && %{undefined rhel}]
# Whether to build only the minimal package for RHEL buildroot
%bcond minimal %[%{defined rhel} && %{undefined epel}]
# While bootstrapping or building the minimal package, ignore manpages
%bcond manpages %[%{without bootstrap} && %{without minimal}]
# While building the minimal package, ignore shell completions
%bcond completions %{without minimal}
# Package the placeholder rpm-macros (moved to redhat-rpm-config in F40)
%if ! (0%{?fedora} >= 40 || 0%{?rhel} >= 10)
@ -16,76 +43,110 @@
%bcond rpmmacropkg 0
%endif
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} || 0%{?epel} >= 9
%bcond poetry 1
# Appease old Poetry versions (<1.2.0a2)
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} >= 38 || 0%{?rhel} >= 10
%bcond old_poetry 0
# Appease old versions of hatchling
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} >= 41 || 0%{?rhel} >= 10
%bcond old_hatchling 0
%else
%bcond old_poetry 1
%endif
%else
%bcond poetry 0
%bcond old_hatchling 1
%endif
%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} || 0%{?epel} >= 9 || 0%{?rhel} >= 10
%bcond manpage_manual_title 1
%else
%bcond manpage_manual_title 0
%endif
# Although this supports a range of libgit2 and librpm versions upstream,
# we want to ensure newer versions dont accidentally break all packages using this.
# Hence we artificially restrict the Required version to what was tested during the build.
# When libgit2/librpm soname is bumped, this package needs to be rebuilt (and tested).
%define libgit2_lower_bound 1.7
%define libgit2_upper_bound 1.10
%define libgit2_requires %(rpm -q --provides libgit2 | grep '^libgit2\.so\.' | sed 's/()(64bit)$//' | head -n 1)
%global srcname rpmautospec
Name: python-%{srcname}
Version: 0.6.5
Version: 0.8.1
%if %{with bootstrap}
Release: 0%{?dist}
%else
Release: %autorelease
%endif
Summary: Package and CLI tool to generate release fields and changelogs
License: MIT
License: MIT AND GPL-2.0-only WITH GCC-exception-2.0 AND (MIT OR GPL-2.0-or-later WITH GCC-exception-2.0)
URL: https://github.com/fedora-infra/%{srcname}
Source0: https://github.com/fedora-infra/%{srcname}/releases/download/%{version}/%{srcname}-%{version}.tar.gz
Source0: %{pypi_source %{srcname}}
Source1: rpmautospec.in
Patch1: 0001-Added-AlmaLinux-change-identifier-0.7.3.patch
%if 0%{!?pyproject_files:1}
%global pyproject_files %{_builddir}/%{name}-%{version}-%{release}.%{_arch}-pyproject-files
%endif
BuildArch: noarch
BuildRequires: argparse-manpage
BuildRequires: findutils
BuildRequires: git
# the langpacks are needed for tests
BuildRequires: glibc-langpack-de
BuildRequires: glibc-langpack-en
BuildRequires: python3-devel >= 3.9.0
# Needed to build man pages
%if %{with manpages}
BuildRequires: python3dist(click-man)
%endif
%if %{with tests}
# The dependencies needed for testing dont get auto-generated.
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pyyaml)
%if %{with xdist}
BuildRequires: python3dist(pytest-xdist)
%endif
BuildRequires: python3dist(pyyaml)
%endif
BuildRequires: sed
%if %{without poetry}
BuildRequires: python3dist(babel)
BuildRequires: python3dist(pygit2)
BuildRequires: python3dist(rpm)
BuildRequires: python3dist(rpmautospec-core)
BuildRequires: python3dist(setuptools)
%{?python_provide:%python_provide python3-%{srcname}}
%endif
BuildRequires: (libgit2 >= %libgit2_lower_bound with libgit2 < %libgit2_upper_bound)
BuildRequires: rpm-libs
BuildRequires: rpm-build-libs
%global _description %{expand:
A package and CLI tool to generate RPM release fields and changelogs.}
%description %_description
%if %{without minimal}
%package -n python3-%{srcname}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname} %_description
%pyproject_extras_subpkg -n python3-%{srcname} click
%pyproject_extras_subpkg -n python3-%{srcname} pygit2
%pyproject_extras_subpkg -n python3-%{srcname} rpm
%pyproject_extras_subpkg -n python3-%{srcname} all
%endif
%package -n %{srcname}
Summary: CLI tool for generating RPM releases and changelogs
Requires: python3-%{srcname} = %{version}-%{release}
Summary: CLI tool for generating RPM releases and changelogs
Provides: bundled(python3dist(rpmautospec)) = %{version}
Provides: bundled(python3dist(rpmautospec-core)) = %((rpm -q python3-rpmautospec-core --qf '%%{version}\n' || echo 0) | tail -n1)
%if "%libgit2_requires" != ""
Requires: (%{libgit2_requires}()(64bit) or %{libgit2_requires})
Suggests: %{libgit2_requires}()(64bit)
%else
Requires: this-is-broken-libgit2-missing-during-build
%endif
Requires: rpm-libs
Requires: rpm-build-libs
%if %{without minimal}
Recommends: python3-%{srcname} = %{version}-%{release}
Recommends: python3-%{srcname}+click = %{version}-%{release}
Recommends: python3-%{srcname}+pygit2 = %{version}-%{release}
Recommends: python3-%{srcname}+rpm = %{version}-%{release}
%endif
%description -n %{srcname}
CLI tool for generating RPM releases and changelogs
@ -101,68 +162,137 @@ enabled packages locally.
%endif
%generate_buildrequires
%if %{with poetry}
%pyproject_buildrequires
%endif
%pyproject_buildrequires %{!?with_minimal:-x all}
%prep
%autosetup -n %{srcname}-%{version}
%if %{with old_poetry}
sed -i \
-e 's/\[tool\.poetry\.group\.dev\.dependencies\]/[tool.poetry.dev-dependencies]/g' \
pyproject.toml
%autosetup -n %{srcname}-%{version} -p1
%if %{with old_hatchling}
sed -i -e 's/license-files = \(\[.*\]\)/license-files = {globs = \1}/' pyproject.toml
%endif
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -i -e '/pytest-cov/d; /addopts.*--cov/d' pyproject.toml
%build
%if %{with poetry}
%pyproject_wheel
%else
%py3_build
%endif
%install
%if %{with poetry}
%pyproject_install
%pyproject_save_files %{srcname}
# Work around poetry not listing license files as such in package metadata.
sed -i -e 's|^\(.*/LICENSE\)|%%license \1|g' %{pyproject_files}
%else
%py3_install
cat << EOF > %{pyproject_files}
%{python3_sitelib}/%{srcname}/
%{python3_sitelib}/*.egg-info/
EOF
%if %{with manpages}
# Man pages
PYTHONPATH=%{buildroot}%{python3_sitelib} click-man rpmautospec
install -m755 -d %{buildroot}%{_mandir}/man1
install -m644 man/*.1 %{buildroot}%{_mandir}/man1
%endif
install -d %{buildroot}%{_mandir}/man1
PYTHONPATH=%{buildroot}%{python3_sitelib} argparse-manpage \
%if %{with manpage_manual_title}
--manual-title "User Commands" \
%endif
--project-name rpmautospec \
--module rpmautospec.cli \
--function get_arg_parser > %{buildroot}%{_mandir}/man1/rpmautospec.1
# RPM macros
%if %{with rpmmacropkg}
mkdir -p %{buildroot}%{rpmmacrodir}
install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
install -m 644 rpm_macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
%endif
%if %{with completions}
# Shell completion
for shell_path in \
bash:%{bash_completions_dir}/rpmautospec \
fish:%{fish_completions_dir}/rpmautospec.fish \
zsh:%{zsh_completions_dir}/_rpmautospec; do
shell="${shell_path%%:*}"
path="${shell_path#*:}"
dir="${path%/*}"
install -m 755 -d "%{buildroot}${dir}"
PYTHONPATH=%{buildroot}%{python3_sitelib} \
_RPMAUTOSPEC_COMPLETE="${shell}_source" \
%{__python3} -c \
"import sys; sys.argv[0] = 'rpmautospec'; from rpmautospec.cli import cli; sys.exit(cli())" \
> "%{buildroot}${path}"
done
%endif
# Fill in the real version for the fallback method
touch -r %{buildroot}%{python3_sitelib}/rpmautospec/version.py timestamp
sed -i -e 's|0\.0\.0|%{version}|g' %{buildroot}%{python3_sitelib}/rpmautospec/version.py
touch -r timestamp %{buildroot}%{python3_sitelib}/rpmautospec/version.py
# Install bootstrapping copies of rpmautospec, rpmautospec_core packages
mkdir -p %{buildroot}%{_datadir}/rpmautospec-fallback
cp -r %{python3_sitelib}/rpmautospec_core %{buildroot}%{_datadir}/rpmautospec-fallback/
cp -r %{buildroot}%{python3_sitelib}/rpmautospec %{buildroot}%{_datadir}/rpmautospec-fallback/
find %{buildroot}%{_datadir}/rpmautospec-fallback \
-depth -type d -a -name __pycache__ -exec rm -r {} \;
# Override the standard executable with a custom one that knows how to fall back
sed -e 's|@PYTHON3@|%{python3} -%{py3_shebang_flags}|g; s|@DATADIR@|%{_datadir}|g' \
< %{S:1} \
> %{buildroot}%{_bindir}/rpmautospec
chmod 755 %{buildroot}%{_bindir}/rpmautospec
touch -r %{S:1} %{buildroot}%{_bindir}/rpmautospec
%check
%pytest -v \
# Always run the import checks, even when other tests are disabled
%pyproject_check_import %{?with_minimal:-e '*click*'}
%if %{with tests}
%if %{without minimal}
%pytest \
%if %{with xdist}
--numprocesses=auto
%endif
%endif
%if ! 0%{?rhel} || 0%{?rhel} >= 10
# And redo tests that are relevant for native bindings, but with the direct native wrappers, but not
# on EL <= 9 because the tests somehow run out of file descriptors.
# Poison the official package names…
mkdir -p poison-pill
for mod in %wrapped_pkgs; do
echo "raise ImportError" > "poison-pill/${mod}.py"
if PYTHONPATH="$PWD/poison-pill:$PYTHONPATH" %__python3 -c "import ${mod}" 2>/dev/null; then
echo "Failed to poison-pill ${mod}!" >&2
exit 1
fi
done
%py3_test_envvars \
PYTHONPATH="$PWD/poison-pill:$PYTHONPATH" \
%__pytest \
%if %{with xdist}
--numprocesses=auto \
%endif
%wrappers_relevant_tests
%endif
%endif
%if %{without minimal}
%files -n python3-%{srcname} -f %{pyproject_files}
%doc README.rst
%endif
%files -n %{srcname}
%{_bindir}/rpmautospec
%{_mandir}/man1/rpmautospec.1*
%{_datadir}/rpmautospec-fallback
%if %{with manpages}
%{_mandir}/man1/rpmautospec*.1*
%endif
%if %{with completions}
%dir %{bash_completions_dir}
%{bash_completions_dir}/rpmautospec
%dir %{fish_completions_dir}
%{fish_completions_dir}/rpmautospec.fish
%dir %{zsh_completions_dir}
%{zsh_completions_dir}/_rpmautospec
%endif
%if %{with minimal}
%license licenses/*
%exclude %{python3_sitelib}
%endif
%if %{with rpmmacropkg}
%files -n rpmautospec-rpm-macros
@ -170,4 +300,304 @@ install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
%endif
%changelog
%autochangelog
## START: Generated by rpmautospec
* Mon Jun 16 2025 Eduard Abdullin <eabdullin@almalinux.org> - 0.8.1-8.alma.1
- AlmaLinux change: Add AlmaLinux OS change identifier
* Wed Apr 16 2025 Miro Hrončok <miro@hroncok.cz> - 0.8.1-8
- Generate BuildRequires for extras, drop unused click-plugins dependency
* Wed Apr 16 2025 Miro Hrončok <miro@hroncok.cz> - 0.8.1-7
- On RHEL, only build the minimal package
* Wed Apr 16 2025 Miro Hrončok <miro@hroncok.cz> - 0.8.1-6
- Make sure only one libgit2 package is BuildRequired during the build
* Tue Apr 15 2025 Miro Hrončok <miro@hroncok.cz> - 0.8.1-5
- Add bundled() provides for bundled self and rpmautospec-core
* Tue Apr 15 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 0.8.1-4
- Drop pyproject_macros conditional
* Mon Apr 14 2025 Nils Philippsen <nils@redhat.com> - 0.8.1-2
- Pin libgit2 to soname version tested during build
* Tue Apr 08 2025 Nils Philippsen <nils@redhat.com> - 0.8.1-1
- Update to 0.8.1
* Tue Apr 08 2025 Miro Hrončok <miro@hroncok.cz> - 0.8.0-4
- Stop trying to Require libraries with %%_isa
* Tue Apr 08 2025 Miro Hrončok <miro@hroncok.cz> - 0.8.0-3
- Add missing flags to /usr/bin/rpmautospec shebang
* Tue Apr 08 2025 Nils Philippsen <nils@redhat.com> - 0.8.0-1
- Update to 0.8.0
- Update license
- Make using click, pygit2, rpm Python packages optional and enable
fallbacks
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Oct 11 2024 Nils Philippsen <nils@redhat.com> - 0.7.3-1
- Update to 0.7.3
* Fri Sep 20 2024 Yaakov Selkowitz <yselkowi@redhat.com> - 0.7.2-2
- Fix build without poetry
* Fri Aug 30 2024 Nils Philippsen <nils@redhat.com> - 0.7.2-1
- Update to 0.7.2
* Wed Aug 21 2024 Miro Hrončok <miro@hroncok.cz> - 0.7.1-3
- Bootstrap build: Remove a bogus changelog
* Tue Aug 20 2024 Stephen Gallagher <sgallagh@redhat.com> - 0.7.1-2
- Enable bootstrapping macros
* Tue Aug 13 2024 Nils Philippsen <nils@redhat.com> - 0.7.1-1
- Update to 0.7.1
* Mon Aug 12 2024 Nils Philippsen <nils@redhat.com> - 0.7.0-1
- Update to 0.7.0
- Split off man pages for sub-commands
- Ship scriptlets needed for shell completion
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Jun 18 2024 Nils Philippsen <nils@redhat.com> - 0.6.5-1
- Update to 0.6.5
* Tue Jun 11 2024 Python Maint <python-maint@redhat.com> - 0.6.4-2
- Rebuilt for Python 3.13
* Mon Jun 10 2024 Nils Philippsen <nils@redhat.com> - 0.6.4-1
- Update to 0.6.4
- Install man page
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.6.3-2
- Rebuilt for Python 3.13
* Wed Feb 21 2024 Nils Philippsen <nils@redhat.com> - 0.6.3-1
- Update to 0.6.3
* Mon Feb 19 2024 Nils Philippsen <nils@redhat.com> - 0.6.2-1
- Update to 0.6.2
* Fri Feb 09 2024 Nils Philippsen <nils@redhat.com> - 0.6.1-1
- Update to 0.6.1
* Sat Jan 27 2024 Nils Philippsen <nils@redhat.com> - 0.6.0-1
- Update to 0.6.0
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Jan 16 2024 Nils Philippsen <nils@redhat.com> - 0.5.1-1
- Update to 0.5.1
* Mon Jan 15 2024 Nils Philippsen <nils@redhat.com> - 0.5.0-1
- Update to 0.5.0
* Thu Jan 11 2024 Nils Philippsen <nils@redhat.com> - 0.4.2-1
- Update to 0.4.2
* Mon Jan 08 2024 Nils Philippsen <nils@redhat.com> - 0.4.1-2
- Update patch for old poetry versions
* Fri Dec 15 2023 Nils Philippsen <nils@redhat.com> - 0.4.1-1
- Update to 0.4.1
* Sun Dec 03 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.4.0-2
- Drop unwanted python-pytest-cov dependency
* Thu Nov 30 2023 Nils Philippsen <nils@redhat.com> - 0.4.0-1
- Update to 0.4.0
* Tue Nov 14 2023 Nils Philippsen <nils@redhat.com> - 0.3.8-1
- Update to 0.3.8
* Tue Nov 14 2023 Nils Philippsen <nils@redhat.com> - 0.3.7-1
- Update to 0.3.7
* Tue Nov 14 2023 Nils Philippsen <nils@redhat.com> - 0.3.6-1
- Update to 0.3.6
* Tue Aug 22 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.3.5-5
- Disable the macros subpackage in F40+
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 0.3.5-3
- Rebuilt for Python 3.12
* Wed May 24 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.3.5-2
- Avoid pytest-cov, disable xdist in RHEL builds
* Wed Feb 08 2023 Nils Philippsen <nils@redhat.com> - 0.3.5-1
- Update to 0.3.5
* Wed Feb 08 2023 Nils Philippsen <nils@redhat.com> - 0.3.4-1
- Update to 0.3.4
* Wed Feb 08 2023 Nils Philippsen <nils@redhat.com> - 0.3.3-1
- Update to 0.3.3
* Tue Jan 24 2023 Nils Philippsen <nils@redhat.com> - 0.3.2-1
- Update to 0.3.2
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Nov 11 2022 Nils Philippsen <nils@redhat.com> - 0.3.1-1
- Update to 0.3.1
* Wed Jul 27 2022 Nils Philippsen <nils@redhat.com> - 0.3.0-1
- Update to 0.3.0
* Wed Jun 08 2022 Nils Philippsen <nils@redhat.com>
- Generally BR: python3-pytest-xdist, also on EL9
* Mon May 16 2022 Nils Philippsen <nils@redhat.com> - 0.2.8-1
- Update to 0.2.8
- Don't require python3-pytest-xdist for building on EL9
* Mon May 16 2022 Nils Philippsen <nils@redhat.com> - 0.2.7-1
- Update to 0.2.7
* Mon Apr 25 2022 Nils Philippsen <nils@redhat.com> - 0.2.6-1
- Update to 0.2.6
- Require python3-pytest-xdist for building
- Remove EL7 quirks, pkg isn't built there
* Fri Mar 04 2022 Nils Philippsen <nils@redhat.com>
- require python3-pyyaml for building
* Sun Nov 07 2021 Nils Philippsen <nils@redhat.com>
- require python3-babel and glibc langpacks (the latter for testing)
* Fri Aug 06 2021 Nils Philippsen <nils@redhat.com> - 0.2.5-1
- Update to 0.2.5
* Thu Aug 05 2021 Nils Philippsen <nils@redhat.com> - 0.2.4-1
- Update to 0.2.4
* Wed Jun 16 2021 Nils Philippsen <nils@redhat.com> - 0.2.3-1
- Update to 0.2.3
* Fri Jun 04 2021 Nils Philippsen <nils@redhat.com> - 0.2.2-1
- Update to 0.2.2
* Thu May 27 2021 Nils Philippsen <nils@redhat.com> - 0.2.1-1
- Update to 0.2.1
* Thu May 27 2021 Stephen Coady <scoady@redhat.com> - 0.2.0-1
- Update to 0.2.0
* Thu May 27 2021 Nils Philippsen <nils@redhat.com>
- don't ship obsolete Koji configuration snippet
* Wed May 19 2021 Nils Philippsen <nils@redhat.com>
- remove git-core, fix RPM related dependencies
* Wed May 12 2021 Nils Philippsen <nils@redhat.com>
- depend on python3-pygit2
* Thu Apr 22 2021 Nils Philippsen <nils@redhat.com>
- remove the hub plugin
* Thu Apr 15 2021 Nils Philippsen <nils@redhat.com> - 0.1.5-1
- Update to 0.1.5
- Have lowercase URLs, because Pagure d'oh
* Thu Apr 15 2021 Nils Philippsen <nils@redhat.com> - 0.1.4-1
- Update to 0.1.4
- explicitly BR: python3-setuptools
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.3-1
- Update to 0.1.3
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.2-1
- Update to 0.1.2
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.1-1
- Update to 0.1.1
* Thu Apr 09 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.1.0-1
- Update to 0.1.0
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.23-1
- Update to 0.023
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.22-1
- Update to 0.0.22
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.21-1
- Update to 0.0.21
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.20-1
- Update to 0.0.20
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.19-1
- Update to 0.0.19
* Wed Apr 08 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.18-1
- Update to 0.0.18
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.17-1
- Update to 0.0.17
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.16-1
- Update to 0.0.16
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.15-1
- Update to 0.0.15
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.14-1
- Update to 0.0.14
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.13-1
- Update to 0.0.13
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.12-1
- Update to 0.0.12
* Mon Apr 06 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.11-1
- Update to 0.0.11
* Fri Apr 03 2020 Nils Philippsen <nils@redhat.com> - 0.0.10-1
- Update to 0.0.10
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.9-1
- Update to 0.0.9
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.8-1
- Update to 0.0.8
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.7-1
- Update to 0.0.7
* Thu Apr 02 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.6-1
- Update to 0.0.6
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.5-1
- Update to 0.0.5
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.4-1
- Update to 0.0.4
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.3-1
- Update to 0.0.3
* Tue Mar 31 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.2-1
- Update to 0.0.2
* Wed Mar 18 2020 Adam Saleh <asaleh@redhat.com> - 0.0.1-1
- initial package for Fedora
## END: Generated by rpmautospec

12
rpmautospec.in Executable file
View File

@ -0,0 +1,12 @@
#!@PYTHON3@
import sys
try:
from rpmautospec import cli
except ImportError:
sys.path.insert(0, "@DATADIR@/rpmautospec-fallback")
sys.dont_write_bytecode = True
from rpmautospec import cli
sys.exit(cli.cli())

View File

@ -1 +1 @@
SHA512 (rpmautospec-0.6.5.tar.gz) = 4740a471d25896314cbb37ab7a34d24fa7d3b6512ea4d5d7444528e0669bca79cb23a180b8a591378a40e832df4a6673ac20930f38672d268d9c70fb49748771
6734e148a6eb2b18742570a008e13a2eb70df976 rpmautospec-0.8.1.tar.gz