2020-04-02 13:32:04 +00:00
|
|
|
%global srcname rpmautospec
|
|
|
|
|
|
|
|
# Up to EL7, the Koji hub plugin is run under Python 2.x and Python files in private directories
|
|
|
|
# would be byte-compiled.
|
|
|
|
%if ! 0%{?rhel} || 0%{?rhel} > 7
|
|
|
|
%bcond_with epel_le_7
|
|
|
|
%else
|
|
|
|
%bcond_without epel_le_7
|
|
|
|
# We don't want to byte-compile Python files in private directories, i.e. the Koji plugins. As a
|
|
|
|
# side effect, this doesn't byte-compile Python files in the system locations either, huzzah!
|
|
|
|
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Name: python-rpmautospec
|
2020-04-07 12:51:07 +00:00
|
|
|
Version: 0.0.15
|
2020-04-03 16:06:02 +00:00
|
|
|
Release: 1%{?dist}
|
2020-04-02 13:32:04 +00:00
|
|
|
Summary: Package and CLI tool to generate release fields and changelogs
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
URL: https://pagure.io/Fedora-Infra/rpmautospec
|
|
|
|
Source0: https://releases.pagure.org/Fedora-Infra/rpmautospec/rpmautospec-%{version}.tar.gz
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: python3-devel >= 3.6.0
|
|
|
|
%if %{with epel_le_7}
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
%endif
|
|
|
|
# EPEL7 does not have python3-koji and the other dependencies here are only
|
|
|
|
# needed in the buildroot for the tests, which can't run because of the lack of
|
|
|
|
# python3-koji
|
|
|
|
%if ! %{with epel_le_7}
|
|
|
|
BuildRequires: koji
|
|
|
|
BuildRequires: python3-koji
|
|
|
|
BuildRequires: python%{python3_pkgversion}-pytest
|
2020-04-02 16:17:23 +00:00
|
|
|
BuildRequires: python%{python3_pkgversion}-pytest-cov
|
2020-04-02 13:32:04 +00:00
|
|
|
BuildRequires: git
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%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
|
2020-04-06 14:45:00 +00:00
|
|
|
Requires: git-core
|
2020-04-02 13:32:04 +00:00
|
|
|
Requires: python3-rpm
|
|
|
|
Requires: python3-koji
|
|
|
|
|
|
|
|
%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}
|
2020-04-07 09:26:49 +00:00
|
|
|
# We add this require here and not in python3-rpmautospec because we do not want
|
|
|
|
# it on the builders, the hub and builders plugins will work fine without it but
|
|
|
|
# we need this in the chroot or when packagers run the CLI on their machines.
|
|
|
|
Requires: rpm-build
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
%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-06 14:45:00 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/kojid/plugins/rpmautospec.conf
|
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
%package -n koji-hub-plugin-rpmautospec
|
|
|
|
Summary: Koji plugin for tagging successful builds in dist-git
|
|
|
|
%if ! %{with epel_le_7}
|
|
|
|
Requires: python3-%{srcname} = %{version}-%{release}
|
|
|
|
Requires: python3-koji
|
|
|
|
%endif
|
|
|
|
Requires: koji-hub-plugins
|
|
|
|
|
|
|
|
%description -n koji-hub-plugin-rpmautospec
|
|
|
|
A Koji plugin for tagging successful builds in their dist-git repository.
|
|
|
|
|
|
|
|
%files -n koji-hub-plugin-rpmautospec
|
|
|
|
%if %{with epel_le_7}
|
|
|
|
%{python2_sitelib}/rpmautospec/
|
|
|
|
%endif
|
|
|
|
%{_prefix}/lib/koji-hub-plugins/*
|
|
|
|
|
2020-04-06 14:45:00 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/koji-hub/plugins/rpmautospec.conf
|
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
|
|
|
|
for plugin_type in builder hub; do
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/koji-${plugin_type}-plugins/
|
|
|
|
install -m 0644 koji_plugins/rpmautospec_${plugin_type}.py \
|
|
|
|
%{buildroot}%{_prefix}/lib/koji-${plugin_type}-plugins/
|
|
|
|
done
|
|
|
|
|
|
|
|
%if %{with epel_le_7}
|
|
|
|
# the hub-plugin py2 tagging library
|
|
|
|
# Install the py2compat files to the koji-hub-plugin
|
|
|
|
mkdir -p %{buildroot}%{python2_sitelib}/rpmautospec/py2compat/
|
|
|
|
touch %{buildroot}%{python2_sitelib}/rpmautospec/__init__.py \
|
|
|
|
%{buildroot}%{python2_sitelib}/rpmautospec/py2compat/__init__.py
|
|
|
|
install -m 0644 rpmautospec/py2compat/tagging.py \
|
|
|
|
%{buildroot}%{python2_sitelib}/rpmautospec/py2compat/
|
|
|
|
|
|
|
|
# EL <= 7: Byte-compile all the things
|
|
|
|
%py_byte_compile %{python3} %{buildroot}%{python3_sitelib}
|
|
|
|
%py_byte_compile %{python2} %{buildroot}%{python2_sitelib}
|
|
|
|
%py_byte_compile %{python2} %{buildroot}%{_prefix}/lib/koji-hub-plugins/
|
|
|
|
%else
|
|
|
|
# EL > 7, Fedora
|
|
|
|
%py_byte_compile %{python3} %{buildroot}%{_prefix}/lib/koji-hub-plugins/
|
|
|
|
%endif
|
|
|
|
%py_byte_compile %{python3} %{buildroot}%{_prefix}/lib/koji-builder-plugins/
|
|
|
|
|
2020-04-06 14:45:00 +00:00
|
|
|
# configuration shared by the plugins
|
|
|
|
for dest in kojid koji-hub; do
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/$dest/plugins/
|
|
|
|
install -m 0644 koji_plugins/rpmautospec.conf \
|
|
|
|
%{buildroot}%{_sysconfdir}/$dest/plugins/rpmautospec.conf
|
|
|
|
done
|
2020-04-02 13:32:04 +00:00
|
|
|
|
|
|
|
# EPEL7 does not have python3-koji which is needed to run the tests, so there
|
|
|
|
# is no point in running them
|
|
|
|
%if ! 0%{?rhel} || 0%{?rhel} > 7
|
|
|
|
%check
|
|
|
|
%{__python3} -m pytest
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|
2020-04-07 12:51:07 +00:00
|
|
|
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.15-1
|
|
|
|
- Update to 0.0.15
|
|
|
|
|
2020-04-07 10:22:14 +00:00
|
|
|
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.14-1
|
|
|
|
- Update to 0.0.14
|
|
|
|
|
2020-04-07 10:06:04 +00:00
|
|
|
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.13-1
|
|
|
|
- Update to 0.0.13
|
|
|
|
|
2020-04-07 09:26:49 +00:00
|
|
|
* Tue Apr 07 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.12-1
|
|
|
|
- Update to 0.0.12
|
|
|
|
|
2020-04-06 14:45:00 +00:00
|
|
|
* Mon Apr 06 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.11-1
|
|
|
|
- Update to 0.0.11
|
|
|
|
|
2020-04-03 17:42:56 +00:00
|
|
|
* Fri Apr 03 2020 Nils Philippsen <nils@redhat.com> - 0.0.10-1
|
|
|
|
- Update to 0.0.10
|
|
|
|
|
2020-04-03 16:06:02 +00:00
|
|
|
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.9-1
|
|
|
|
- Update to 0.0.9
|
2020-04-03 15:52:33 +00:00
|
|
|
|
2020-04-03 15:13:55 +00:00
|
|
|
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.8-1
|
|
|
|
- Update to 0.0.8
|
|
|
|
|
2020-04-03 14:16:55 +00:00
|
|
|
* Fri Apr 03 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.7-1
|
|
|
|
- Update to 0.0.7
|
|
|
|
|
2020-04-02 16:17:23 +00:00
|
|
|
* Thu Apr 02 2020 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.0.6-1
|
|
|
|
- Update to 0.0.6
|
|
|
|
|
2020-04-02 13:32:04 +00:00
|
|
|
* 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
|