From dcf4914ebb9f899af7625882dcde6bf08c7888e5 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Mon, 10 Apr 2023 19:15:10 +0100 Subject: [PATCH] Update archivefile rules in Makefile.common and make-archive.sh --- Makefile.common | 7 +++---- make-archive.sh | 27 +++++++-------------------- 2 files changed, 10 insertions(+), 24 deletions(-) mode change 100755 => 100644 make-archive.sh diff --git a/Makefile.common b/Makefile.common index 4a61b46..33c9bd7 100644 --- a/Makefile.common +++ b/Makefile.common @@ -88,10 +88,9 @@ RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME)-$(VERSION) #needed for archivefile rule TREEPATH := $(NAME)-$(VERSION) -EXT := $(shell cat $(NAME).spec | grep Source | head -n 1 | sed 's/Source: //' | sed -E 's/^([^.]*\.)(.*)$/\2//') -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) -TEMPDIR := $(shell mktemp -d) +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) diff --git a/make-archive.sh b/make-archive.sh old mode 100755 new mode 100644 index b2da4a7..8843830 --- a/make-archive.sh +++ b/make-archive.sh @@ -4,29 +4,16 @@ # Called from the arhcivefile rule in common/Makefile.common # NAME=$(basename `pwd`) -VER_REL=$(rpm -q --qf "%{VERSION}\n" --specfile ${NAME}.spec | head -1) -ARCHIVEFILE=$(cat ${NAME}.spec | grep Source | sed -r 's/^Source[0..9]*:\s*//' | xargs basename) -ARCHIVEFILE=$(rpm --queryformat "${ARCHIVEFILE}\n" --specfile ${NAME}.spec | head -n 1) -TEMPDIR=`mktemp -d` +VER_REL=$(rpm -q --qf "%{VERSION}\n" --specfile ${NAME}.spec | head -n 1) +#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) TREEPATH="$NAME-$VER_REL" echo -e "\n$NAME $ARCHIVEFILE $TREEPATH" echo -e "\nMaking archive file ${ARCHIVEFILE} `pwd`" ; \ -if [ "${NAME#smeserver}" = "${NAME}" ] || [ "${NAME#e-smith}" = "${NAME}" ] ; then \ - echo -e "\nBuilding for SME package"; \ - echo -e "\nMaking archive ${ARCHIVEFILE}"; \ - TEMPDIR=`mktemp -d`; \ - mkdir -p ${TEMPDIR}/${TREEPATH}; \ - cp -r root ${TEMPDIR}/${TREEPATH}; \ - if test -f createlinks ; then cp createlinks ${TEMPDIR}/${TREEPATH} ; fi ; \ - if test -f COPYING ; then cp COPYING ${TEMPDIR}/${TREEPATH} ; fi ; \ - if test -f LICENSE ; then cp LICENSE ${TEMPDIR}/${TREEPATH} ; fi ; \ - if test -f Copying ; then cp Copying ${TEMPDIR}/${TREEPATH} ; fi ; \ - if test -f Artistic ; then cp Artistic ${TEMPDIR}/${TREEPATH} ; fi ; \ - if test -f *.c ; then cp *.c ${TEMPDIR}/${TREEPATH} ; fi ; \ - rm -f ${ARCHIVEFILE}; \ - tar -czf ${ARCHIVEFILE} -C ${TEMPDIR} ${TREEPATH}; \ - ls -l ${ARCHIVEFILE}; \ - find ${TEMPDIR} -delete; \ +if [ "${NAME#smeserver}" == "${NAME}" ] || [ "${NAME#e-smith}" == "${NAME}" ] ; then \ + tar -czf ${ARCHIVEFILE} ${TREEPATH} ;\ + ls -l ${ARCHIVEFILE} ; else \ echo "3rd party package should already be there"; \ if [ ! -e "${ARCHIVEFILE}" ] ; then \