Update Makefile.common for change in gitfile directory structure, take out crud in amke-archive.sh
This commit is contained in:
parent
1bdd587e5c
commit
6963135c7a
@ -88,7 +88,6 @@ RPM_BUILD_DIR ?= $(BUILDDIR)/$(NAME)-$(VERSION)
|
||||
|
||||
#needed for archivefile rule
|
||||
TREEPATH := $(NAME)-$(VERSION)
|
||||
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)
|
||||
@ -346,7 +345,7 @@ test-srpm: srpm
|
||||
|
||||
# Create the tar file used to transport the source tree
|
||||
archivefile::
|
||||
./common/make-archive.sh
|
||||
$(shell common/make-archive.sh)
|
||||
|
||||
verrel:
|
||||
@echo $(NAME)-$(VERSION)-$(RELEASE)
|
||||
|
107
make-archive.sh
Executable file → Normal file
107
make-archive.sh
Executable file → Normal file
@ -1,74 +1,37 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# s/\$([A-Z]*)/${\1}/
|
||||
# s/; */; \\/
|
||||
# s/then/then \\/
|
||||
# s/else/else \\/
|
||||
#
|
||||
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`
|
||||
#TREEPATH=$(echo "$ARCHIVEFILENAME" | cut -f 1 -d '.')
|
||||
TREEPATH="$NAME-$VER_REL"
|
||||
echo "$NAME $ARCHIVEFILE $TREEPATH"
|
||||
|
||||
echo "Making archive file ${ARCHIVEFILE} `pwd`" ; \
|
||||
if [ "${NAME#smeserver}" = "${NAME}" ] || [ "${NAME#e-smith}" = "${NAME}" ] ; then \
|
||||
echo "Building for SME package"; \
|
||||
echo "Making 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; \
|
||||
#
|
||||
# Make the archivefile for Make mockbuild
|
||||
# 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`
|
||||
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; \
|
||||
else \
|
||||
echo "3rd party package should already be there"; \
|
||||
if [ ! -e "${ARCHIVEFILE}" ] ; then \
|
||||
$(error "Can't find 3rd party archive: ${ARCHIVEFILE} "); \
|
||||
else \
|
||||
echo "3rd party package should already be there"; \
|
||||
if [ ! -e "${ARCHIVEFILE}" ] ; then \
|
||||
$(error "Can't find 3rd party archive: ${ARCHIVEFILE} "); \
|
||||
else \
|
||||
echo "Found 3rd party ${ARCHIVEFILE}"; \
|
||||
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;
|
||||
echo "Found 3rd party ${ARCHIVEFILE}"; \
|
||||
fi ; \
|
||||
fi
|
Loading…
Reference in New Issue
Block a user