summaryrefslogtreecommitdiff
path: root/contrib/build_rpm.sh
diff options
context:
space:
mode:
authorSorin Sbarnea <ssbarnea@redhat.com>2020-01-06 10:57:49 +0000
committerSorin Sbarnea <ssbarnea@redhat.com>2020-01-07 20:06:27 +0000
commitda0319fecd2b046d64205abcccc318465e7ca696 (patch)
tree6fddf87cc233ef80f5eea90e48c78e9edbbd16bf /contrib/build_rpm.sh
parentbd3d8f4e282dc7a552d955bf5958b53d23937604 (diff)
downloadpodman-da0319fecd2b046d64205abcccc318465e7ca696.tar.gz
podman-da0319fecd2b046d64205abcccc318465e7ca696.tar.bz2
podman-da0319fecd2b046d64205abcccc318465e7ca696.zip
packaging: validate installed rpms
Previously we builded RPMs that contained an outdated conmon which was not compatible. From now on `make-install` will also call `podman version` and `podman info` in order to perform a minimal sanity check of the installation. Fixes: #4665 Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Diffstat (limited to 'contrib/build_rpm.sh')
-rwxr-xr-xcontrib/build_rpm.sh21
1 files changed, 14 insertions, 7 deletions
diff --git a/contrib/build_rpm.sh b/contrib/build_rpm.sh
index b64973f0d..b162a9c88 100755
--- a/contrib/build_rpm.sh
+++ b/contrib/build_rpm.sh
@@ -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"
@@ -14,25 +14,32 @@ 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 \
)
if [[ $pkg_manager == *dnf ]]; then
# We need to enable PowerTools if we want to get
# install all the pkgs we define in PKGS
- sudo dnf config-manager --set-enabled PowerTools
+ # 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
PKGS+=(python3-devel \
python3-varlink \
@@ -53,6 +60,9 @@ export extra_arg="--without doc --without debug"
echo ${PKGS[*]}
sudo $pkg_manager install -y ${PKGS[*]}
+# clean up src.rpm as it's been built
+sudo rm -f podman-*.src.rpm
+
make -f .copr/Makefile
# workaround for https://github.com/containers/libpod/issues/4627
if [ -d ~/rpmbuild/BUILD ]; then
@@ -60,6 +70,3 @@ if [ -d ~/rpmbuild/BUILD ]; then
fi
rpmbuild --rebuild ${extra_arg:-} podman-*.src.rpm
-
-# clean up src.rpm as it's been built
-sudo rm -f podman-*.src.rpm