summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-06-30 06:20:18 +0200
committerRemi Collet <fedora@famillecollet.com>2016-06-30 06:20:18 +0200
commit340959a7996163882266419573deaa22bbad5087 (patch)
treeeb1d020e7952936e7341bde5f6edbfd37e910fad /makesrc.sh
parent215a89e661cbaf2114d1cd31a94b6f5ecb0544fe (diff)
php-ocramius-proxy-manager: fix version + patch
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-xmakesrc.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..ab1375c
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global github_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global github_name/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^%global github_version/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global github_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+rm -rf $PROJECT-$COMMIT
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."