2022-07-27 09:53:35 +00:00
|
|
|
# when bootstrapping Python, pytest-xdist is not yet available
|
2023-05-24 18:03:48 +00:00
|
|
|
%bcond xdist %{undefined rhel}
|
2022-05-15 11:38:39 +00:00
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
%global srcname rpmautospec
|
|
|
|
|
|
|
|
Name: python-rpmautospec
|
2023-02-08 19:51:26 +00:00
|
|
|
Version: 0.3.5
|
2022-11-10 09:04:59 +00:00
|
|
|
Release: %autorelease
|
2020-04-02 13:32:04 +00:00
|
|
|
Summary: Package and CLI tool to generate release fields and changelogs
|
|
|
|
|
|
|
|
License: MIT
|
2021-04-15 10:43:21 +00:00
|
|
|
URL: https://pagure.io/fedora-infra/rpmautospec
|
|
|
|
Source0: https://releases.pagure.org/fedora-infra/rpmautospec/rpmautospec-%{version}.tar.gz
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
BuildArch: noarch
|
2022-04-25 12:12:32 +00:00
|
|
|
BuildRequires: git
|
|
|
|
# the langpacks are needed for tests
|
|
|
|
BuildRequires: glibc-langpack-de
|
|
|
|
BuildRequires: glibc-langpack-en
|
2020-04-02 13:32:04 +00:00
|
|
|
BuildRequires: python3-devel >= 3.6.0
|
2020-10-13 14:28:42 +00:00
|
|
|
BuildRequires: python3-setuptools
|
2020-04-02 13:32:04 +00:00
|
|
|
BuildRequires: koji
|
2022-04-25 12:12:32 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-babel
|
2020-04-02 13:32:04 +00:00
|
|
|
BuildRequires: python3-koji
|
2021-05-27 15:25:34 +00:00
|
|
|
BuildRequires: python3-pygit2
|
2020-04-02 13:32:04 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-pytest
|
2022-05-15 11:38:39 +00:00
|
|
|
%if %{with xdist}
|
2022-04-25 12:12:32 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-pytest-xdist
|
2022-05-15 11:38:39 +00:00
|
|
|
%endif
|
2022-04-25 12:12:32 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-pyyaml
|
2020-04-02 13:32:04 +00:00
|
|
|
|
2021-05-27 15:25:34 +00:00
|
|
|
Obsoletes: koji-hub-plugin-rpmautospec < 0.1.5-2
|
|
|
|
Conflicts: koji-hub-plugin-rpmautospec < 0.1.5-2
|
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
%global _description %{expand:
|
|
|
|
A package and CLI tool to generate RPM release fields and changelogs.}
|
|
|
|
|
|
|
|
%description %_description
|
|
|
|
|
|
|
|
# package the library
|
|
|
|
|
|
|
|
%package -n python3-%{srcname}
|
|
|
|
Summary: %{summary}
|
|
|
|
%{?python_provide:%python_provide python3-%{srcname}}
|
|
|
|
|
|
|
|
Requires: koji
|
2022-04-25 12:12:32 +00:00
|
|
|
Requires: python3-babel
|
2020-04-02 13:32:04 +00:00
|
|
|
Requires: python3-koji
|
2021-05-27 15:25:34 +00:00
|
|
|
Requires: python3-pygit2
|
|
|
|
Requires: rpm
|
|
|
|
# for "rpm --specfile"
|
|
|
|
Requires: rpm-build >= 4.9
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
%description -n python3-%{srcname} %_description
|
|
|
|
|
|
|
|
# Note that there is no %%files section for the unversioned python module
|
|
|
|
%files -n python3-%{srcname}
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.rst
|
|
|
|
%{python3_sitelib}/%{srcname}-*.egg-info
|
|
|
|
%{python3_sitelib}/%{srcname}/
|
|
|
|
|
|
|
|
# package the cli tool
|
|
|
|
|
|
|
|
%package -n %{srcname}
|
|
|
|
Summary: CLI tool for generating RPM releases and changelogs
|
|
|
|
Requires: python3-%{srcname} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n %{srcname}
|
|
|
|
CLI tool for generating RPM releases and changelogs
|
|
|
|
|
|
|
|
%files -n %{srcname}
|
|
|
|
%{_bindir}/rpmautospec
|
|
|
|
|
|
|
|
# package the Koji plugins
|
|
|
|
|
|
|
|
%package -n koji-builder-plugin-rpmautospec
|
|
|
|
Summary: Koji plugin for generating RPM releases and changelogs
|
|
|
|
Requires: python3-%{srcname} = %{version}-%{release}
|
|
|
|
Requires: python3-koji
|
|
|
|
Requires: koji-builder-plugins
|
|
|
|
|
|
|
|
%description -n koji-builder-plugin-rpmautospec
|
|
|
|
A Koji plugin for generating RPM releases and changelogs.
|
|
|
|
|
|
|
|
%files -n koji-builder-plugin-rpmautospec
|
|
|
|
%{_prefix}/lib/koji-builder-plugins/*
|
|
|
|
|
2020-04-09 11:55:00 +00:00
|
|
|
# Package the placeholder rpm-macros
|
|
|
|
|
|
|
|
%package -n rpmautospec-rpm-macros
|
|
|
|
Summary: Rpmautospec RPM macros for local rpmbuild
|
|
|
|
Requires: rpm
|
|
|
|
|
|
|
|
%description -n rpmautospec-rpm-macros
|
|
|
|
RPM macros with placeholders for building rpmautospec enabled packages localy
|
|
|
|
|
|
|
|
%files -n rpmautospec-rpm-macros
|
|
|
|
%{rpmmacrodir}/macros.rpmautospec
|
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
#--------------------------------------------------------
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n %{srcname}-%{version}
|
2020-04-03 15:52:33 +00:00
|
|
|
# The python3-koji package doesn't declare itself properly, so we may not depend on it when
|
|
|
|
# installed as an RPM.
|
2020-04-03 16:13:24 +00:00
|
|
|
sed -i /koji/d requirements.txt
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%py3_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%py3_install
|
2021-05-27 15:25:34 +00:00
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/koji-builder-plugins/
|
|
|
|
install -m 0644 koji_plugins/rpmautospec_builder.py \
|
|
|
|
%{buildroot}%{_prefix}/lib/koji-builder-plugins/
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
%py_byte_compile %{python3} %{buildroot}%{_prefix}/lib/koji-builder-plugins/
|
|
|
|
|
2020-04-09 11:55:00 +00:00
|
|
|
# RPM macros
|
|
|
|
mkdir -p %{buildroot}%{rpmmacrodir}
|
|
|
|
install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
|
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
%check
|
2023-05-24 18:03:48 +00:00
|
|
|
%pytest \
|
2022-05-15 11:38:39 +00:00
|
|
|
%if %{with xdist}
|
|
|
|
--numprocesses=auto
|
|
|
|
%endif
|
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
%changelog
|
2022-11-10 09:04:59 +00:00
|
|
|
%autochangelog
|