packaging: add gitmodules helper 84/30184/2
authorPhilippe Coval <philippe.coval@open.eurogiciel.org>
Wed, 5 Nov 2014 17:47:45 +0000 (18:47 +0100)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Wed, 12 Nov 2014 13:26:13 +0000 (14:26 +0100)
Bug-Tizen: TC-1873/related
Change-Id: Iaf3adaf39dd83e22dc1a1fb609931b74aa7412b0
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
packaging/gitmodules.sh [new file with mode: 0755]

diff --git a/packaging/gitmodules.sh b/packaging/gitmodules.sh
new file mode 100755 (executable)
index 0000000..ec65f3e
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+# @author: Philippe Coval <mailto:philippe.coval@eurogiciel.fr>
+# @description: manage git submodules with git-build-package-rpm
+
+set -x
+set -e
+
+cat .gitmodules || return 1
+
+
+git submodule status | awk '{ print $2 }' | while read dir  ; do
+    name=$(basename "$dir" )
+    echo "name="
+    echo "dir=$dir"
+    git submodule init
+    git submodule update
+
+    tar cjvf "./packaging/${name}.tar.bz2" "${dir}"
+
+    cat<<EOF
+# Please add "SourceN: $name.tar.bz2" and "%setup -q -a N" to "packaging/*.spec"
+EOF
+
+done
+