2019-01-10 19:45:21 +01:00
|
|
|
#!/usr/bin/env bash
|
2019-02-10 18:27:45 +01:00
|
|
|
set -x
|
2019-01-24 10:42:34 +01:00
|
|
|
package_win64() (
|
2019-01-24 10:56:56 +01:00
|
|
|
local NSSM_VERSION="nssm-2.24-101-g897c7ad"
|
|
|
|
local NSSM_URL="https://nssm.cc/ci/${NSSM_VERSION}.zip"
|
|
|
|
local FFMPEG_VERSION="ffmpeg-4.0.2-win64-static"
|
|
|
|
local FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip"
|
2019-01-24 10:42:34 +01:00
|
|
|
local ROOT=${1-$DEFAULT_ROOT}
|
|
|
|
local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
|
|
|
|
local PKG_DIR=${3-$DEFAULT_PKG_DIR}
|
|
|
|
local ARCHIVE_CMD="zip -r"
|
|
|
|
# Package portable build result
|
|
|
|
if [ -d ${OUTPUT_DIR} ]; then
|
|
|
|
echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
|
|
|
|
local TEMP_DIR="$(mktemp -d)"
|
|
|
|
wget ${NSSM_URL} -O ${TEMP_DIR}/nssm.zip
|
|
|
|
wget ${FFMPEG_URL} -O ${TEMP_DIR}/ffmpeg.zip
|
|
|
|
unzip ${TEMP_DIR}/nssm.zip -d $TEMP_DIR
|
2019-02-10 18:27:45 +01:00
|
|
|
cp ${TEMP_DIR}/${NSSM_VERSION}/win64/nssm.exe ${OUTPUT_DIR}/nssm.exe
|
2019-01-24 10:42:34 +01:00
|
|
|
unzip ${TEMP_DIR}/ffmpeg.zip -d $TEMP_DIR
|
2019-01-24 10:56:56 +01:00
|
|
|
cp ${TEMP_DIR}/${FFMPEG_VERSION}/bin/ffmpeg.exe ${OUTPUT_DIR}/ffmpeg.exe
|
|
|
|
cp ${TEMP_DIR}/${FFMPEG_VERSION}/bin/ffprobe.exe ${OUTPUT_DIR}/ffprobe.exe
|
2019-01-24 10:42:34 +01:00
|
|
|
rm -r ${TEMP_DIR}
|
2019-09-25 04:10:12 +02:00
|
|
|
cp ${ROOT}/deployment/windows/legacy/install-jellyfin.ps1 ${OUTPUT_DIR}/install-jellyfin.ps1
|
|
|
|
cp ${ROOT}/deployment/windows/legacy/install.bat ${OUTPUT_DIR}/install.bat
|
2019-01-24 10:42:34 +01:00
|
|
|
mkdir -p ${PKG_DIR}
|
|
|
|
pushd ${OUTPUT_DIR}
|
|
|
|
${ARCHIVE_CMD} ${ROOT}/${PKG_DIR}/`basename "${OUTPUT_DIR}"`.zip .
|
|
|
|
popd
|
|
|
|
local EXIT_CODE=$?
|
|
|
|
if [ $EXIT_CODE -eq 0 ]; then
|
|
|
|
echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
|
|
|
|
else
|
|
|
|
echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
|
|
|
|
fi
|
|
|
|
)
|
2019-01-10 19:45:21 +01:00
|
|
|
|
|
|
|
source ../common.build.sh
|
|
|
|
|
|
|
|
VERSION=`get_version ../..`
|
|
|
|
|
2019-01-24 10:42:34 +01:00
|
|
|
package_win64 ../.. `pwd`/dist/jellyfin_${VERSION}
|
2019-01-10 19:45:21 +01:00
|
|
|
|
|
|
|
#TODO setup and maybe change above code to produce the Windows native zip format.
|