Build tarball with top-level directory (code stolen from SUnet)

This commit is contained in:
mainzelm 2004-09-21 12:49:16 +00:00
parent f40d245325
commit 4a557891da
1 changed files with 42 additions and 19 deletions

View File

@ -1,25 +1,48 @@
SHELL = /bin/sh
PKGNAME=scsh-expect
RELEASE=0.1
TARBALL=$(PKGNAME)-$(RELEASE).tar.gz
distname=$(PKGNAME)-$(RELEASE)
FILES=./README \
./INSTALL \
./COPYING \
./AUTHORS \
./pkg-def.scm \
./scheme/interact.scm \
./scheme/expect.scm \
./scheme/chat.scm \
./scheme/packages.scm \
./scheme/tty-utils.scm \
./doc/chat.doc \
./doc/expect.doc \
./examples/timed-choice.scm \
./examples/ssh-same-path.scm \
./examples/ping-and-mail.scm \
distdir = /tmp
tarball: $(TARBALL)
DISTFILES=README \
INSTALL \
COPYING \
AUTHORS \
pkg-def.scm \
scheme/interact.scm \
scheme/expect.scm \
scheme/chat.scm \
scheme/packages.scm \
scheme/tty-utils.scm \
doc/chat.doc \
doc/expect.doc \
examples/timed-choice.scm \
examples/ssh-same-path.scm \
examples/ping-and-mail.scm \
.PHONY: dist
dist:
distname=$(distname) && \
distfile=$(distdir)/$$distname.tar.gz && \
if [ -d $(distdir) ] && \
[ -w $$distfile -o -w $(distdir) ]; then \
rm -f $$distname && \
ln -s . $$distname && \
files='' && \
for i in $(DISTFILES); do \
if [ "$$i" != "c/sysdep.h" ]; then \
files="$$files $$distname/$$i"; \
fi \
done && \
tar --exclude .cvsignore --exclude CVS -cf - $$files | \
gzip --best >$$distfile && \
rm $$distname; \
else \
echo "Can't write $$distfile" >&2; \
exit 1; \
fi
$(TARBALL): $(FILES)
tar zcf $(TARBALL) $(FILES)