diff options
author | B. Watson <urchlay@slackware.uk> | 2025-06-18 21:20:58 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2025-06-18 21:44:30 +0700 |
commit | 6e460326afbc16615ceb3319f01e0c55c64d612b (patch) | |
tree | 3b410465a654834e464c3091626e573b9cca757b /graphics/jp2-pixbuf-loader/git2tarxz.sh | |
parent | b2fcb2fdb314fc1090af144fdf141784812c900d (diff) |
graphics/jp2-pixbuf-loader: Added (GDK Pixbuf Loader library).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'graphics/jp2-pixbuf-loader/git2tarxz.sh')
-rw-r--r-- | graphics/jp2-pixbuf-loader/git2tarxz.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/graphics/jp2-pixbuf-loader/git2tarxz.sh b/graphics/jp2-pixbuf-loader/git2tarxz.sh new file mode 100644 index 0000000000..88964072b6 --- /dev/null +++ b/graphics/jp2-pixbuf-loader/git2tarxz.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version +# number. + +# Note that this script doesn't need to be run as root. It does +# need to be able to write to the current directory it's run from. + +# Takes one optional argument, which is the commit or tag to create +# a tarball of. With no arg, HEAD is used. + +PRGNAM=jp2-pixbuf-loader +CLONE_URL=https://notabug.org/necklace/jp2-pixbuf-loader + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +VERTAG=$( git tag --sort=version:refname | tail -1 | sed 's,^v,,' ) + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERSION=${VERTAG}+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=$VERSION" |