Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpm: assure we build and use a rpm repository #4796

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions Makefile
Expand Up @@ -568,8 +568,17 @@ vendor-in-container:
package: ## Build rpm packages
## TODO(ssbarnea): make version number predictable, it should not change
## on each execution, producing duplicates.
rm -f ~/rpmbuild/RPMS/x86_64/* ~/rpmbuild/RPMS/noarch/*
rm -rf build/* *.src.rpm ~/rpmbuild/RPMS/*/*
./contrib/build_rpm.sh

package-install: package ## Install rpm packages
sudo ${PKG_MANAGER} -y install --allowerasing ${HOME}/rpmbuild/RPMS/*/*.rpm
package-install: package ## Install rpm packages via a local podman.repo
# We use the repository approach with max priority and without disabling
# system packages in order to detect if our packages are
# creating any conflicts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: these comments will also display on stdout when the package-install recipe is executing. Not a huge problem but does add a bit to output clutter. Would the comment be just as useful for maintainers if placed above the target?

ls -la ${PWD}/build/buildset
sudo cp -f ${PWD}/build/podman.repo /etc/yum.repos.d/podman.repo
# --best needed to avoid accident where old rpms ones are picked instead
sudo ${PKG_MANAGER} -y install --best --allowerasing --nogpgcheck podman podman-remote
podman version
# info may require sudo and will also verify conman compatibility
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/conman/conmon

sudo podman info --log-level debug
30 changes: 26 additions & 4 deletions contrib/build_rpm.sh
Expand Up @@ -2,7 +2,7 @@
set -euxo pipefail

# returned path can vary: /usr/bin/dnf /bin/dnf ...
pkg_manager=`command -v dnf yum | head -n1`
pkg_manager=$(command -v dnf yum | head -n1)
echo "Package manager binary: $pkg_manager"


Expand All @@ -14,18 +14,22 @@ enabled=1
gpgcheck=0" > /etc/yum.repos.d/container_virt.repo
fi

declare -a PKGS=(device-mapper-devel \
declare -a PKGS=(\
createrepo \
device-mapper-devel \
git \
glib2-devel \
glibc-static \
go-compilers-golang-compiler \
golang \
gpgme-devel \
libassuan-devel \
libseccomp-devel \
libselinux-devel \
make \
redhat-rpm-config \
rpm-build \
go-compilers-golang-compiler \
rpmdevtools \
systemd-devel \
)

Expand All @@ -47,7 +51,7 @@ else
fi

echo ${PKGS[*]}
sudo $pkg_manager install -y ${PKGS[*]}
sudo $pkg_manager install --disablerepo podman -y ${PKGS[*]}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a comment to explain why we need the --disablerepo podman?


make -f .copr/Makefile
# workaround for https://github.com/containers/libpod/issues/4627
Expand All @@ -56,3 +60,21 @@ if [ -d ~/rpmbuild/BUILD ]; then
fi

rpmbuild --rebuild ${extra_arg:-} podman-*.src.rpm

# build repository
mkdir -p build/buildset
pushd build/buildset
cp -l ~/rpmbuild/RPMS/*/*.rpm .
createrepo .

cat <<EOF >../podman.repo
[podman]
priority=1
name=Podman Override
baseurl=file://${PWD}
enabled=1
gpgcheck=0
metadata_expire=1s
cost=0
EOF
popd