Makefile: define commit on make (s)rpm
Prepending the definition to the spec file feels brittle. Stop doing that – pass --define to rpmbuild instead. Keep copying the spec file from git though, so that it's always using the one from the last commit, and not the current checkout.
This commit is contained in:
parent
8a5b4bbfc0
commit
b7367e2519
1 changed files with 3 additions and 1 deletions
4
Makefile
4
Makefile
|
|
@ -206,7 +206,7 @@ RPM_TARBALL=rpmbuild/SOURCES/osbuild-composer-$(COMMIT).tar.gz
|
|||
|
||||
$(RPM_SPECFILE):
|
||||
mkdir -p $(CURDIR)/rpmbuild/SPECS
|
||||
(echo "%global commit $(COMMIT)"; git show HEAD:osbuild-composer.spec) > $(RPM_SPECFILE)
|
||||
git show HEAD:osbuild-composer.spec > $(RPM_SPECFILE)
|
||||
|
||||
$(RPM_TARBALL):
|
||||
mkdir -p $(CURDIR)/rpmbuild/SOURCES
|
||||
|
|
@ -216,6 +216,7 @@ $(RPM_TARBALL):
|
|||
srpm: $(RPM_SPECFILE) $(RPM_TARBALL)
|
||||
rpmbuild -bs \
|
||||
--define "_topdir $(CURDIR)/rpmbuild" \
|
||||
--define "commit $(COMMIT)" \
|
||||
--with tests \
|
||||
$(RPM_SPECFILE)
|
||||
|
||||
|
|
@ -223,6 +224,7 @@ srpm: $(RPM_SPECFILE) $(RPM_TARBALL)
|
|||
rpm: $(RPM_SPECFILE) $(RPM_TARBALL)
|
||||
rpmbuild -bb \
|
||||
--define "_topdir $(CURDIR)/rpmbuild" \
|
||||
--define "commit $(COMMIT)" \
|
||||
--with tests \
|
||||
$(RPM_SPECFILE)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue