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: build a repo and use it #4815

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,5 @@ package: ## Build rpm packages
rm -rf build/* *.src.rpm ~/rpmbuild/RPMS/*
./contrib/build_rpm.sh

# Remember that rpms install exec to /usr/bin/podman while a `make install`
# installs them to /usr/local/bin/podman which is likely before. Always use
# a full path to test installed podman or you risk to call another executable.
package-install: package ## Install rpm packages
sudo ${PKG_MANAGER} -y install ${HOME}/rpmbuild/RPMS/*/*.rpm
/usr/bin/podman version
/usr/bin/podman info # will catch a broken conmon
package-install: ## Install rpm packages
./contrib/build_rpm.sh install
20 changes: 16 additions & 4 deletions contrib/build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ declare -a PKGS=(\
if [[ $pkg_manager == *dnf ]]; then
# We need to enable PowerTools if we want to get
# install all the pkgs we define in PKGS
# PowerTools exists on centos-8 but not on fedora-30 and rhel-8
if (dnf -v -C repolist all|grep "Repo-id : PowerTools" >/dev/null); then
sudo dnf config-manager --set-enabled PowerTools
fi
# PowerTools exists on centos-8(-stream) but not on fedora-30 and rhel-8
dnf -C repolist all | sed -rn 's/(.*PowerTools).*/\1/p' | \
xargs sudo dnf config-manager --set-enabled

PKGS+=(python3-devel \
python3-varlink \
Expand Down Expand Up @@ -70,3 +69,16 @@ if [ -d ~/rpmbuild/BUILD ]; then
fi

rpmbuild --rebuild ${extra_arg:-} podman-*.src.rpm
createrepo -v ~/rpmbuild/RPMS/x86_64

Choose a reason for hiding this comment

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

For consistency with line 75, could we make this /${HOME}/rpmbuild/RPMS/x86_64 ?

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, rpmbuild checks an env. var. for the preferred location. The script should probably reference that instead of hard-coding. Otherwise this build could break in unexpected ways.


if [ "${1:-}" == "install" ]; then
sudo ${pkg_manager} -y --repofrom podman,file://${HOME}/rpmbuild/RPMS/x86_64/ install podman podman-remote
# Remember that rpms install exec to /usr/bin/podman while a `make install`
# installs them to /usr/local/bin/podman which is likely before. Always use
# a full path to test installed podman or you risk to call another executable.
/usr/bin/podman version
# TODO(ssbarnea): implement a test that verifies the version to match what
# we build. The problem is that Version seems to be generic, maybe use
# of Git Commit
sudo /usr/bin/podman info # will catch a broken conmon
fi