summaryrefslogtreecommitdiff
path: root/network/cicb/git2targz.sh
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2018-06-23 21:22:38 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-06-30 07:00:17 +0700
commite27dc891e21a90e8a1587d8a3312b5d6316e9ee2 (patch)
tree6af2593030cce7678ab8ec6a32c0e8c1259e533d /network/cicb/git2targz.sh
parenteef1c0b14b47ab9c22d270b2d55b27a67e778b2e (diff)
downloadslackbuilds-e27dc891e21a90e8a1587d8a3312b5d6316e9ee2.tar.gz
network/cicb: Updated for version 5.2.0b1+git20170501.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Diffstat (limited to 'network/cicb/git2targz.sh')
-rw-r--r--network/cicb/git2targz.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/network/cicb/git2targz.sh b/network/cicb/git2targz.sh
new file mode 100644
index 0000000000..c8cd99f76b
--- /dev/null
+++ b/network/cicb/git2targz.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Create source tarball from cicb git repo, with generated version
+# number. We don't include the git history in the tarball.
+# We also don't include the linenoise-1.0/ dir, since it's a readline
+# replacement for OSes that don't have readline... and Slackware
+# isn't one of those OSes.
+
+# 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.
+
+PRGNAM=cicb
+CLONE_URL=https://github.com/hoche/$PRGNAM.git
+
+set -e
+
+GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
+rm -rf $GITDIR
+git clone $CLONE_URL $GITDIR
+
+CWD="$( pwd )"
+cd $GITDIR
+
+# Extract date from last entry in git log. git has so many useful
+# options that it's a PITA to find the one you need...
+DATE=$( git log --date=format:%Y%m%d --pretty=format:%cd -n1 )
+
+VERFILE=icb/version.h
+WHATVER=$( sed -n 's,#define *WHAT_VERSION.*Version \([^"]*\)",\1,p' $VERFILE | sed 's,-,,' )
+
+VERSION=${WHATVER}+git$DATE
+
+rm -rf .git
+find . -name .gitignore -print0 | xargs -0 rm -f
+rm -rf linenoise-*/
+
+cd "$CWD"
+rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz
+mv $GITDIR $PRGNAM-$VERSION
+tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION
+
+cat <<EOF
+
+Archive created: $PRGNAM-$VERSION.tar.xz
+
+Update $PRGNAM.info with:
+
+VERSION="$VERSION"
+DOWNLOAD="http://urchlay.naptime.net/~urchlay/src/$PRGNAM-$VERSION.tar.xz"
+MD5SUM="$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )"
+
+Don't forget to upload the new source!
+EOF