Update Makefile.common - create a specific rule for the archive file

This commit is contained in:
Brian Read 2023-04-03 16:15:22 +01:00
parent 6963135c7a
commit 47a0315841
2 changed files with 6 additions and 4 deletions

View File

@ -92,6 +92,7 @@ EXT := $(shell cat $(NAME).spec | grep Source | head -n 1 | sed 's/Source: //' |
ARCHIVEFILE := $(shell cat $(NAME).spec | grep Source | head -n 1 | sed -r 's/^Source[0..9]*:\s*//' | xargs basename) ARCHIVEFILE := $(shell cat $(NAME).spec | grep Source | head -n 1 | sed -r 's/^Source[0..9]*:\s*//' | xargs basename)
ARCHIVEFILE := $(shell rpm --queryformat '$(ARCHIVEFILE)\n' --specfile $(NAME).spec | head -n 1) ARCHIVEFILE := $(shell rpm --queryformat '$(ARCHIVEFILE)\n' --specfile $(NAME).spec | head -n 1)
TEMPDIR := $(shell mktemp -d) TEMPDIR := $(shell mktemp -d)
ARCHIVEFILE := $(shell cat archivefilename)
# default target: just make sure we've got the sources # default target: just make sure we've got the sources
@ -159,7 +160,7 @@ PREP_ARCHES = $(addprefix prep-,$(ARCHES))
# The TARGETS define is meant for local module targets that should be # The TARGETS define is meant for local module targets that should be
# made in addition to the SOURCEFILES whenever needed # made in addition to the SOURCEFILES whenever needed
TARGETS ?= archivefile TARGETS ?= $(ARCHIVEFILE)
#TARGETS ?= #TARGETS ?=
# default target - retrieve the sources and make the module specific targets # default target - retrieve the sources and make the module specific targets
@ -334,18 +335,19 @@ check: test-srpm
## use this to build an srpm locally ## use this to build an srpm locally
ifneq (, $(filter contribs7 contribs8 contribs9, $(BRANCH))) ifneq (, $(filter contribs7 contribs8 contribs9, $(BRANCH)))
srpm: sources $(TARGETS) srpm: $(TARGETS)
$(RPM_WITH_DIRS) $(DIST_DEFINES) --define _source_filedigest_algorithm=md5 --nodeps -bs $(SPECFILE) $(RPM_WITH_DIRS) $(DIST_DEFINES) --define _source_filedigest_algorithm=md5 --nodeps -bs $(SPECFILE)
else else
srpm: sources $(TARGETS) srpm: sources $(TARGETS)
$(RPM_WITH_DIRS) $(DIST_DEFINES) --nodeps -bs $(SPECFILE) $(RPM_WITH_DIRS) $(DIST_DEFINES) --nodeps -bs $(SPECFILE)
endif endif
$(ARCHIVEFILE):
$(shell $(COMMON_DIR)/make-archive.sh)
test-srpm: srpm test-srpm: srpm
# Create the tar file used to transport the source tree # Create the tar file used to transport the source tree
archivefile::
$(shell common/make-archive.sh)
verrel: verrel:
@echo $(NAME)-$(VERSION)-$(RELEASE) @echo $(NAME)-$(VERSION)-$(RELEASE)

0
make-archive.sh Normal file → Executable file
View File