Skip to content

Commit

Permalink
Script to prepare release for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
brainstream committed Sep 16, 2018
1 parent f996b28 commit 14c02f2
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ CMakeLists.txt.user
/packages/*.exe
/packages/*.msi
/packages/*.pkg
/release/release-*
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,6 @@ add_custom_target(misc SOURCES
.gitignore
LICENSE.txt
README.md
release/make-release-linux.sh
)

6 changes: 6 additions & 0 deletions release/assets/linux/oplpctools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

BINDIR="`dirname $0`/bin"

export LD_LIBRARY_PATH="$BINDIR"
"$BINDIR/oplpctools"
53 changes: 53 additions & 0 deletions release/make-release-linux.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 14c02f2

Please sign in to comment.