[skip-ci] Packit/RPM: more fixes

Packit failed to trigger an automatic fedora package update on the
upstream release v0.59.0 which brought to light further issues which
this commit corrects.

Packit doesn't honor a global `downstream_package_name` key when the
upstream repo and downstream package name don't match. For this very
repo, upstream repo is `common`, while downstream package is
`containers-common`. For such cases, `downstream_package_name`
should be specified at the package level.

The `Source0` URL in rpm spec has also been corrected. This wasn't noticed
in packit jobs on PRs because packit replaces Source0 with a locally
created archive.

The `mv` commands in rpm spec have also been replaced by `cp` so that
consecutive `rpmbuild` runs will not complain about not finding the
source files.

The autosetup step in rpm spec has also been updated to the correct
untarred archive name format.

Misc cleanup includes removal of `update_release: false` from downstream
jobs. It's meaningless in those jobs. Even for copr jobs, we should
prefer packit's default behavior of `update_release: true`.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar 2024-05-27 09:31:08 -04:00
parent 9520b232cc
commit 72ff80538a
2 changed files with 32 additions and 29 deletions

View File

@ -2,14 +2,15 @@
# See the documentation for more information: # See the documentation for more information:
# https://packit.dev/docs/configuration/ # https://packit.dev/docs/configuration/
downstream_package_name: containers-common
upstream_tag_template: v{version} upstream_tag_template: v{version}
packages: packages:
containers-common-fedora: containers-common-fedora:
downstream_package_name: containers-common
pkg_tool: fedpkg pkg_tool: fedpkg
specfile_path: rpm/containers-common.spec specfile_path: rpm/containers-common.spec
containers-common-centos: containers-common-centos:
downstream_package_name: containers-common
pkg_tool: centpkg pkg_tool: centpkg
specfile_path: rpm/containers-common.spec specfile_path: rpm/containers-common.spec
@ -56,7 +57,6 @@ jobs:
- job: propose_downstream - job: propose_downstream
trigger: release trigger: release
update_release: false
packages: [containers-common-fedora] packages: [containers-common-fedora]
dist_git_branches: dist_git_branches:
- fedora-development - fedora-development
@ -64,7 +64,6 @@ jobs:
- job: propose_downstream - job: propose_downstream
trigger: release trigger: release
update_release: false
packages: [containers-common-centos] packages: [containers-common-centos]
dist_git_branches: dist_git_branches:
- c10s - c10s

View File

