handle new git directory structure

This commit is contained in:
Trevor Batley 2023-05-17 13:21:19 +10:00
parent 8fc8c268d8
commit 5585b0efa1

View File

@ -88,11 +88,15 @@ RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME)-$(VERSION)
#needed for archivefile rule
TREEPATH := $(NAME)-$(VERSION)
CODEDIR := "root"
EXT := $(shell cat $(NAME).spec | grep -e '^[S|s]ource' | head -n 1 | sed 's/Source: //' | sed -E 's/^([^.]*\.)(.*)$/\2//')
#ARCHIVEFILE=$(cat ${NAME}.spec | grep -e '^[S|s]ource' | sed -r 's/^[S|s]ource[0-9]?:\s?//' | xargs basename)
#ARCHIVEFILE=$(rpm --queryformat "${ARCHIVEFILE}\n" --specfile ${NAME}.spec | head -n 1)
ARCHIVEFILE := $(shell cat archivefilename)
ifeq (,$(wildcard archivefilename))
ARCHIVEFILE := "$(NAME)-$(VERSION).tar.gz"
else
ARCHIVEFILE := $(cat archivefilename)
endif
# default target: just make sure we've got the sources
all: sources
@ -345,6 +349,11 @@ endif
$(ARCHIVEFILE):
$(info "${NAME} $(ARCHIVEFILE) $(TREEPATH)")
$(info "Making archive file ${ARCHIVEFILE}")
if [ -d ${TREEPATH} ] ; then rm -Rf ${TREEPATH} ; fi ; \
mkdir -p ${TREEPATH} ; \
if [ -d ${CODEDIR} ] ; then cp -R "${CODEDIR}" "${TREEPATH}/root" ; fi ; \
if [ -e createlinks ] ; then cp createlinks "${TREEPATH}/." ; fi ; \
if [ -d additional ] ; then cp additional/* "${TREEPATH}/." ; fi ; \
tar -czf ${ARCHIVEFILE} ${TREEPATH} ;\
ls -l ${ARCHIVEFILE} ;