diff options
author | B. Watson <yalhcru@gmail.com> | 2021-12-08 13:02:16 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-12-10 08:37:38 +0700 |
commit | b3023951f9d29bdfcf9564f0ff8323e05bd553f6 (patch) | |
tree | 08d021c1632cfc07648c3ff9d2ba048ce2595481 /system/vwm/git2tarxz.sh | |
parent | e51ab34303da817166be6254e2d51d7e3da3076e (diff) |
desktop/vwm: Move to system/vwm.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/vwm/git2tarxz.sh')
-rw-r--r-- | system/vwm/git2tarxz.sh | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/system/vwm/git2tarxz.sh b/system/vwm/git2tarxz.sh new file mode 100644 index 0000000000000..5dd951db3cdfc --- /dev/null +++ b/system/vwm/git2tarxz.sh @@ -0,0 +1,54 @@ +#!/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. + +# This git2tarxz's output is a tarball with 2 separate projects. +# Upstream doesn't use tags. The version number of the tarball is the +# version of vwm, taken from vwm.h, plus the commit date and hash of +# the vwm tree. The libvterm version isn't included in the version +# number. + +PRGNAM=vwm +PRGURL=https://github.com/TragicWarrior/vwm +LIBURL1=https://github.com/TragicWarrior/libvterm +LIBURL2=https://github.com/TragicWarrior/libviper + +set -e + +CWD="$( pwd )" + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +mkdir -p $GITDIR + +cd $GITDIR + +git clone $PRGURL +git clone $LIBURL1 +git clone $LIBURL2 + +cd $PRGNAM +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +RELVER="$( grep '#define *VWM_VERSION' vwm.h | cut -d'"' -f2 )" +VERSION=$RELVER+${DATE}_${GIT_SHA} + +cd - + +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" |