Name: rpkg Version: 1.66 Release: 2 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 %global with_check 0 # This is intended for Python 3 only, hence also no Python version in the name. %global __pytest /usr/bin/pytest%(test %{python3_pkgversion} == 3 || echo -%{python3_version}) %global pytest %{expand:\\\ CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ PATH="%{buildroot}%{_bindir}:$PATH"\\\ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\ PYTHONDONTWRITEBYTECODE=1\\\ %{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}\\\ %__pytest} # 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: openEuler-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} # 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: openEuler-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} %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 # need to run check as non-root %check %if 0%{?with_check} %if 0%{?with_python2} %{__python2} -m nose tests %endif %if 0%{?with_python3} %pytest %endif %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 * Mon Mar 27 2023 lichaoran - 1.66-2 - disable test * Fri Mar 24 2023 lichaoran - 1.66-1 - Initial package