diff options
author | Remi Collet <remi@remirepo.net> | 2025-08-05 11:57:25 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2025-08-05 11:57:25 +0200 |
commit | 00f941c88b62713a67074add2558024050b79a11 (patch) | |
tree | 3979567a11e6786ab325c43b1b5bb22b0d998ed8 /makesrc.sh |
initial package
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-x | makesrc.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..1a12fe7 --- /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 $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." |