From 5dceedc6b1105bb7ca2f9242a3d8bf8b611d61b3 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Fri, 24 Mar 2023 06:30:09 +0000 Subject: automatic import of rpkg --- rpkg.spec | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 rpkg.spec (limited to 'rpkg.spec') diff --git a/rpkg.spec b/rpkg.spec new file mode 100644 index 0000000..b3715cc --- /dev/null +++ b/rpkg.spec @@ -0,0 +1,251 @@ +Name: rpkg +Version: 1.66 +Release: 1 + +Summary: Python library for interacting with rpm+git +License: GPLv2+ and LGPLv2 +URL: https://pagure.io/rpkg +BuildArch: noarch +Source0: https://pagure.io/releases/rpkg/%{name}-%{version}.tar.gz + +# Disable python2 build by default +%global with_python2 0 +# Enable python3 build by default +%global with_python3 1 + + +# Fix for bug 1579367 +# Due to https://pagure.io/koji/issue/912, python[23]-koji package does not +# have egginfo. +# rpm-py-installer is required as a proxy to install RPM python binding +# library, so rpm is the actual requirement that must be present in the +# requires.txt. But, rpkg has to work in all active Fedora and EPEL releases, +# and there is only old rpm-python package in EL6 and 7, so just simply to +# remove rpm-py-installer for now. +Patch0: remove-koji-and-rpm-py-installer-from-requires.patch +Patch1: 0001-Do-not-use-pytest-related-dependencies-temporarily.patch +Patch2: 0002-Remove-pytest-coverage-execution.patch +%if 0%{?with_python2} +Patch3: 0003-Remove-Environment-Markers-syntax.patch +%endif +Patch4: 0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch +Patch5: 0005-container-build-update-signing-intent-help-for-OSBS-.patch +Patch6: 0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch + +%description +Python library for interacting with rpm+git + + +%if 0%{?with_python2} +%package -n python2-%{name} +Summary: %{summary} +%{?python_provide:%python_provide python2-%{name}} + +BuildRequires: python2-devel + +# We br these things for man page generation due to imports +BuildRequires: rpmlint +BuildRequires: rpmdevtools +BuildRequires: python2-koji >= 1.21 +BuildRequires: python2-cccolutils +BuildRequires: PyYAML +BuildRequires: GitPython +BuildRequires: python-pycurl +BuildRequires: python-requests +BuildRequires: python-requests-kerberos +BuildRequires: python-six >= 1.9.0 +BuildRequires: python2-argcomplete +BuildRequires: python2-mock +BuildRequires: python2-nose +BuildRequires: python2-setuptools + +Requires: mock +Requires: redhat-rpm-config +Requires: rpm-build +Requires: rpmlint +Requires: rpmdevtools +Requires: python2-argcomplete +Requires: python2-cccolutils +Requires: python2-koji >= 1.21 +Requires: PyYAML +Requires: GitPython >= 0.2.0 +Requires: python-pycurl +Requires: python-requests +Requires: python-requests-kerberos +Requires: python-six >= 1.9.0 +Requires: rpm-python + +Requires: %{name}-common = %{version}-%{release} + +Conflicts: fedpkg < 1.26 + +# Backward compatibility with capability pyrpkg +Provides: pyrpkg = %{version}-%{release} +# All old versions before 1.49-1 should not be used anymore +Obsoletes: pyrpkg < 1.49-2 + + +%description -n python2-%{name} +A python library for managing RPM package sources in a git repository. +%endif +# end of python2 section + + +%if 0%{?with_python3} +%package -n python3-%{name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{name}} +# Obsolete python2-rpkg (remove after Fedora29) +%if 0%{?with_python2} == 0 +Obsoletes: python2-rpkg < %{version}-%{release} +%endif + +BuildRequires: python3-devel +BuildRequires: python3-GitPython +BuildRequires: python3-koji >= 1.24 +%if 0%{?rhel} +BuildRequires: python3-gobject-base +BuildRequires: libmodulemd +BuildRequires: python3-requests-kerberos +%else +BuildRequires: python3-libmodulemd +%endif +BuildRequires: python3-argcomplete +BuildRequires: python3-cccolutils +BuildRequires: python3-openidc-client +BuildRequires: python3-pycurl +BuildRequires: python3-six >= 1.9.0 +BuildRequires: python3-requests +BuildRequires: python3-setuptools +BuildRequires: python3-pytest +BuildRequires: python3-PyYAML +BuildRequires: rpmlint +BuildRequires: rpmdevtools + +Requires: mock +Requires: redhat-rpm-config +Requires: rpm-build +Requires: rpmlint +Requires: rpmdevtools + +Requires: python3-argcomplete +Requires: python3-GitPython >= 0.2.0 +Requires: python3-cccolutils +Requires: python3-koji >= 1.24 +%if 0%{?rhel} +Requires: python3-gobject-base +Requires: libmodulemd +Requires: python3-requests-kerberos +%else +Requires: python3-libmodulemd +Requires: python3-rpmautospec +%endif +Requires: python3-rpm +Requires: python3-pycurl +Requires: python3-six >= 1.9.0 +Requires: python3-PyYAML + +Requires: %{name}-common = %{version}-%{release} + +Conflicts: fedpkg < 1.26 + +%description -n python3-%{name} +A python library for managing RPM package sources in a git repository. +%endif +# end of python3 section + + +%package common +Summary: Common files for %{name} + +# Files were moved from python2-rpkg in that version +Conflicts: python2-rpkg < 1.52-2 +Conflicts: pyrpkg < 1.52-2 + +%description common +Common files for python2-%{name} and python3-%{name}. + + +%prep +%autosetup -p1 + +# Removes section from setup.py that is relevant only for pip and +# is not compatible with in RHEL-6 tools +sed -i -n '/extras_require/,/}/!p' setup.py + +%build +%if 0%{?with_python2} +%{__python2} setup.py build +%endif + +%if 0%{?with_python3} +%py3_build +%endif + + +%install +%if 0%{?with_python2} +%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%endif + +%if 0%{?with_python3} +%py3_install +%endif + + +# Create configuration directory to holding downstream clients config files +# that are built on top of rpkg +%{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/rpkg + +example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli +%{__install} -d $example_cli_dir + +# Install example CLI to rpkg own data directory +%{__install} -d ${example_cli_dir}%{_bindir} +%{__install} -d ${example_cli_dir}%{_sysconfdir}/bash_completion.d +%{__install} -d ${example_cli_dir}%{_sysconfdir}/rpkg + +%{__install} -p -m 0644 bin/rpkg ${example_cli_dir}%{_bindir} +%{__install} -p -m 0644 etc/bash_completion.d/rpkg.bash ${example_cli_dir}%{_sysconfdir}/bash_completion.d +%{__install} -p -m 0644 etc/rpkg/rpkg.conf ${example_cli_dir}%{_sysconfdir}/rpkg + + +%check +%if 0%{?with_python2} +%{__python2} -m nose tests +%endif + +%if 0%{?with_python3} +%pytest +%endif + + +%if 0%{?with_python2} +%files -n python2-%{name} +%doc README.rst CHANGELOG.rst +%if 0%{?rhel} && 0%{?rhel} < 7 +%doc COPYING COPYING-koji LGPL +%else +%license COPYING COPYING-koji LGPL +%endif +# For noarch packages: sitelib +%{python2_sitelib}/pyrpkg +%{python2_sitelib}/%{name}-%{version}-py*.egg-info +%endif + +%if 0%{?with_python3} +%files -n python3-%{name} +%doc README.rst CHANGELOG.rst +%license COPYING COPYING-koji LGPL +%{python3_sitelib}/pyrpkg +%{python3_sitelib}/%{name}-%{version}-py*.egg-info +%endif + +%files common +%{_datadir}/%{name} +%{_sysconfdir}/rpkg + + +%changelog +* Fri Mar 24 2023 lichaoran - 1.66-1 +- Initial package -- cgit v1.2.3