Makefile: new 'make-dist' target
Creates a tar.gz: * Identical results to Digium's distributed tarballs * Named "dahdi-tools-<version>.tar.gz" * Only from committed files (uses git-archive) * Adds a .version file Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
parent
c0e19d47e8
commit
a9338d9b74
5
Makefile
5
Makefile
|
@ -331,6 +331,9 @@ update:
|
||||||
echo "Not under version control"; \
|
echo "Not under version control"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dist:
|
||||||
|
@./build_tools/make_dist "dahdi-tools" "$(TOOLSVERSION)"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(BINS) $(TEST_BINS)
|
rm -f $(BINS) $(TEST_BINS)
|
||||||
rm -f *.o dahdi_cfg tzdriver sethdlc
|
rm -f *.o dahdi_cfg tzdriver sethdlc
|
||||||
|
@ -363,7 +366,7 @@ config.status: configure
|
||||||
@echo "****"
|
@echo "****"
|
||||||
@exit 1
|
@exit 1
|
||||||
|
|
||||||
.PHONY: distclean dist-clean clean all install programs tests devel data config update install-programs install-libs install-utils-subdirs utils-subdirs prereq
|
.PHONY: distclean dist-clean clean all install programs tests devel data config update install-programs install-libs install-utils-subdirs utils-subdirs prereq dist
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
if [ "$#" -ne 2 ]; then
|
||||||
|
echo >&2 "Usage: $0 <package> <version>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
package="$1"
|
||||||
|
version="$2"
|
||||||
|
tarball_prefix="$package-$version"
|
||||||
|
echo "I: Making dist tarball for $tarball_prefix"
|
||||||
|
tarball_name="$tarball_prefix.tar.gz"
|
||||||
|
|
||||||
|
tmp_work_dir=".tmp"
|
||||||
|
tmp_version_dir="$tmp_work_dir/$tarball_prefix"
|
||||||
|
|
||||||
|
if [ "$DESTDIR" != '' ]; then
|
||||||
|
destdir="$DESTDIR/"
|
||||||
|
fi
|
||||||
|
output="$destdir$tarball_name"
|
||||||
|
|
||||||
|
mkdir -p "$tmp_version_dir"
|
||||||
|
git archive --format tar HEAD | tar xf - -C "$tmp_version_dir"
|
||||||
|
echo "$version" > "$tmp_version_dir/.version"
|
||||||
|
tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix"
|
||||||
|
rm -rf "$tmp_work_dir"
|
||||||
|
echo "I: tarball is ready: '$output'"
|
Loading…
Reference in New Issue