summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2025-07-25 14:55:05 +0200
committerRemi Collet <remi@php.net>2025-07-25 14:55:05 +0200
commitb4b5563e373ce1b76104a8c1bccb0080b7780cad (patch)
tree2eacf52c68b5b77b2cfa953ffa6656b2755ce50f /makesrc.sh
initial package
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-xmakesrc.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..3054ed1
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,20 @@
+#!/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 --branch v$VERSION --recursive https://github.com/$OWNER/$PROJECT.git $PROJECT-$VERSION
+
+echo "Archiving..."
+tar czf $NAME-$VERSION.tgz --exclude-vcs $PROJECT-$VERSION
+
+echo "Cleaning..."
+rm -rf $PROJECT-$VERSION
+
+echo "Done."