summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-xmakesrc.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..bb8acae
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global gh_vend/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global gh_proj/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+rm -rf $PROJECT-$VERSION
+git clone --recursive https://github.com/$OWNER/$PROJECT.git $PROJECT-$VERSION
+
+echo "Getting tag..."
+pushd $PROJECT-$VERSION
+git checkout v$VERSION
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION.tgz --exclude .git $PROJECT-$VERSION
+
+echo "Cleaning..."
+#rm -rf $PROJECT-$VERSION
+
+echo "Done."