created tarball script

This commit adds a script to create a tarball from the repository and
removes this functionality from the makefile.
This commit is contained in:
William Hubbs 2009-03-08 13:45:56 -05:00
commit 4e7ae23757
2 changed files with 18 additions and 14 deletions

View file

@ -17,15 +17,6 @@ PREFIX = /usr
MANDIR = $(PREFIX)/share/man/man8
BINDIR = $(PREFIX)/bin
ifeq ("$(origin TAG)", "command line")
TIMESTAMP := _p$(shell date +%Y%m%d)
endif
VERSION := $(shell ./version)
TAG := v$(VERSION)
TARPREFIX := espeakup-$(VERSION)
TARFILE := $(TARPREFIX)$(TIMESTAMP).tar
all: espeakup
install: espeakup
@ -42,11 +33,6 @@ distclean: clean
espeakup: $(OBJS)
tarball:
git archive --format=tar --prefix=$(TARPREFIX)/ $(TAG) > $(TARFILE)
tar f $(TARFILE) --delete $(TARPREFIX)/.gitignore
bzip2 $(TARFILE)
cli.o: cli.c espeakup.h
espeakup.o: espeakup.c espeakup.h

18
tarball Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# Makes a tarball release
VER=$(./version)
PREFIX=espeakup-${VER}
REL=${1:-v${VER}}
if [ "$REL" != "v${VER}" ]; then
TIMESTAMP=`git show $REL --pretty=format:%ai |head -1`
PATCHLEVEL=`date --utc -d "$TIMESTAMP" +_p%Y%m%d%H%M`
fi
TARFILE=${PREFIX}${PATCHLEVEL}.tar
git archive --format=tar --prefix=${PREFIX}/ $REL > ${TARFILE}
tar f ${TARFILE} --delete ${PREFIX}/.gitignore --delete ${PREFIX}/tarball
bzip2 ${TARFILE}
echo "Produced ${TARFILE}.bz2"