Updated README with RPM build instructions
This patch updates the README with instructions on building the RPM
locally.
diff --git a/Dockerfile b/Dockerfile.rpmbuild
similarity index 100%
rename from Dockerfile
rename to Dockerfile.rpmbuild
diff --git a/Makefile b/Makefile
index 68c3341..0ba81cb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,21 @@
all: build
-build:
- @mkdir -p rpmbuild/RPMS rpmbuild/SPECS rpmbuild/SRPMS \
- rpmbuild/BUILD/etc/cloud/cloud.cfg.d \
- rpmbuild/BUILD/usr/lib/python2.7/site-packages/cloudinit/sources
- docker build -t rpmbuild .
+rpm-centos7:
+ @mkdir -p rpmbuild/centos7/RPMS rpmbuild/centos7/SPECS \
+ rpmbuild/centos7/SRPMS \
+ rpmbuild/centos7/BUILD/etc/cloud/cloud.cfg.d \
+ rpmbuild/centos7/BUILD/usr/lib/python2.7/site-packages/cloudinit/sources
+ docker build -f Dockerfile.rpmbuild -t rpmbuild:centos7 .
docker run --rm -it \
-v $$(pwd)/rpmmacros:/root/.rpmmacros:ro \
- -v $$(pwd)/rpmbuild/:/root/rpmbuild \
- -v $$(pwd)/rpm.spec:/root/rpmbuild/SPECS/rpm.spec:ro \
+ -v $$(pwd)/rpmbuild/centos7:/root/rpmbuild \
+ -v $$(pwd)/rpm.centos7.spec:/root/rpmbuild/SPECS/rpm.spec:ro \
-v $$(pwd)/99_vmx_guestinfo.cfg:/root/rpmbuild/BUILD/etc/cloud/cloud.cfg.d/99_vmx_guestinfo.cfg:ro \
-v $$(pwd)/DataSourceVmxGuestinfo.py:/root/rpmbuild/BUILD/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceVmxGuestinfo.py:ro \
- rpmbuild \
+ rpmbuild:centos7 \
rpmbuild -ba /root/rpmbuild/SPECS/rpm.spec
+
+rpm: rpm-centos7
+
+build: rpm
+
diff --git a/README.md b/README.md
index 236060e..8f6e983 100644
--- a/README.md
+++ b/README.md
@@ -45,8 +45,8 @@
datasource:
```shell
-$ curl -sSLo /etc/cloud/cloud.cfg.d/10_vmx_guestinfo.cfg \
- https://raw.githubusercontent.com/akutz/cloudinit-ds-vmx-guestinfo/master/10_vmx_guestinfo.cfg
+$ curl -sSLo /etc/cloud/cloud.cfg.d/99_vmx_guestinfo.cfg \
+ https://raw.githubusercontent.com/akutz/cloudinit-ds-vmx-guestinfo/master/99_vmx_guestinfo.cfg
```
## Configuration
@@ -209,6 +209,19 @@
format of the metadata key "network". Valid encodings are `base64`
and `gzip+base64`.
+## Building the RPM
+Building the RPM locally is handled via Docker. Simple execute the following
+command:
+
+```shell
+$ make rpm
+```
+
+The resulting RPMs are located in `rpmbuild/$OS/RPMS/noarch/`. The list
+of supported `$OS` platforms are:
+
+* centos7
+
## Conclusion
To learn more about how to use cloud-init with CentOS, please see the cloud-init
[documentation](https://cloudinit.readthedocs.io/en/latest/index.html) for more
diff --git a/rpm.spec b/rpm.centos7.spec
similarity index 100%
rename from rpm.spec
rename to rpm.centos7.spec