From 14c02f22ea9c992081df753fd14007af5a16752b Mon Sep 17 00:00:00 2001 From: brainstream Date: Sun, 16 Sep 2018 20:20:16 +0300 Subject: [PATCH] Script to prepare release for linux --- .gitignore | 1 + CMakeLists.txt | 1 + release/assets/linux/oplpctools.sh | 6 ++++ release/make-release-linux.sh | 53 ++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100755 release/assets/linux/oplpctools.sh create mode 100755 release/make-release-linux.sh diff --git a/.gitignore b/.gitignore index 7a4ec5d..a3fbe2c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ CMakeLists.txt.user /packages/*.exe /packages/*.msi /packages/*.pkg +/release/release-* diff --git a/CMakeLists.txt b/CMakeLists.txt index 53c8440..0a1d10a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,5 +203,6 @@ add_custom_target(misc SOURCES .gitignore LICENSE.txt README.md + release/make-release-linux.sh ) diff --git a/release/assets/linux/oplpctools.sh b/release/assets/linux/oplpctools.sh new file mode 100755 index 0000000..6ed8790 --- /dev/null +++ b/release/assets/linux/oplpctools.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +BINDIR="`dirname $0`/bin" + +export LD_LIBRARY_PATH="$BINDIR" +"$BINDIR/oplpctools" diff --git a/release/make-release-linux.sh b/release/make-release-linux.sh new file mode 100755 index 0000000..2a4d1fe --- /dev/null +++ b/release/make-release-linux.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "Illegal number of parameters" + exit 1 +fi + +pushd `pwd` + +VERSION=$1 +ARCH=$2 +EXE_NAME=oplpctools +ASSETS_DIR=`pwd`/assets +SRC_DIR=`pwd`/.. +WORKING_DIR=`pwd`/release-linux-${ARCH} +BUILD_DIR=${WORKING_DIR}/build +OUT_DIR=${WORKING_DIR}/${EXE_NAME} +OUT_BIN_DIR=${OUT_DIR}/bin +OUT_IMG_DIR=${OUT_DIR}/images + +if [ -e $WORKING_DIR ]; then + rm -rf $WORKING_DIR +fi +mkdir -p $BUILD_DIR +mkdir -p $OUT_BIN_DIR +mkdir -p $OUT_IMG_DIR + +# +# building +# +cd $BUILD_DIR +cmake -DCMAKE_BUILD_TYPE=Release $SRC_DIR +make +chrpath -d $EXE_NAME +strip -s --strip-unneeded $EXE_NAME + +# +# copying files +# +cd $WORKING_DIR +cp ${BUILD_DIR}/${EXE_NAME} $OUT_BIN_DIR +cp ${BUILD_DIR}/*.qm $OUT_BIN_DIR +cp ${SRC_DIR}/LICENSE.txt $OUT_DIR +cp ${SRC_DIR}/src/OplPcTools/Resources/icons/application.png ${OUT_IMG_DIR}/icon.png +cp ${ASSETS_DIR}/linux/${EXE_NAME}.sh $OUT_DIR +chmod +x $OUT_DIR/${EXE_NAME}.sh + +echo +echo IMPORTANT! +echo Copy dependencies to ${OUT_BIN_DIR} +echo + +popd