Skip to content

Commit

Permalink
Build RPM for CentOS 8
Browse files Browse the repository at this point in the history
This patch updates the Makefile and Dockerfile.rpmbuild to support
building the RPM for CentOS 8.

This patch also includes a few, small addendums required to make the
previous patches work for CentOS 8.
  • Loading branch information
akutz committed Jul 16, 2020
1 parent d32a644 commit 35f0351
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Dockerfile.rpmbuild
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
FROM centos:7
# The CentOS image is the base of this image.
ARG CENTOS_IMAGE=centos:7

FROM ${CENTOS_IMAGE}
RUN yum install -y rpm-build
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ rpm-el7:
rpmbuild:el7 \
rpmbuild -ba /root/rpmbuild/SPECS/rpm.spec

rpm-el8:
@rm -fr rpmbuild/el8
@mkdir -p rpmbuild/el8/RPMS rpmbuild/el8/SPECS \
rpmbuild/el8/SRPMS \
rpmbuild/el8/BUILD/etc/cloud/cloud.cfg.d \
rpmbuild/el8/BUILD/usr/lib/python3.6/site-packages/cloudinit/sources
docker build --build-arg="CENTOS_IMAGE=centos:8" -f Dockerfile.rpmbuild -t rpmbuild:el8 .
docker run --rm -it \
-v $$(pwd)/rpmmacros:/root/.rpmmacros:ro \
-v $$(pwd)/rpmbuild/el8:/root/rpmbuild \
-v $$(pwd)/rpm.el8.spec:/root/rpmbuild/SPECS/rpm.spec:ro \
-v $$(pwd)/99-DataSourceVMwareGuestInfo.cfg:/root/rpmbuild/BUILD/99-DataSourceVMwareGuestInfo.cfg:ro \
-v $$(pwd)/DataSourceVMwareGuestInfo.py:/root/rpmbuild/BUILD/DataSourceVMwareGuestInfo.py:ro \
rpmbuild:el8 \
rpmbuild -ba /root/rpmbuild/SPECS/rpm.spec

rpm: rpm-el7

build: rpm
2 changes: 1 addition & 1 deletion rpm.el8.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# common
#################################################################################
Name: cloud-init-vmware-guestinfo
Version: 1.1.0
Version: 1.2.0
Release: 1.el8
Summary: A cloud-init datasource that uses VMware GuestInfo
License: Apache2
Expand Down

0 comments on commit 35f0351

Please sign in to comment.