Utility script to create release archive
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Sep 2014 01:37:53 +0000 (11:37 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Sep 2014 01:44:00 +0000 (11:44 +1000)
- only include files known to git.
- includes all submodules.
- version extracted from BKE_blender.h for naming.
- MD5 checksum generated.
- 'make tbz' convenience target.

Script by Dan McGrath with own minor edits.

GNUmakefile
build_files/utils/build_tgz.sh [new file with mode: 0755]
doc/python_api/sphinx_doc_gen.sh

index 91d3aa1..fb38c8a 100644 (file)
@@ -192,8 +192,8 @@ help:
        @echo ""
        @echo "Utilities (not associated with building blender)"
        @echo "  * icons    - updates PNG icons from SVG files."
-       @echo "  * tbz      - create a compressed svn export 'blender_archive.tar.bz2'"
-       @echo "  * update   - updates git and all submodules
+       @echo "  * tgz      - create a compressed archive of the source code."
+       @echo "  * update   - updates git and all submodules"
        @echo ""
        @echo "Documentation Targets (not associated with building blender)"
        @echo "  * doc_py   - generate sphinx python api docs"
@@ -361,11 +361,8 @@ check_descriptions:
 # Utilities
 #
 
-tbz:
-       svn export . blender_archive
-       tar cjf blender_archive.tar.bz2 blender_archive/
-       rm -rf blender_archive/
-       @echo "blender_archive.tar.bz2 written"
+tgz:
+       ./build_files/utils/build_tgz.sh
 
 icons:
        "$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
diff --git a/build_files/utils/build_tgz.sh b/build_files/utils/build_tgz.sh
new file mode 100755 (executable)
index 0000000..577bdb4
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# This script can run from any location,
+# output is created in the $CWD
+
+BASE_DIR="$PWD"
+
+blender_srcdir=$(dirname -- $0)/../..
+blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+
+if [ "$blender_version_cycle" = "release" ] ; then
+       VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
+else
+       VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
+fi
+
+MANIFEST="blender-$VERSION-manifest.txt"
+TARBALL="blender-$VERSION.tar.gz"
+
+
+# Build master list
+echo -n "Building manifest of files:  \"$BASE_DIR/$MANIFEST\" ..."
+git ls-files > $BASE_DIR/$MANIFEST
+
+# Enumerate submodules
+for lcv in $(git submodule | cut -f2 -d" "); do
+       cd "$blender_srcdir/$lcv"
+       git ls-files | awk '$0="'"$lcv"/'"$0' >> $BASE_DIR/$MANIFEST
+done
+echo "OK"
+
+
+# Create the tarball
+cd "$blender_srcdir"
+echo -n "Creating archive:            \"$BASE_DIR/$TARBALL\" ..."
+GZIP=-9 tar --transform "s,^,blender-$VERSION/,g" -zcf "$BASE_DIR/$TARBALL" -T "$BASE_DIR/$MANIFEST"
+echo "OK"
+
+
+# Create checksum file
+cd "$BASE_DIR"
+echo -n "Createing checksum:          \"$BASE_DIR/$TARBALL.md5sum\" ..."
+md5sum "$TARBALL" > "$TARBALL.md5sum"
+echo "OK"
+
+
+# Cleanup
+echo -n "Cleaning up ..."
+rm "$BASE_DIR/$MANIFEST"
+echo "OK"
+
+echo "Done!"
index e6ff02a..c8256a1 100755 (executable)
@@ -26,11 +26,11 @@ SSH_UPLOAD="/data/www/vhosts/www.blender.org/documentation" # blender_python_api
 # 'Blender 2.53 (sub 1) Build' --> '2_53_1' as a shell script.
 # "_".join(str(v) for v in bpy.app.version)
 # custom blender vars
-blender_srcdir=$(dirname $0)/../../
-blender_version=$(grep "BLENDER_VERSION\s" $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
-blender_version_char=$(grep BLENDER_VERSION_CHAR $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
-blender_version_cycle=$(grep BLENDER_VERSION_CYCLE $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
-blender_subversion=$(grep BLENDER_SUBVERSION $blender_srcdir/source/blender/blenkernel/BKE_blender.h | awk '{print $3}')
+blender_srcdir=$(dirname -- $0)/../..
+blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
+blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
 
 if [ "$blender_version_cycle" = "release" ] ; then
        BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"