2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-31 13:55:10 +00:00

Add a script to automate Synology package generation

This commit is contained in:
Diego Ximenez
2025-02-13 00:52:00 +01:00
parent 0cdd7e9dd6
commit d4100b2577
3 changed files with 33 additions and 0 deletions

3
.gitignore vendored
View File

@@ -66,6 +66,9 @@ megacmd_src_file_list.h
# macOS packaging files and artifacts # macOS packaging files and artifacts
Info.plist Info.plist
# Synology packaging files and artifacts
/build/SynologyNAS/packages
# Git # Git
*_BACKUP_* *_BACKUP_*
*_BASE_* *_BASE_*

View File

@@ -24,6 +24,8 @@ After copying, we can stop and remove the container if needed:
docker rm -f megacmd-dms docker rm -f megacmd-dms
``` ```
The script `build/SynologyNAS/generate_pkg.sh` automates all of these steps, creating the necessary docker container, extracting the package from it, and deleting it afterwards. In this case, the package will be extracted to `build/SynologyNAS/packages`.
To install the package on your NAS device, login using the web interface. Navigate to the Package Manager, and click Manual Install. This will open up a menu which lets you choose a local file. Select your generated .pkg file, and install. To install the package on your NAS device, login using the web interface. Navigate to the Package Manager, and click Manual Install. This will open up a menu which lets you choose a local file. Select your generated .pkg file, and install.
To actually run MEGAcmd, you'll need to enable a telnet or SSH connection in the Synology NAS, and run a remote terminal on it. Executables are available at `/volume1/@appstore/megacmdpkg`. To actually run MEGAcmd, you'll need to enable a telnet or SSH connection in the Synology NAS, and run a remote terminal on it. Executables are available at `/volume1/@appstore/megacmdpkg`.

View File

@@ -0,0 +1,28 @@
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <platform>"
exit 1
fi
PLATFORM="$1"
CONTAINER="megacmd-${PLATFORM}-build-env"
cleanup() {
echo "Cleaning up container..."
docker rm -f $CONTAINER > /dev/null 2>&1 || true
}
trap cleanup EXIT
echo "Starting build for '${PLATFORM}'..."
docker build -t $CONTAINER \
-f "$PWD/build/SynologyNAS/dockerfile/synology-cross-build.dockerfile" \
"$PWD" \
--build-arg PLATFORM="$PLATFORM"
CONTAINER_ID=$(docker create $CONTAINER)
docker cp "${CONTAINER_ID}:/image/${PLATFORM}" $PWD/build/SynologyNAS/packages/$PLATFORM
echo "Extracted package for '${PLATFORM}'"