summaryrefslogtreecommitdiffstats
path: root/create-tarball-from-git.sh
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-10-17 16:39:25 +0200
committerRemi Collet <remi@php.net>2023-10-17 16:39:25 +0200
commit11b9813e50b4a6398f81de3a56c80ca31f41177a (patch)
treed63956960865dfd18762734b35cdd1d583031639 /create-tarball-from-git.sh
parent2788d0bcf78e2b79258a77465050b7385b8b7a28 (diff)
v6.9.9
Diffstat (limited to 'create-tarball-from-git.sh')
-rw-r--r--create-tarball-from-git.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/create-tarball-from-git.sh b/create-tarball-from-git.sh
new file mode 100644
index 0000000..e23aadf
--- /dev/null
+++ b/create-tarball-from-git.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+set -x
+
+CURRENTDIR=$(pwd)
+PKGNAME=oniguruma
+TARNAME=onig
+
+TMPDIR=$(mktemp -d /var/tmp/$PKGNAME-XXXXXX)
+pushd $TMPDIR
+
+GITSCM=https://github.com/kkos/$PKGNAME.git
+
+git clone $GITSCM
+pushd $PKGNAME
+
+COMMIT=$(git log | head -n 1 | sed -e 's|^.*[ \t]||')
+SHORTCOMMIT=$(echo $COMMIT | cut -c-7)
+DATE=$(git show --format=%ci $COMMIT | head -n 1 | sed -e 's|[ \t].*$||')
+SHORTDATE=$(echo $DATE | sed -e 's|-||g')
+VERSION=$(cat configure.ac | grep AC_INIT | sed -n -e 's|^.*,[ \t]*\([0-9\.][0-9\.]*\).*$|\1|p')
+
+git log --format=fuller | head -n 12
+
+echo "VERSION=$VERSION"
+echo "COMMIT=$COMMIT"
+echo "DATE=$DATE"
+
+echo
+popd
+
+TARDIR=${TARNAME}-${VERSION}-${SHORTDATE}git${SHORTCOMMIT}
+ln -sf $PKGNAME $TARDIR
+tar czf ${TARDIR}.tar.gz ${TARDIR}/./
+
+mv ${TARDIR}.tar.gz ${CURRENTDIR}/
+popd
+
+rm -rf $TMPDIR
+