Blob Blame History Raw
%global srcname b4

%if 0%{?fedora}
%bcond_without attest
# some attestation dependencies not in EPEL
%bcond_with attest

Name:           python-%{srcname}
Version:        0.12.2
Release:        %autorelease
Summary:        A helper tool to work with public-inbox and patch series
License:        GPL-2.0-or-later
URL:  {srcname}/%{srcname}.git
Source2:        gpgkey-DE0E66E32F1FDD0902666B96E63EDCA9329DD07E.asc

BuildArch:      noarch

BuildRequires:  gnupg2
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python3dist(pytest)

# Require manually until it provides python3dist(git-filter-repo)
# https://src.fedoraproject.orae57d6eg/rpms/git-filter-repo/pull-request/1
BuildRequires:  git-filter-repo > 2.30
Requires:       git-filter-repo > 2.30

%global _description %{expand:
B4 is a helper utility to work with patches made available via a public-inbox
archive like It is written to make it easier to participate in
a patch-based workflows, like those used in the Linux kernel development.}

%description %{_description}

%package -n %{srcname}
Summary:        %{summary}
Provides:       python%{python3_pkgversion}-%{srcname} = %{version}-%{release}

%description -n %{srcname} %{_description}

xz -dc '%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data=-
%autosetup -p1 -n %{srcname}-%{version}

# Disable attestation (only applicable to EPEL)
%if %{without attest}
sed -Ei -e '/^# These are optional, needed for attestation/d' \
    -e "/^ *'?(dnspython|dkimpy|patatt)/d" requirements.txt

# Avoid python3dist(git-filter-repo) requirement
sed -Ei "/^ *'?git-filter-repo/d" requirements.txt

%pyproject_buildrequires -r requirements.txt


%pyproject_save_files %{srcname}


%files -n %{srcname} -f %{pyproject_files}
%license COPYING
%doc README.rst