diff options
author | CoprDistGit <infra@openeuler.org> | 2023-03-24 06:30:09 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-03-24 06:30:09 +0000 |
commit | 5dceedc6b1105bb7ca2f9242a3d8bf8b611d61b3 (patch) | |
tree | 65a77e5179230bb9434b0f5ab9ac94674f08ef7f | |
parent | 187a0e52c5079bca88ce44ae4aed8afe34f5c81c (diff) |
automatic import of rpkg
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 0001-Do-not-use-pytest-related-dependencies-temporarily.patch | 25 | ||||
-rw-r--r-- | 0002-Remove-pytest-coverage-execution.patch | 25 | ||||
-rw-r--r-- | 0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch | 42 | ||||
-rw-r--r-- | 0005-container-build-update-signing-intent-help-for-OSBS-.patch | 30 | ||||
-rw-r--r-- | 0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch | 37 | ||||
-rw-r--r-- | remove-koji-and-rpm-py-installer-from-requires.patch | 29 | ||||
-rw-r--r-- | rpkg.spec | 251 | ||||
-rw-r--r-- | sources | 1 |
9 files changed, 441 insertions, 0 deletions
@@ -0,0 +1 @@ +/rpkg-1.66.tar.gz diff --git a/0001-Do-not-use-pytest-related-dependencies-temporarily.patch b/0001-Do-not-use-pytest-related-dependencies-temporarily.patch new file mode 100644 index 0000000..70d12b0 --- /dev/null +++ b/0001-Do-not-use-pytest-related-dependencies-temporarily.patch @@ -0,0 +1,25 @@ +From 50caf547ff288d8146ea5e277ab7bfcf7e8b095c Mon Sep 17 00:00:00 2001 +From: Dominik Rumian <drumian@redhat.com> +Date: Tue, 24 Aug 2021 16:24:47 +0200 +Subject: [PATCH] [PATCH] Do not use pytest-related dependencies temporarily + +Signed-off-by: Dominik Rumian <drumian@redhat.com> +--- + setup.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 9c6d881..557cf5f 100755 +--- a/setup.py ++++ b/setup.py +@@ -49,7 +49,6 @@ setup( + license="GPLv2+", + url="https://pagure.io/rpkg", + packages=find_packages(), +- setup_requires=['setuptools_scm', 'pytest-runner'], + install_requires=install_requires, + tests_require=tests_require, + dependency_links=dep_links, +-- +2.31.1 + diff --git a/0002-Remove-pytest-coverage-execution.patch b/0002-Remove-pytest-coverage-execution.patch new file mode 100644 index 0000000..fbc9cb7 --- /dev/null +++ b/0002-Remove-pytest-coverage-execution.patch @@ -0,0 +1,25 @@ +From 8bf7c3b1336738ed5938f679fc4d450c3f8f0a62 Mon Sep 17 00:00:00 2001 +From: Ondrej Nosek <onosek@redhat.com> +Date: Wed, 7 Sep 2022 00:11:56 +0200 +Subject: [PATCH] Remove pytest coverage execution + +Signed-off-by: Ondrej Nosek <onosek@redhat.com> +--- + setup.cfg | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/setup.cfg b/setup.cfg +index 5e29c2f..4fe73fa 100644 +--- a/setup.cfg ++++ b/setup.cfg +@@ -5,7 +5,6 @@ test = pytest + max-line-length = 100 + + [tool:pytest] +-addopts = --cov=pyrpkg + testpaths = tests + + [egg_info] +-- +2.37.2 + diff --git a/0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch b/0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch new file mode 100644 index 0000000..e252038 --- /dev/null +++ b/0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch @@ -0,0 +1,42 @@ +From 6d813d40aff91345b171323512b3ae641a168d45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com> +Date: Mon, 27 Feb 2023 08:36:20 +0100 +Subject: [PATCH] Process source URLs with fragment in pre-push hook +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some download services do not have the actual filename in the URL. +Packagers work around that by adding a fragment to the URL. This is then +ignored by any server, but tricks RPM into getting the correct filename. + +Example: + + Source0: https://crates.io/api/v1/crates/actix/0.13.0/download#/actix-0.13.0.crate + +The filename is obviously `actix-0.13.0.crate`, but rpkg without this +patch will come up with `download`. + +Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com> +--- + pyrpkg/__init__.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py +index 6a0e9eb..c650851 100644 +--- a/pyrpkg/__init__.py ++++ b/pyrpkg/__init__.py +@@ -4464,7 +4464,9 @@ class Commands(object): + # find out the format of the source file path. From URL use just the file name. + # We want to keep hierarchy of the files if possible + res = urllib.parse.urlparse(file_location) +- if res.scheme and res.netloc: ++ if res.scheme and res.fragment: ++ source_files.append(os.path.basename(res.fragment)) ++ elif res.scheme and res.netloc: + source_files.append(os.path.basename(res.path)) + else: + source_files.append(file_location) +-- +2.39.2 + diff --git a/0005-container-build-update-signing-intent-help-for-OSBS-.patch b/0005-container-build-update-signing-intent-help-for-OSBS-.patch new file mode 100644 index 0000000..4ead6a3 --- /dev/null +++ b/0005-container-build-update-signing-intent-help-for-OSBS-.patch @@ -0,0 +1,30 @@ +From e38cfe4b688b600c411a9745922b77ebb9c14122 Mon Sep 17 00:00:00 2001 +From: Ken Dreyer <kdreyer@redhat.com> +Date: Tue, 28 Feb 2023 16:17:03 -0500 +Subject: [PATCH] container-build: update --signing-intent help for OSBS 2 + +OSBS 2 logs the reactor configuration in a slightly different way. +Update the --help text for --signing-intent to point users at the new +location. + +Signed-off-by: Ken Dreyer <kdreyer@redhat.com> +--- + pyrpkg/cli.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py +index 41c4354..c3672b3 100644 +--- a/pyrpkg/cli.py ++++ b/pyrpkg/cli.py +@@ -1724,7 +1724,7 @@ class cliClient(object): + " server. If unspecified, the server will use the signing intent" + " of the compose_ids you specify, or the server's" + " default_signing_intent. To view the full list of possible" +- " names, see REACTOR_CONFIG in orchestrator.log.") ++ " names, see atomic_reactor.config in osbs-build.log.") + + parser.add_argument( + '--skip-remote-rules-validation', +-- +2.39.2 + diff --git a/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch b/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch new file mode 100644 index 0000000..3369959 --- /dev/null +++ b/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch @@ -0,0 +1,37 @@ +From 30f189736137a50da4b740acf775ff6675a15a70 Mon Sep 17 00:00:00 2001 +From: Ondrej Nosek <onosek@redhat.com> +Date: Wed, 8 Mar 2023 16:39:16 +0100 +Subject: [PATCH] Do not generate pre-push hook script in some cases + +Some rpkg users don't use fedpkg or similar tool for cloning +and therefore there is no tool to execute the pre-push-check +function. Do not generate the hook script in this case. + +Fixes: #665 +JIRA: RHELCMP-11392 +Signed-off-by: Ondrej Nosek <onosek@redhat.com> +--- + pyrpkg/__init__.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py +index acdad22..776cb21 100644 +--- a/pyrpkg/__init__.py ++++ b/pyrpkg/__init__.py +@@ -1795,6 +1795,13 @@ class Commands(object): + for possible user mistakes. + """ + tool_name = os.path.basename(sys.argv[0]) # rhpkg|fedpkg|... ++ if not tool_name: ++ # empty argv - this functionality is not executed from x-pkg tool ++ # and therefore there isn't a program that can run pre-push-check. ++ # Example: the COPR team executes 'clone' by their own script. ++ self.log.debug('Pre-push hook script was NOT added - missing ' ++ 'the packaging tool like fedpkg, rhpkg, ...') ++ return + hook_content = textwrap.dedent(""" + #!/bin/bash + +-- +2.39.2 + diff --git a/remove-koji-and-rpm-py-installer-from-requires.patch b/remove-koji-and-rpm-py-installer-from-requires.patch new file mode 100644 index 0000000..90adee0 --- /dev/null +++ b/remove-koji-and-rpm-py-installer-from-requires.patch @@ -0,0 +1,29 @@ +From ec0c8b368fd560b319c6603f35dda803fe4b2e99 Mon Sep 17 00:00:00 2001 +From: Dominik Rumian <drumian@redhat.com> +Date: Tue, 24 Aug 2021 12:51:17 +0200 +Subject: [PATCH] [PATCH] remove koji and rpm-py-installer from requires + +Signed-off-by: Dominik Rumian <drumian@redhat.com> +--- + setup.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/setup.py b/setup.py +index 9c6d881..8c92aae 100755 +--- a/setup.py ++++ b/setup.py +@@ -34,6 +34,11 @@ install_requires, dep_links = read_requirements(pypi_txt) + tests_require, test_dep_links = read_requirements(test_pypi_txt) + dep_links += test_dep_links + ++install_requires = [ ++ item for item in install_requires ++ if not item.startswith('koji') and not item.startswith('rpm-py-installer') ++] ++ + readme_rst = os.path.join(setup_py_path, 'README.rst') + with open(readme_rst, 'r') as readme: + long_description = readme.read().rstrip() +-- +2.31.1 + 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 <pkwarcraft@hotmail.com> - 1.66-1 +- Initial package @@ -0,0 +1 @@ +5709bce6f7502801d813028ffda59d3f rpkg-1.66.tar.gz |