@ -10,7 +10,10 @@
%global storage_branch main %global storage_branch main
%global shortnames_branch main %global shortnames_branch main
%global github_containers https://raw.githubusercontent.com/containers %global project containers
%global repo common
%global raw_github_url https://raw.githubusercontent.com/%{project}
%if %{defined copr_username} %if %{defined copr_username}
%define copr_build 1 %define copr_build 1
@ -40,21 +43,22 @@ BuildRequires: go-md2man
Provides: skopeo-containers = %{epoch}:%{version}-%{release} Provides: skopeo-containers = %{epoch}:%{version}-%{release}
Requires: (container-selinux >= 2:2.162.1 if selinux-policy) Requires: (container-selinux >= 2:2.162.1 if selinux-policy)
Suggests: fuse-overlayfs Suggests: fuse-overlayfs
Source0: %{git0}/archive/v%{version_no_tilde}.tar.gz URL: https://github.com/%{project}/%{repo}
Source1: %{github_containers}/image/%{image_branch}/docs/containers-auth.json.5.md Source0: %{url}/archive/v%{version_no_tilde}.tar.gz
Source2: %{github_containers}/image/%{image_branch}/docs/containers-certs.d.5.md Source1: %{raw_github_url}/image/%{image_branch}/docs/containers-auth.json.5.md
Source3: %{github_containers}/image/%{image_branch}/docs/containers-policy.json.5.md Source2: %{raw_github_url}/image/%{image_branch}/docs/containers-certs.d.5.md
Source4: %{github_containers}/image/%{image_branch}/docs/containers-registries.conf.5.md Source3: %{raw_github_url}/image/%{image_branch}/docs/containers-policy.json.5.md
Source5: %{github_containers}/image/%{image_branch}/docs/containers-registries.conf.d.5.md Source4: %{raw_github_url}/image/%{image_branch}/docs/containers-registries.conf.5.md
Source6: %{github_containers}/image/%{image_branch}/docs/containers-registries.d.5.md Source5: %{raw_github_url}/image/%{image_branch}/docs/containers-registries.conf.d.5.md
Source7: %{github_containers}/image/%{image_branch}/docs/containers-signature.5.md Source6: %{raw_github_url}/image/%{image_branch}/docs/containers-registries.d.5.md
Source8: %{github_containers}/image/%{image_branch}/docs/containers-transports.5.md Source7: %{raw_github_url}/image/%{image_branch}/docs/containers-signature.5.md
Source9: %{github_containers}/storage/%{storage_branch}/docs/containers-storage.conf.5.md Source8: %{raw_github_url}/image/%{image_branch}/docs/containers-transports.5.md
Source10: %{github_containers}/shortnames/%{shortnames_branch}/shortnames.conf Source9: %{raw_github_url}/storage/%{storage_branch}/docs/containers-storage.conf.5.md
Source11: %{github_containers}/image/%{image_branch}/default.yaml Source10: %{raw_github_url}/shortnames/%{shortnames_branch}/shortnames.conf
Source12: %{github_containers}/image/%{image_branch}/default-policy.json Source11: %{raw_github_url}/image/%{image_branch}/default.yaml
Source13: %{github_containers}/image/%{image_branch}/registries.conf Source12: %{raw_github_url}/image/%{image_branch}/default-policy.json
Source14: %{github_containers}/storage/%{storage_branch}/storage.conf Source13: %{raw_github_url}/image/%{image_branch}/registries.conf
Source14: %{raw_github_url}/storage/%{storage_branch}/storage.conf
# Fetch RPM-GPG-KEY-redhat-release from the authoritative source instead of storing # Fetch RPM-GPG-KEY-redhat-release from the authoritative source instead of storing
# a copy in repo or dist-git. Depending on distribution-gpg-keys rpm is also # a copy in repo or dist-git. Depending on distribution-gpg-keys rpm is also
# not an option because that package doesn't exist on CentOS Stream. # not an option because that package doesn't exist on CentOS Stream.
@ -92,22 +96,22 @@ This subpackage will handle dependencies common to Podman and Buildah which are
not required by Skopeo. not required by Skopeo.
%prep %prep
%autosetup -Sgit %{name}-%{version_no_tilde} %autosetup -Sgit -n %{repo}-%{version_no_tilde}
# Fine-grain distro- and release-specific tuning of config files, # Fine-grain distro- and release-specific tuning of config files,
# e.g., seccomp, composefs, registries on different RHEL/Fedora versions # e.g., seccomp, composefs, registries on different RHEL/Fedora versions
bash rpm/update-config-files.sh bash rpm/update-config-files.sh
%build %build
mv %{SOURCE1} docs/. cp %{SOURCE1} docs/.
mv %{SOURCE2} docs/. cp %{SOURCE2} docs/.
mv %{SOURCE3} docs/. cp %{SOURCE3} docs/.
mv %{SOURCE4} docs/. cp %{SOURCE4} docs/.
mv %{SOURCE5} docs/. cp %{SOURCE5} docs/.
mv %{SOURCE6} docs/. cp %{SOURCE6} docs/.
mv %{SOURCE7} docs/. cp %{SOURCE7} docs/.
mv %{SOURCE8} docs/. cp %{SOURCE8} docs/.
mv %{SOURCE9} docs/. cp %{SOURCE9} docs/.
mkdir -p man5 mkdir -p man5
for i in docs/*.5.md; do for i in docs/*.5.md; do