Update of /cvsroot/libfunutil/libfunutil/toc/make
In directory sc8-pr-cvs1:/tmp/cvs-serv13137
Modified Files:
dist.make
Log Message:
enable by default bzip/zip if the bins are found. Added md5 checking for the dist files.
Index: dist.make
===================================================================
RCS file: /cvsroot/libfunutil/libfunutil/toc/make/dist.make,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- dist.make 30 Aug 2003 19:20:30 -0000 1.8
+++ dist.make 31 Aug 2003 00:46:07 -0000 1.9
@@ -4,12 +4,14 @@
# it takes a list of files/dirs to create a distribution tarball from.
# This snippet requires a filesystem-valid $(PACKAGE_NAME)-$(PACKAGE_VERSION)
# combination
-DIST_FILES_FILE = .toc.distfiles.list
+DIST_FILES_FILE = .toc.DIST_FILES
CLEAN_FILES += $(wildcard $(DIST_FILES_FILE))
+dist_find_bin = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(toc_tocdir)/bin:$(PATH)))))
+
FORCE:
-TOC_MAKEDIST_BIN ?= $(toc_tocdir)/bin/makedist
+TOC_MAKEDIST_BIN ?= $(call dist_find_bin,makedist)
ifeq (,$(wildcard $(TOC_MAKEDIST_BIN)))
$(error TOC_MAKEDIST_BIN must be set to point to the makedist application.)
endif
@@ -18,13 +20,15 @@
$(DIST_FILES_FILE): FORCE Makefile
@test -z "$(DIST_FILES)" && exit 0; \
- test -f $@ && rm $@; \
+ pwd=$$(pwd); \
for f in "" $(DIST_FILES); do test -z "$$f" && continue; \
- relpath=$${PWD}/$$f; \
- echo $$relpath >> $@; \
- done
+ echo $$pwd/$$f; \
+ done > $@;
+dist: $(DIST_FILES_FILE)
+dist: dist-subdirs dist-.
+dist: dist-subdirs dist-.
ifeq (.,$(top_srcdir))
DIST_NAME = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
@@ -33,10 +37,13 @@
dist-tar: $(DIST_FILES_TARBALL)
$(DIST_FILES_TARBALL): $(DIST_FILES_FILE)
@echo "Making dist tarball..."; \
- tmpfile=.toc.dist.tmp; \
+ pwd=$$(pwd); \
+ tmpfile=.toc.DIST_FILES.toplevel; \
echo '' > $$tmpfile; \
- find . -name $(DIST_FILES_FILE) | xargs cat >> $$tmpfile; \
- perl -pe "s|$${PWD}/||" $$tmpfile > foo.bar; sort < foo.bar > $$tmpfile; rm foo.bar; \
+ find . -name $(DIST_FILES_FILE) | \
+ xargs cat >> $$tmpfile; \
+ perl -pe "s|$${pwd}/||" $$tmpfile > foo.bar; \
+ sort < foo.bar > $$tmpfile; rm foo.bar; \
$(TOC_MAKEDIST_BIN) $$tmpfile $@ || exit; \
rm $$tmpfile
@@ -46,6 +53,14 @@
configure_dist_use_gzip ?= 1
configure_dist_use_bzip ?= 0
configure_dist_use_zip ?= 0
+BZIP_BIN = $(call dist_find_bin,bzip2)
+ifneq (,$(BZIP_BIN))
+configure_dist_use_bzip = 1
+endif
+ZIP_BIN = $(call dist_find_bin,zip)
+ifneq (,$(ZIP_BIN))
+configure_dist_use_zip = 1
+endif
ifeq (1,$(configure_dist_use_gzip))
CLEAN_FILES += $(wildcard $(DIST_FILES_TARBALL).gz)
@@ -77,6 +92,7 @@
@test -d $(DIST_NAME) && rm -fr $(DIST_NAME); true
@tar xf $<
zip -qr $@ $(DIST_NAME)
+ @rm -fr $(DIST_NAME)
endif
# ^^^ end infozip
@@ -98,11 +114,31 @@
./configure $(DIST_TESTDIST_ARGS) && make || exit $$?
@echo "$@ $(PACKAGE_NAME)-$(PACKAGE_VERSION) completed. $(TOC_EMOTICON_OKAY)"
+# MD5_BIN = md5sum
+# MD5_LIST = MD5SUMS.$(DIST_NAME)
+# $(MD5_LIST): $(DIST_FILES_TARBALL)
+# @-rm $@ 2>&1 > /dev/null;
+# @echo "Creating $@..."; \
+# for m in $$(tar tf $(DIST_FILES_TARBALL) | sed -e 's|$(DIST_NAME)/||'); do \
+# test -d $$m && continue; \
+# $(MD5_BIN) $$m; \
+# done > $@
+
+MD5_BIN = $(call dist_find_bin,md5sum*)
+ifeq (,$(MD5_BIN))
+$(warning MD5_BIN not pointing to md5sum application. Skipping md5-related checks.)
+else
+MD5_LIST = MD5SUMS.$(DIST_NAME)
+dist-checkmd5:
+ @echo "Checking distribution md5 sums against $(MD5_LIST)..."
+ @$(MD5_BIN) --check $(MD5_LIST) | grep FAILED || exit 0 && exit 1
+ @echo "${TOC_EMOTICON_OKAY}"
+endif
+# ^^^ end md5 stuff
endif
-# ^^^ in the $(top_srcdir)?
+# ^^^ end of $(top_srcdir) block
+
dist-subdirs:
@$(call toc_make_subdirs,$(SUBDIRS),dist)
-
-dist: dist-subdirs dist-.
|