t=$(tmpdir)/$(PACKAGE)/test
pfx=$(t)/i
-built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
+built_programs = \
+ $$(echo 'spy:;@echo $$(PROGRAMS)' \
+ | MAKEFLAGS= $(MAKE) -s -C parted -f Makefile -f - spy \
+ | fmt -1 | sed 's,$(EXEEXT)$$,,' | sort -u)
# More than once, tainted build and source directory names would
# have caused at least one "make check" test to apply "chmod 700"
t_taint = '$(t_prefix) b'
fake_home = $(tp)/home
+# When extracting from a distribution tarball, extract using the fastest
+# method possible. With dist-xz, that means using the *.xz file.
+ifneq ('', $(filter *.xz, $(DIST_ARCHIVES)))
+ tar_decompress_opt_ = J
+ suffix_ = xz
+else
+ ifneq ('', $(filter *.gz, $(DIST_ARCHIVES)))
+ tar_decompress_opt_ = z
+ suffix_ = gz
+ else
+ tar_decompress_opt_ = j
+ suffix_ = bz2
+ endif
+endif
+amtar_extract_ = $(AMTAR) -$(tar_decompress_opt_)xf
+preferred_tarball_ = $(distdir).tar.$(suffix_)
+
# Ensure that tests run from tainted build and src dir names work,
# and don't affect anything in $HOME. Create witness files in $HOME,
# record their attributes, and build/test. Then ensure that the
test -d $(t_taint) && chmod -R 700 $(t_taint) || :
-rm -rf $(t_taint) $(fake_home)
mkdir -p $(t_prefix) $(t_taint) $(fake_home)
- GZIP=$(GZIP_ENV) $(AMTAR) -C $(t_taint) -zxf $(distdir).tar.gz
+ $(amtar_extract_) $(preferred_tarball_) -C $(t_taint)
mkfifo $(fake_home)/fifo
touch $(fake_home)/f
mkdir -p $(fake_home)/d/e
endef
# Install, then verify that all binaries and man pages are in place.
-# Note that neither the binary, ginstall, nor the ].1 man page is installed.
+# Note that neither the binary, ginstall, nor the [.1 man page is installed.
define my-instcheck
echo running my-instcheck; \
$(MAKE) prefix=$(pfx) install \
&& { fail=0; \
for i in $(built_programs); do \
test "$$i" = ginstall && i=install; \
- for j in "$(pfx)/bin/$$i" \
- "$(pfx)/share/man/man1/$$i.1"; do \
+ for j in "$(pfx)/sbin/$$i" \
+ "$(pfx)/share/man/man8/$$i.8"; do \
case $$j in *'[.1') continue;; esac; \
test -f "$$j" && : \
|| { echo "$$j not installed"; fail=1; }; \
endef
# Use this to make sure we don't run these programs when building
-# from a virgin tgz file, below.
+# from a virgin compressed tarball file, below.
null_AM_MAKEFLAGS ?= \
ACLOCAL=false \
AUTOCONF=false \
AUTOMAKE=false \
AUTOHEADER=false \
GPERF=false \
- LIBTOOL=false \
MAKEINFO=false
ALL_RECURSIVE_TARGETS += my-distcheck
$(MAKE) check
-rm -rf $(t)
mkdir -p $(t)
- GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
- cd $(t)/$(distdir) \
- && ./configure --quiet --enable-gcc-warnings --disable-nls \
- && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
- && $(MAKE) dvi \
- && $(install-transform-check) \
- && $(my-instcheck) \
- && $(coreutils-path-check) \
- && $(MAKE) distclean
+ $(amtar_extract_) $(preferred_tarball_) -C $(t)
+ (set -e; cd $(t)/$(distdir); \
+ ./configure --quiet --enable-gcc-warnings --disable-nls; \
+ $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)'; \
+ $(MAKE) dvi; \
+ $(install-transform-check); \
+ $(my-instcheck); \
+ $(coreutils-path-check); \
+ $(MAKE) distclean \
+ )
(cd $(t) && mv $(distdir) $(distdir).old \
- && $(AMTAR) -zxf - ) < $(distdir).tar.gz
+ && $(amtar_extract_) - ) < $(preferred_tarball_)
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
-rm -rf $(t)
rmdir $(tmpdir)/$(PACKAGE) $(tmpdir)
@echo "========================"; \
- echo "$(distdir).tar.gz is ready for distribution"; \
+ echo "ready for distribution:"; \
+ for i in $(DIST_ARCHIVES); do echo " $$i"; done; \
echo "========================"