aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSorin Sbarnea <ssbarnea@redhat.com>2019-11-29 10:00:13 +0000
committerSorin Sbarnea <ssbarnea@redhat.com>2019-12-05 10:34:10 +0000
commita03c3a9318926c1b03d30a6aba6d10d8ba471475 (patch)
tree3e41508a8075ccd1dca97cb7ad89abe4fa9df87b /contrib
parentbc40282aec08b71719c55dc9416f776868ef9f62 (diff)
downloadpodman-a03c3a9318926c1b03d30a6aba6d10d8ba471475.tar.gz
podman-a03c3a9318926c1b03d30a6aba6d10d8ba471475.tar.bz2
podman-a03c3a9318926c1b03d30a6aba6d10d8ba471475.zip
Enable multi-platform rpm building
- make: fix python detection for multiple interpreters - make: create generic `package` and `package-install` targets - build_rpm.sh: move package installation into package-install - build_rpm.sh: fix dnf/yum detection - build_rpm.sh: install md2man rpm only on platfroms where is available - build_rpm.sh: temporary skip packaging docs and debug on rhel-8 - docs: `make package-install` This change is validated by new CI jobs run by rdoproject. See link below for result. Depends-On: https://review.rdoproject.org/r/#/c/23943/ Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/build_rpm.sh32
1 files changed, 14 insertions, 18 deletions
diff --git a/contrib/build_rpm.sh b/contrib/build_rpm.sh
index ceb4ca176..e41763fa7 100755
--- a/contrib/build_rpm.sh
+++ b/contrib/build_rpm.sh
@@ -6,7 +6,7 @@ pkg_manager=`command -v dnf yum | head -n1`
echo "Package manager binary: $pkg_manager"
-if [ $pkg_manager == "*yum" ]; then
+if [[ $pkg_manager == *yum ]]; then
echo "[virt7-container-common-candidate]
name=virt7-container-common-candidate
baseurl=https://cbs.centos.org/repos/virt7-container-common-candidate/x86_64/os/
@@ -28,7 +28,7 @@ declare -a PKGS=(device-mapper-devel \
go-compilers-golang-compiler \
)
-if [ $pkg_manager == "*dnf" ]; then
+if [[ $pkg_manager == *dnf ]]; then
PKGS+=(python3-devel \
python3-varlink \
)
@@ -36,26 +36,22 @@ if [ $pkg_manager == "*dnf" ]; then
if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then
PKGS+=(btrfs-progs-devel)
fi
-
-fi
-
-# golang-github-cpuguy83-go-md2man is needed for building man pages
-# It is not available by default in CentOS 8 making it optional
-if [ -z "$extra_arg" ]; then
- PKGS+=(golang-github-cpuguy83-go-md2man)
+ # disable doc until go-md2man rpm becomes available
+ # disable debug to avoid error: Empty %files file ~/rpmbuild/BUILD/libpod-.../debugsourcefiles.list
+ export extra_arg="--without doc --without debug"
+else
+ if ! grep -i -q 'Red Hat\|CentOS' /etc/redhat-release; then
+ PKGS+=(golang-github-cpuguy83-go-md2man)
+ fi
fi
echo ${PKGS[*]}
sudo $pkg_manager install -y ${PKGS[*]}
make -f .copr/Makefile
-rpmbuild --rebuild ${extra_arg:-""} podman-*.src.rpm
-
-# Test to make sure the install of the binary works
-sudo $pkg_manager -y install ~/rpmbuild/RPMS/x86_64/podman-*.x86_64.rpm
-
-
-# If we built python/varlink packages, we should test their installs too
-if [ $pkg_manager == "*dnf" ]; then
- sudo $pkg_manager -y install ~/rpmbuild/RPMS/noarch/python*
+# workaround for https://github.com/containers/libpod/issues/4627
+if [ -d ~/rpmbuild/BUILD ]; then
+ chmod -R +w ~/rpmbuild/BUILD
fi
+
+rpmbuild --rebuild ${extra_arg:-} podman-*.src.rpm