diff --git a/Makefile b/Makefile index 6176afdf3..60ec0c41f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ include /etc/os-release SRCDIR ?= . -COMMIT = $(shell (cd "$(SRCDIR)" && git rev-parse HEAD)) +VERSION = $(shell (cd "$(SRCDIR)" && git rev-parse HEAD)) # # Generic Targets @@ -38,14 +38,14 @@ help: # ./rpmbuild, using rpmbuild's usual directory structure. # -RPM_SPECFILE=rpmbuild/SPECS/fido-device-onboard-rs-$(COMMIT).spec -RPM_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(COMMIT).tar.gz -VENDOR_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(COMMIT)-vendor-patched.tar.xz +RPM_SPECFILE=rpmbuild/SPECS/fido-device-onboard-rs-$(VERSION).spec +RPM_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(VERSION).tar.gz +VENDOR_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(VERSION)-vendor-patched.tar.xz PATCH_FILE=rpmbuild/SOURCES/0001-Revert-chore-use-git-fork-for-aws-nitro-enclaves-cos.patch $(RPM_SPECFILE): mkdir -p $(CURDIR)/rpmbuild/SPECS - sed -e "s/^Version:.*/Version: $(COMMIT)/;" fido-device-onboard.spec > $(RPM_SPECFILE) + sed -e "s/^Version:.*/Version: $(VERSION)/;" fido-device-onboard.spec > $(RPM_SPECFILE) if [ "$(ID)" = "fedora" ] && [ $(VARIANT_ID) != "eln" ]; then \ sed -i "/Source1/d ; /^# See make-vendored-tarfile.sh in upstream repo/d ;" $(RPM_SPECFILE); \ fi @@ -57,13 +57,12 @@ $(PATCH_FILE): $(RPM_TARBALL): mkdir -p $(CURDIR)/rpmbuild/SOURCES - git archive --prefix=fido-device-onboard-rs-$(COMMIT)/ --format=tar.gz HEAD > $(RPM_TARBALL) + git archive --prefix=fido-device-onboard-rs-$(VERSION)/ --format=tar.gz HEAD > $(RPM_TARBALL) $(VENDOR_TARBALL): - [ "$(ID)" = "fedora" ] && [ $(VARIANT_ID) != "eln" ] || ( \ mkdir -p $(CURDIR)/rpmbuild/SOURCES ; \ - ./make-vendored-tarfile.sh $(COMMIT) ; \ - mv fido-device-onboard-rs-$(COMMIT)-vendor-patched.tar.xz rpmbuild/SOURCES ;) + ./make-vendored-tarfile.sh $(VERSION) ; \ + mv fido-device-onboard-rs-$(VERSION)-vendor-patched.tar.xz $(VENDOR_TARBALL) .PHONY: srpm srpm: $(RPM_SPECFILE) $(PATCH_FILE) $(RPM_TARBALL) $(VENDOR_TARBALL)