From ee4aff98abc1fcebcab1c5cf77e213d04d9f9e29 Mon Sep 17 00:00:00 2001 From: olachere Date: Fri, 17 Nov 2017 15:32:52 +0100 Subject: [PATCH] update doc --- README.md | 4 +-- tools/generate_unix_release.sh | 54 ++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 tools/generate_unix_release.sh diff --git a/README.md b/README.md index 43ac1ee9..a67c0379 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ The copy feature must be enabled on both client and server configuration file: { "ssf": { "services": { - "file_copy": { "enable": true } + "copy": { "enable": true } } } } @@ -276,7 +276,7 @@ ssfcp [-c config_file] [-p port] -r remote_host@path/to/dir absolute/path/direct "enable": true, "gateway_ports": false }, - "file_copy": { "enable": false }, + "copy": { "enable": false }, "shell": { "enable": false, "path": "/bin/bash|C:\\windows\\system32\\cmd.exe", diff --git a/tools/generate_unix_release.sh b/tools/generate_unix_release.sh new file mode 100644 index 00000000..ed00623d --- /dev/null +++ b/tools/generate_unix_release.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# This script generates a Unix release +# Includes: +# - SSF binaries +# - UPXed SSF binaries +# - tests certs (for test purpose only) + +set -e + +echo "Usage: ./generate_unix_release.sh SSF_VERSION CMAKE_GENERATOR ABS_SSF_SOURCE_DIR BOOST_PATH OPENSSL_PATH BUILD_TYPE BUILD_DIR" + +if [ -z "$1" ]; then "Missing VERSION"; exit 1; else VERSION="$1"; fi +if [ -z "$2" ]; then "Missing CMAKE_GENERATOR"; exit 1; else CMAKE_GENERATOR="$2"; fi +if [ -z "$3" ]; then "Missing ABS_SSF_SOURCE_DIR"; exit 1; else ABS_SSF_SOURCE_DIR="$3"; fi +if [ -z "$4" ]; then "Missing BOOST_PATH"; exit 1; else BOOST_PATH="$4"; fi +if [ -z "$5" ]; then "Missing OPENSSL_PATH"; exit 1; else OPENSSL_PATH="$5"; fi +if [ -z "$6" ]; then "Missing BUILD_TYPE"; exit 1; else BUILD_TYPE="$6"; fi +if [ -z "$7" ]; then "Missing BUILD_DIR"; exit 1; else BUILD_DIR="$7"; fi + +TARGET="ssf-${VERSION}" +INSTALL_BIN_PATH="${BUILD_DIR}/ssf/${TARGET}" + +echo "* VERSION: '${VERSION}'" +echo "* CMAKE_GENERATOR: '${CMAKE_GENERATOR}'" +echo "* ABS_SSF_SOURCE_DIR: '${ABS_SSF_SOURCE_DIR}'" +echo "* OUTPUT_FILEPATH: '${OUTPUT_FILEPATH}'" +echo "* BOOST_PATH: '${BOOST_PATH}'" +echo "* OPENSSL_PATH: '${OPENSSL_PATH}'" +echo "* BUILD_TYPE: '${BUILD_TYPE}'" + +echo "* Create build directory '${BUILD_DIR}'..." +mkdir -p ${BUILD_DIR} + +cd ${BUILD_DIR} +echo "* CMake pre processing..." +cmake ${ABS_SSF_SOURCE_DIR} -G "${CMAKE_GENERATOR}" -DUSE_STATIC_LIBS=ON -DBOOST_ROOT=$BOOST_PATH -DOPENSSL_ROOT_DIR=$OPENSSL_PATH -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${INSTALL_BIN_PATH} + +echo "* Build binaries..." +cmake --build . --target install --config $BUILD_TYPE -- -j2 + +mv ${INSTALL_BIN_PATH}/bin/* ${INSTALL_BIN_PATH} +rmdir ${INSTALL_BIN_PATH}/bin + +echo "* UPX binaries..." +for BIN_PATH in ${INSTALL_BIN_PATH}/ssf*; +do + BIN_NAME=`basename ${BIN_PATH}` + upx --best -o "${INSTALL_BIN_PATH}/upx-${BIN_NAME}" ${BIN_PATH} +done + +cd - + +echo "* Release directory: '${INSTALL_BIN_PATH}'"