From c0a6a06f0715d60268a654d75be48a0db159cd96 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 20 Oct 2017 21:05:54 +0100 Subject: [PATCH] Move vddkdir to the spec file. --- Makefile | 9 ++------- README | 6 +++--- nbdkit-plugin-vddk.spec | 7 ++++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 106e285..b6d9b21 100644 --- a/Makefile +++ b/Makefile @@ -32,13 +32,9 @@ # See README. -# You must set this to the directory where you downloaded VDDK. -# NB. DO NOT PUT A TRAILING ‘/’ or you will get the error -# ‘canonicalization unexpectedly shrank by one character’ on RHEL 7. -VDDK_DIR := $(HOME)/tmp/vddk/vmware-vix-disklib-distrib - PWD := $(shell pwd) VERSION := $(shell grep ^Version: nbdkit-plugin-vddk.spec | awk '{print $$2}') +VDDK_DIR := $(shell grep '^%global vddkdir' nbdkit-plugin-vddk.spec | awk '{print $$3}') all: check-tools check-vddk check-source rpmbuild -ba \ @@ -48,7 +44,6 @@ all: check-tools check-vddk check-source --define "_sourcedir $(PWD)" \ --define "_specdir $(PWD)" \ --define "_srcrpmdir $(PWD)" \ - --define "vddkdir $(VDDK_DIR)" \ nbdkit-plugin-vddk.spec check-tools: @@ -56,7 +51,7 @@ check-tools: @if ! wget --help >/dev/null 2>&1; then echo "‘wget’ not installed or not working. Install the ‘wget’ package."; exit 1; fi check-vddk: - @if ! [ -d $(VDDK_DIR) ] || ! [ -d $(VDDK_DIR)/include ]; then echo -e "You must download VDDK and edit the Makefile to point $$(VDDK_DIR) to the\nlocation where you unpacked VDDK."; exit 1; fi + @if ! [ -d $(VDDK_DIR) ] || ! [ -d $(VDDK_DIR)/include ]; then echo -e "You must download VDDK and edit ‘nbdkit-plugin-vddk.spec’ to point ‘vddkdir’\nto the location where you unpacked VDDK."; exit 1; fi check-source: nbdkit-$(VERSION).tar.gz diff --git a/README b/README index 29d1637..c0b9814 100644 --- a/README +++ b/README @@ -5,9 +5,9 @@ Note that you will need VDDK, downloaded from VMware's website: https://www.vmware.com/support/developer/vddk/ -and unpacked into some directory. You must edit ‘Makefile’ and make -the ‘VDDK_DIR’ variable point to the directory where you unpacked -VDDK. +and unpacked into some directory. You must edit +‘nbdkit-plugin-vddk.spec’ and set the ‘vddkdir’ variable point to the +directory where you unpacked VDDK. To build the RPM just type ‘make’. (If you have missing dependencies then make will give an error, so fix the problem and run make again.) diff --git a/nbdkit-plugin-vddk.spec b/nbdkit-plugin-vddk.spec index aefec62..04149ba 100644 --- a/nbdkit-plugin-vddk.spec +++ b/nbdkit-plugin-vddk.spec @@ -1,6 +1,7 @@ -# This is overridden when we call rpmbuild in the Makefile so you -# don't need to set it here (unless you are not using the Makefile). -#global vddkdir /some/path +# You must set this to the directory where you downloaded VDDK. +# NB. DO NOT PUT A TRAILING ‘/’ or you will get the error +# ‘canonicalization unexpectedly shrank by one character’ on RHEL 7. +%global vddkdir /home/rjones/tmp/vddk/vmware-vix-disklib-distrib # The minimum version of nbdkit that we can build/install with. %global minimum_version 1.1.2 -- 1.8.3.1