diff options
author | Remi Collet <remi@remirepo.net> | 2021-06-23 15:17:46 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2021-06-23 15:17:46 +0200 |
commit | b82acd8fac0fcc1fd01330805eb0185cb873f6fd (patch) | |
tree | ffe20a4ea160885cd9a50c753671644f53a2bdc0 /makesrc.sh |
New package
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-x | makesrc.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..4406870 --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +NAME=$(basename $PWD) +OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) +VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +if [ -f $NAME-$VERSION.tgz ]; then + echo Skip $NAME-$VERSION.tgz +else + echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" + + echo "Cloning..." + rm -rf $PROJECT-$COMMIT + git clone --recursive --branch v$VERSION https://github.com/$OWNER/$PROJECT.git $PROJECT-$VERSION + + echo "Archiving..." + tar czf $NAME-$VERSION.tgz --exclude .git $PROJECT-$VERSION + + echo "Cleaning..." + rm -rf $PROJECT-$VERSION + + echo "Done." +fi + +spectool -g -S *spec + |