Update Makefile.common for change in gitfile directory structure, take out crud in amke-archive.sh

This commit is contained in:
Brian Read 2023-03-23 13:18:18 +00:00
parent 1bdd587e5c
commit 6963135c7a
2 changed files with 36 additions and 74 deletions

View File

@ -88,7 +88,6 @@ RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME)-$(VERSION)
#needed for archivefile rule #needed for archivefile rule
TREEPATH := $(NAME)-$(VERSION) TREEPATH := $(NAME)-$(VERSION)
TREEPATH := $(NAME)-$(VERSION)
EXT := $(shell cat $(NAME).spec | grep Source | head -n 1 | sed 's/Source: //' | sed -E 's/^([^.]*\.)(.*)$/\2//') 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 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)
@ -346,7 +345,7 @@ test-srpm: srpm
# Create the tar file used to transport the source tree # Create the tar file used to transport the source tree
archivefile:: archivefile::
./common/make-archive.sh $(shell common/make-archive.sh)
verrel: verrel:
@echo $(NAME)-$(VERSION)-$(RELEASE) @echo $(NAME)-$(VERSION)-$(RELEASE)

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

@ -1,23 +1,19 @@
#!/bin/sh #!/bin/sh
# #
# s/\$([A-Z]*)/${\1}/ # Make the archivefile for Make mockbuild
# s/; */; \\/ # Called from the arhcivefile rule in common/Makefile.common
# s/then/then \\/
# s/else/else \\/
# #
NAME=$(basename `pwd`) NAME=$(basename `pwd`)
VER_REL=$(rpm -q --qf "%{VERSION}\n" --specfile ${NAME}.spec | head -1) 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=$(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) ARCHIVEFILE=$(rpm --queryformat "${ARCHIVEFILE}\n" --specfile ${NAME}.spec | head -n 1)
TEMPDIR=`mktemp -d` TEMPDIR=`mktemp -d`
#TREEPATH=$(echo "$ARCHIVEFILENAME" | cut -f 1 -d '.')
TREEPATH="$NAME-$VER_REL" TREEPATH="$NAME-$VER_REL"
echo "$NAME $ARCHIVEFILE $TREEPATH" echo -e "\n$NAME $ARCHIVEFILE $TREEPATH"
echo -e "\nMaking archive file ${ARCHIVEFILE} `pwd`" ; \
echo "Making archive file ${ARCHIVEFILE} `pwd`" ; \
if [ "${NAME#smeserver}" = "${NAME}" ] || [ "${NAME#e-smith}" = "${NAME}" ] ; then \ if [ "${NAME#smeserver}" = "${NAME}" ] || [ "${NAME#e-smith}" = "${NAME}" ] ; then \
echo "Building for SME package"; \ echo -e "\nBuilding for SME package"; \
echo "Making archive ${ARCHIVEFILE}"; \ echo -e "\nMaking archive ${ARCHIVEFILE}"; \
TEMPDIR=`mktemp -d`; \ TEMPDIR=`mktemp -d`; \
mkdir -p ${TEMPDIR}/${TREEPATH}; \ mkdir -p ${TEMPDIR}/${TREEPATH}; \
cp -r root ${TEMPDIR}/${TREEPATH}; \ cp -r root ${TEMPDIR}/${TREEPATH}; \
@ -39,36 +35,3 @@
echo "Found 3rd party ${ARCHIVEFILE}"; \ echo "Found 3rd party ${ARCHIVEFILE}"; \
fi ; \ fi ; \
fi fi
#EXT=tar.gz
#echo "Making archive file ${ARCHIVEFILE} `pwd`" ; \
#if [ "${NAME#smeserver}" != "${NAME}" ] || [ "${NAME#e-smith}" != "${NAME}" ] ; then \
#echo "Building for SME package"; \
#GOTSOURCE='1'; \
#else \
#echo "Building for 3rd party package"; \
#GOTSOURCE='0'; \
#fi ; \
#echo "GOTSOURCE:${GOTSOURCE} TEMPDIR:${TEMPDIR}" ; \
#if [ ${GOTSOURCE} = '0' ]; then \
#if [ ! -e ${ARCHIVEFILE} ] ; then echo "Can't find 3rd party archive: ${ARCHIVEFILE} "; \
#GOTSOURCE='1'; \
#else \
#echo "Found ${ARCHIVEFILE}"; \
#fi \
#fi ; \
#if [ ${GOTSOURCE} = '1' ]; then \
#echo "Making archive ${ARCHIVEFILE}"; \
#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}; \
#fi ; \
#find ${TEMPDIR} -delete;