-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
536 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: synology build | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, linux] | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: | | ||
sudo -E bash synology/build-nzbget.sh | ||
- name: Rename build artifacts | ||
if: github.ref_name != 'main' | ||
run: | | ||
cd /toolkit/result_spk/nzbget/ | ||
VERSION=$(date '+%Y%m%d') | ||
NEW_VERSION="$VERSION-testing" | ||
for FILE in *.spk; do | ||
[ -f $FILE ] || continue | ||
NEW_FILE=${FILE/$VERSION/$NEW_VERSION} | ||
sudo mv $FILE $NEW_FILE | ||
done | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nzbget-synology-packages | ||
path: /toolkit/result_spk/nzbget/*.spk | ||
retention-days: 5 | ||
|
||
- name: Cleanup | ||
run: | | ||
sudo rm /toolkit/result_spk/nzbget/*.spk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ ipch/ | |
# NZBGet specific | ||
nzbget | ||
build | ||
!synology/package/SynoBuildConf/build | ||
*.temp | ||
*.pyc | ||
pytest.ini | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Synology nzbget packages | ||
|
||
## Package versions | ||
|
||
We provide native packages for most Synology platforms (DSM 7.x). To select a correct package for yours platform please find Synology model in [Synology NAS list](https://kb.synology.com/en-us/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have) and select package based on `Package Arch` field: | ||
|
||
| Package Arch | NZBGet package name | ||
|:---------------|:- | ||
| alpine | nzbget-armv7-*.spk | ||
| alpine4k | nzbget-armv7-*.spk | ||
| apollolake | nzbget-x86_64-*.spk | ||
| armada370 | nzbget-armada370-*.spk | ||
| armada375 | nzbget-armada375-*.spk | ||
| armada37xx | nzbget-armv8-*.spk | ||
| armadaxp | nzbget-armadaxp-*.spk | ||
| avoton | nzbget-x86_64-*.spk | ||
| braswell | nzbget-x86_64-*.spk | ||
| broadwell | nzbget-x86_64-*.spk | ||
| broadwellnk | nzbget-x86_64-*.spk | ||
| broadwellntb | nzbget-x86_64-*.spk | ||
| broadwellntbap | nzbget-x86_64-*.spk | ||
| bromolow | nzbget-x86_64-*.spk | ||
| cedarview | nzbget-x86_64-*.spk | ||
| coffeelake | nzbget-x86_64-*.spk | ||
| comcerto2k | `not supported` | ||
| denverton | nzbget-x86_64-*.spk | ||
| evansport | nzbget-i686-*.spk | ||
| geminilake | nzbget-x86_64-*.spk | ||
| grantley | nzbget-x86_64-*.spk | ||
| kvmx64 | nzbget-x86_64-*.spk | ||
| monaco | nzbget-monaco-*.spk | ||
| purley | nzbget-x86_64-*.spk | ||
| rtd1296 | nzbget-armv8-*.spk | ||
| rtd1619 | nzbget-armv8-*.spk | ||
| skylaked | nzbget-x86_64-*.spk | ||
| v1000 | nzbget-x86_64-*.spk | ||
|
||
## Installing / upgrading / uninstalling / reinstalling | ||
|
||
To install NZBGet package from Synology Package Center press Manual Install and select downloaded package -> Next -> Agree -> Select shared folder and download directory -> Credentials for web interface -> Done. | ||
After installation NZBGet web interface will be availabe from http://[Synology NAS IP or Hostname]:6789 with provided during installation username/password (nzbget/nzbget by default). Also this link available from package center "Open" button on installed NZBGet package icon. | ||
|
||
To upgrade nzbget package - do the same thing with new package. NZBGet settings will be keeped. | ||
|
||
Uninstall - from Package center select NZBGet package and hit uninstall in action combo box. You can keep existing config files or cleanup all package data. If you keep existing config files, all settings selected in next package installations will be ignored, old config files settings will be preferred. | ||
|
||
## Shared folders permissions and nzbget | ||
|
||
When installed, the package adds all the necessary permissions for the selected Shared folder to work correcty. If you want to change the download path to another shared folder, you must manually add permissions for the nzbget user. For example - you changed MainDir to /volume2/some_shared_folder/some_download_directory. You must add r/w permission to `nzbget` user via Control Panel -> Shared Folder -> Select `some_shared_folder` -> Edit -> Permissions tab -> select from combobox `System internal user` -> nzbget -> Read/Write -> Save. | ||
|
||
## Extensions | ||
|
||
You can put custom extension in `ScriptDir` directory. During installation this directory appears in `selected_shared_folder\selected_download_directory\scripts` and populates with default scripts (Email and Logger). Synology DSM 7.x bundled with python 3.8, so you must make sure that the script you are installing supports it. Our forks of VideoSort/FailureLink/FakeDetector are tested and working. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# About | ||
|
||
"build-nzbget.sh" is a bash script which is used to build nzbget Synology packages. | ||
|
||
# Prerequisites | ||
|
||
## Synology toolkit and environments | ||
|
||
Basic setup (assuming have Debian/Ubuntu host): | ||
|
||
1. Install Synology toolkit (reference - https://help.synology.com/developer-guide/getting_started/prepare_environment.html) | ||
``` | ||
sudo apt-get install git cifs-utils python3 python3-pip | ||
sudo mkdir -p /toolkit | ||
sudo chmod 777 /toolkit | ||
cd /toolkit | ||
git clone https://github.com/SynologyOpenSource/pkgscripts-ng | ||
cd /toolkit/pkgscripts-ng/ | ||
git checkout DSM7.0 | ||
``` | ||
|
||
2. Install needed environments (please note - user must have sudo access) | ||
|
||
- according to https://help.synology.com/developer-guide/appendix/platarchs.html - one per architecture, and specific separately | ||
- we exclude `comcerto2k` - toolchain for this platform does not support C++14 | ||
|
||
``` | ||
cd /toolkit/pkgscripts-ng/ | ||
for PLATFORM in alpine armada370 armada375 armada37xx armada38x armadaxp avoton evansport monaco; do sudo ./EnvDeploy -v 7.0 -p $PLATFORM; done | ||
``` | ||
|
||
|
||
## Building NZBGet | ||
|
||
From cloned repository run | ||
``` | ||
sudo bash synology/build-nzbget.sh [platform] | ||
``` | ||
Please note - user must have sudo access. Synology toolkit requires root access to build packages. | ||
|
||
|
||
## Output files | ||
|
||
- /toolkit/result_spk/nzbget/*.spk - one file per platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
# synology toolkit path | ||
TOOLKIT=/toolkit | ||
|
||
# parameter can be build platform | ||
BUILD_PLATFORM=$1 | ||
if [ ! -z "$BUILD_PLATFORM" ]; then BUILD_PARAM="-p $BUILD_PLATFORM"; fi | ||
|
||
# clean up | ||
rm -rf $TOOLKIT/source/nzbget | ||
rm -rf $TOOLKIT/result_spk/ | ||
if [ ! -z "$BUILD_PLATFORM" ]; then | ||
PLATFORMS=$BUILD_PLATFORM | ||
else | ||
PLATFORMS="alpine armada370 armada375 armada37xx armada38x armadaxp avoton evansport monaco" | ||
fi | ||
for PLATFORM in $PLATFORMS; do | ||
echo "Cleanup $PLATFORM environment ..." | ||
rm -rf $TOOLKIT/build_env/ds.$PLATFORM-7.0/image/packages | ||
done | ||
|
||
# copy source and prepare package structure | ||
mkdir -p $TOOLKIT/source/nzbget | ||
cp -r . $TOOLKIT/source/nzbget | ||
cp -r synology/package/* $TOOLKIT/source/nzbget/ | ||
cd $TOOLKIT/source/nzbget/ | ||
chmod +x scripts/* | ||
chmod -x scripts/vars | ||
chmod +x SynoBuildConf/* | ||
chmod -x SynoBuildConf/depends | ||
chmod +x INFO.sh | ||
|
||
# correct build version in INFO.sh | ||
VERSION=$(grep "AC_INIT(nzbget, " configure.ac | cut -d "," -f 2 | xargs) | ||
SPK_VERSION=$(date '+%Y%m%d')-${VERSION//./} | ||
# if running from CI/CD, add testing to builds from non-main branch | ||
if [ -n "$GITHUB_REF_NAME" ]; then | ||
if [ "$GITHUB_REF_NAME" != "main" ]; then | ||
NEW_VERSION="$VERSION-testing-$(date '+%Y%m%d')" | ||
sed -e "s|AC_INIT(nzbget.*|AC_INIT(nzbget, $NEW_VERSION, https://github.com/nzbgetcom/nzbget/issues)|g" -i configure.ac | ||
fi | ||
fi | ||
sed -e "s|version=.*$|version=\"$SPK_VERSION\"|g" -i INFO.sh | ||
|
||
# build | ||
$TOOLKIT/pkgscripts-ng/PkgCreate.py -v 7.0 -c -P 2 nzbget $BUILD_PARAM | ||
|
||
# remove debug packages and set user perms on packages | ||
mv $TOOLKIT/result_spk/nzbget-$SPK_VERSION/ $TOOLKIT/result_spk/nzbget/ | ||
rm $TOOLKIT/result_spk/nzbget/*_debug.spk | ||
chmod 666 $TOOLKIT/result_spk/nzbget/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
source /pkgscripts/include/pkg_util.sh | ||
|
||
package="nzbget" | ||
version="yyyymmdd-version" | ||
displayname="NZBGet" | ||
os_min_ver="7.0-41201" | ||
maintainer="nzbget@nzbget.com" | ||
adminport="6789" | ||
description="NZBGet is a binary downloader, which downloads files from Usenet based on information given in nzb-files." | ||
|
||
# populate arch | ||
BUILD_ARCH="$(pkg_get_platform)" | ||
arch=$BUILD_ARCH | ||
if [ "$BUILD_ARCH" == "alpine" ]; then arch="alpine alpine4k"; fi | ||
if [ "$BUILD_ARCH" == "armada37xx" ]; then arch="armada37xx rtd1296 rtd1619 aarch64"; fi | ||
if [ "$BUILD_ARCH" == "avoton" ]; then arch="apollolake avoton braswell broadwell broadwellnk broadwellntb broadwellntbap bromolow cedarview coffeelake denverton geminilake grantley kvmx64 purley skylaked v1000 x86_64"; fi | ||
if [ "$BUILD_ARCH" == "evansport" ]; then arch="evansport x86 i686"; fi | ||
|
||
[ "$(caller)" != "0 NULL" ] && return 0 | ||
pkg_dump_info |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# NZBGet Synology Package. | ||
|
||
NZBGet by nzbget.com | ||
|
||
NZBGet is a binary downloader, which downloads files from Usenet based on information given in nzb-files. | ||
|
||
NZBGet is written in C++ and is known for its performance and efficiency. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
case ${MakeClean} in | ||
[Yy][Ee][Ss]) | ||
make clean | ||
;; | ||
esac | ||
|
||
case ${CleanOnly} in | ||
[Yy][Ee][Ss]) | ||
return | ||
;; | ||
esac | ||
|
||
autoreconf --install | ||
|
||
# prefix with /usr/local, all files will be installed into /usr/local | ||
env CC="${CC}" CXX="${CXX}" LD="${LD}" AR=${AR} STRIP=${STRIP} RANLIB=${RANLIB} NM=${NM} \ | ||
CFLAGS="${CFLAGS} -Os" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" \ | ||
./configure ${ConfigOpt} \ | ||
--prefix=/usr/local --program-prefix="" --program-suffix="" | ||
|
||
make ${MAKE_FLAGS} | ||
|
||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[BuildDependent] | ||
|
||
[default] | ||
all="7.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
### Use PKG_DIR as working directory. | ||
PKG_DIR=/tmp/_spk | ||
rm -rf $PKG_DIR | ||
mkdir -p $PKG_DIR | ||
|
||
### get spk packing functions | ||
source /pkgscripts/include/pkg_util.sh | ||
|
||
create_package_tgz() { | ||
|
||
local package_tgz_dir=/tmp/_package_tgz | ||
local binary_dir=$package_tgz_dir/usr/local/bin | ||
|
||
### clear destination directory | ||
rm -rf $package_tgz_dir && mkdir -p $package_tgz_dir | ||
|
||
### install needed file into PKG_DIR | ||
mkdir -p $binary_dir | ||
cp -av nzbget $binary_dir | ||
cp -av nzbget.sc $binary_dir | ||
curl --insecure -o $binary_dir/cacert.pem https://curl.se/ca/cacert.pem | ||
|
||
make install DESTDIR="$package_tgz_dir" | ||
|
||
### create package.tgz $1: source_dir $2: dest_dir | ||
pkg_make_package $package_tgz_dir $PKG_DIR | ||
} | ||
|
||
create_spk(){ | ||
|
||
cp -av scripts $PKG_DIR/scripts | ||
rm $PKG_DIR/scripts/*.py | ||
cp -av PACKAGE_ICON*.PNG $PKG_DIR | ||
cp -av WIZARD_UIFILES $PKG_DIR | ||
cp -av conf $PKG_DIR | ||
|
||
./INFO.sh > INFO | ||
cp INFO $PKG_DIR/INFO | ||
|
||
### Create the final spk. | ||
# pkg_make_spk <source path> <dest path> <spk file name> | ||
# Please put the result spk into /image/packages | ||
# spk name functions: pkg_get_spk_name pkg_get_spk_unified_name pkg_get_spk_family_name | ||
mkdir -p /image/packages | ||
pkg_make_spk $PKG_DIR "/image/packages" $(pkg_get_spk_family_name) | ||
} | ||
|
||
main() { | ||
create_package_tgz | ||
create_spk | ||
} | ||
|
||
main "$@" |
Oops, something went wrong.