slackbuilds/xap/nodeboxeditor/get_sources.sh
Michal Cieslakiewicz e9571a1fa6 Initial commit.
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2020-04-16 19:31:17 +02:00

10 lines
562 B
Bash
Executable File

#!/bin/bash
APP=nodeboxeditor
SRC=NodeBoxEditor
BRANCH=master
git clone -b $BRANCH --depth 1 https://github.com/rubenwardy/$SRC $APP
VERSION=`egrep '^set\(NBE_(MAJOR|MINOR|PATCH)_VERSION [0-9]+\)$' ${APP}/CMakeLists.txt | sed -e 's/_/ /g' -e 's/)//' | awk '$2=="MAJOR" { v_maj = $NF; next } $2=="MINOR" { v_min = $NF; next } $2=="PATCH" { v_plv = $NF; next } END { printf "%d.%d.%d\n", v_maj, v_min, v_plv }'`
mv ${APP} ${APP}-${VERSION}
tar cf - ${APP}-${VERSION} | xz -c9 > ${APP}-${VERSION}.tar.xz
[ -s ${APP}-${VERSION}.tar.xz ] && rm -rf ${APP}-${VERSION}