[dahdi-commits] dahdi/tools.git branch "master" updated.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Dec 2 15:01:32 CST 2013


branch "master" has been updated
       via  a9338d9b743a6b7fd798b9b7581989333b888341 (commit)
      from  c0e19d47e82b6a09b55ba5a33817bd162fe40389 (commit)

Summary of changes:
 Makefile              |    5 ++++-
 build_tools/make_dist |   26 ++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100755 build_tools/make_dist


- Log -----------------------------------------------------------------
commit a9338d9b743a6b7fd798b9b7581989333b888341
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon Nov 25 23:37:38 2013 +0200

    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 at xorcom.com>
    Acked-by: Russ Meyerriecks <rmeyerriecks at digium.com>

diff --git a/Makefile b/Makefile
index 8824687..86213f5 100644
--- a/Makefile
+++ b/Makefile
@@ -331,6 +331,9 @@ update:
 		echo "Not under version control";  \
 	fi
 
+dist:
+	@./build_tools/make_dist "dahdi-tools" "$(TOOLSVERSION)"
+
 clean:
 	rm -f $(BINS) $(TEST_BINS)
 	rm -f *.o dahdi_cfg tzdriver sethdlc
@@ -363,7 +366,7 @@ config.status: configure
 	@echo "****"
 	@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:
 
diff --git a/build_tools/make_dist b/build_tools/make_dist
new file mode 100755
index 0000000..6c9d453
--- /dev/null
+++ b/build_tools/make_dist
@@ -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'"

-----------------------------------------------------------------------


-- 
dahdi/tools.git



More information about the dahdi-commits mailing list