summaryrefslogtreecommitdiffstats
path: root/makesrc.sh
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2026-03-12 11:00:50 +0100
committerRemi Collet <remi@php.net>2026-03-12 11:00:50 +0100
commit5df4d5c0d598e8e66ee041c22d243ff364866f4c (patch)
treecbb1a156acbd9e349f3474d9fbf235ecae87c100 /makesrc.sh
parentae0995742f2a7557aab87704f4c18a17584a3b18 (diff)
drop pear/pecl dependencyHEADmaster
sources from github
Diffstat (limited to 'makesrc.sh')
-rwxr-xr-xmakesrc.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..3f387cf
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,33 @@
+#!/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)
+VER1=$(sed -n '/^%global upstream_version/{s/.* //;p}' $NAME.spec)
+VER2=$(sed -n '/^%global upstream_prever/{s/.* //;p}' $NAME.spec)
+
+VERSION=${VER1}${VER2}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+if [ -f $PROJECT-$VERSION.tgz ]; then
+ echo $PROJECT-$VERSION.tgz already present
+ exit 1
+fi
+
+echo "Cloning..."
+rm -rf $PROJECT-$VERSION
+git clone --recursive https://github.com/$OWNER/$PROJECT.git -b $VERSION $PROJECT-$VERSION
+
+echo "Composer..."
+pushd $PROJECT-$VERSION
+ cp composer.json ..
+popd
+
+echo "Archiving..."
+tar czf $PROJECT-$VERSION.tgz --exclude-vcs $PROJECT-$VERSION
+
+echo "Cleaning..."
+rm -rf $PROJECT-$VERSION
+
+echo "Done."