summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-02-17 09:08:57 +0000
committerCoprDistGit <infra@openeuler.org>2025-02-17 09:08:57 +0000
commit304d8265d24550d4a85b58b6f43f90bbd8637e6f (patch)
treed6aa0c838fad6f414108059173d2a3c8c702d41f
parent7a93e13b9e8cd0260ffa77769b97f36b2bdc3f98 (diff)
automatic import of python-rpmautospecopeneuler24.03_LTS_SP1
-rw-r--r--.gitignore1
-rw-r--r--python-rpmautospec.spec139
-rw-r--r--sources1
3 files changed, 141 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..2ccd43e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/rpmautospec-0.3.5.tar.gz
diff --git a/python-rpmautospec.spec b/python-rpmautospec.spec
new file mode 100644
index 0000000..d9842a9
--- /dev/null
+++ b/python-rpmautospec.spec
@@ -0,0 +1,139 @@
+# when bootstrapping Python, pytest-xdist is not yet available
+%bcond_without xdist
+
+%global srcname rpmautospec
+%global run_check 0
+
+Name: python-rpmautospec
+Version: 0.3.5
+Release: 1
+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: git
+# the langpacks are needed for tests
+BuildRequires: glibc-langpack-de
+BuildRequires: glibc-langpack-en
+BuildRequires: python3-devel >= 3.6.0
+BuildRequires: python3-setuptools
+BuildRequires: koji
+BuildRequires: python%{python3_pkgversion}-babel
+BuildRequires: python3-koji
+BuildRequires: python3-pygit2
+BuildRequires: python%{python3_pkgversion}-pytest
+BuildRequires: python%{python3_pkgversion}-pytest-cov
+%if %{with xdist}
+BuildRequires: python%{python3_pkgversion}-pytest-xdist
+%endif
+BuildRequires: python%{python3_pkgversion}-pyyaml
+
+Obsoletes: koji-hub-plugin-rpmautospec < 0.1.5-2
+Conflicts: koji-hub-plugin-rpmautospec < 0.1.5-2
+
+%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
+Requires: python3-babel
+Requires: python3-koji
+Requires: python3-pygit2
+Requires: rpm
+# for "rpm --specfile"
+Requires: rpm-build >= 4.9
+
+%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/*
+
+# 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
+
+#--------------------------------------------------------
+
+%prep
+%autosetup -n %{srcname}-%{version}
+# The python3-koji package doesn't declare itself properly, so we may not depend on it when
+# installed as an RPM.
+sed -i /koji/d requirements.txt
+
+%build
+%py3_build
+
+%install
+%py3_install
+mkdir -p %{buildroot}%{_prefix}/lib/koji-builder-plugins/
+install -m 0644 koji_plugins/rpmautospec_builder.py \
+ %{buildroot}%{_prefix}/lib/koji-builder-plugins/
+
+%py_byte_compile %{__python3} %{buildroot}%{_prefix}/lib/koji-builder-plugins/
+
+# RPM macros
+mkdir -p %{buildroot}%{rpmmacrodir}
+install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/
+
+# check need run as non-root
+%check
+%if 0%{?run_check}
+PYTHONPATH="%{buildroot}%{python3_sitelib}" \
+%{__python3} -m pytest \
+%if %{with xdist}
+--numprocesses=auto
+%endif
+%endif
+
+
+%changelog
+* Mon Mar 27 2023 lichaoran <pkwarcraft@hotmail.com> - 0.3.5-1
+- initial package
diff --git a/sources b/sources
new file mode 100644
index 0000000..5797c97
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+dc761c8145cd125792bab53fd927f1d1 rpmautospec-0.3.5.tar.gz