-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add instructions and helper scripts to create SPK installation packag…
…e for Synology.
- Loading branch information
Showing
13 changed files
with
178 additions
and
4 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,2 @@ | ||
_* | ||
*.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package="icloud_photo_station" | ||
version="0.1.0" | ||
description="Synchronize iCloud Photos to Photo Station" | ||
|
||
maintainer="Juho Kolehmainen" | ||
arch="noarch" | ||
displayname="iCloud Photo Station" | ||
firmware="6.1-7321" | ||
support_url="https://github.com/skarppi/icloud_photo_station" | ||
|
||
install_dep_packages="PhotoStation" | ||
|
||
startable="no" | ||
thirdparty="yes" |
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,73 @@ | ||
#!/bin/bash | ||
|
||
PKG_DIR=_spk | ||
TGZ_DIR=_tgz | ||
|
||
PKG_UTIL='pkg_util.sh' | ||
|
||
VIRTUALENV='virtualenv-15.1.0.tar.gz' | ||
|
||
clean() { | ||
rm -fr $PKG_DIR | ||
rm -fr $TGZ_DIR | ||
|
||
#rm _${PKG_UTIL} | ||
#rm _${VIRTUALENV} | ||
} | ||
|
||
setup() { | ||
|
||
# download a helper script for creating Synology packages | ||
if [ ! -f _${PKG_UTIL} ]; then | ||
wget -O _${PKG_UTIL} https://raw.githubusercontent.com/SynologyOpenSource/pkgscripts-ng/master/include/${PKG_UTIL} | ||
fi | ||
source _${PKG_UTIL} | ||
|
||
# download virtualenv distribution to be included in our installation package | ||
if [ ! -f _${VIRTUALENV} ]; then | ||
wget -O _${VIRTUALENV} https://pypi.python.org/packages/d4/0c/9840c08189e030873387a73b90ada981885010dd9aea134d6de30cd24cb8/${VIRTUALENV} | ||
fi | ||
|
||
mkdir -p $PKG_DIR | ||
mkdir -p $TGZ_DIR | ||
} | ||
|
||
create_package_tgz() { | ||
# Install virtual env and all libraries | ||
tar xvfz _${VIRTUALENV} -C $TGZ_DIR | ||
pip wheel --wheel-dir=${TGZ_DIR}/wheelhouse -r ../requirements.txt | ||
|
||
# Copy python app | ||
mkdir -p ${TGZ_DIR}/app | ||
cp -av ../*.py $TGZ_DIR/app | ||
|
||
# ### create package.tgz $1: source_dir $2: dest_dir | ||
pkg_make_package $TGZ_DIR "${PKG_DIR}" | ||
} | ||
|
||
create_spk() { | ||
local scripts_dir=$PKG_DIR/scripts | ||
|
||
### Copy package center scripts to PKG_DIR | ||
mkdir -p $scripts_dir | ||
cp -av scripts/* $scripts_dir | ||
|
||
### Copy package icon | ||
cp -av PACKAGE_ICON*.PNG $PKG_DIR | ||
|
||
### Copy INFO file | ||
cp -av 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 | ||
pkg_make_spk ${PKG_DIR} . $(pkg_get_spk_family_name) | ||
} | ||
|
||
clean | ||
setup | ||
create_package_tgz | ||
create_spk | ||
|
||
clean |
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,13 @@ | ||
#!/bin/sh | ||
|
||
### This script will be executed when package installed and upgraded. | ||
### Actions after package installed. | ||
### ex. create database, create symbolic link... | ||
|
||
# Create a Python virtualenv | ||
python ${SYNOPKG_PKGDEST}/virtualenv-15.1.0/virtualenv.py ${SYNOPKG_PKGDEST}/env | ||
|
||
# Install the wheels | ||
${SYNOPKG_PKGDEST}/env/bin/pip install --no-deps --no-index -U --force-reinstall -f ${SYNOPKG_PKGDEST}/wheelhouse ${SYNOPKG_PKGDEST}/wheelhouse/*.whl | ||
|
||
exit 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,7 @@ | ||
#!/bin/sh | ||
|
||
### This script will be executed when package uninstalled and upgraded. | ||
### Actions after package uninstalled. | ||
### ex. remove garbage files. | ||
|
||
exit 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,7 @@ | ||
#!/bin/sh | ||
|
||
### This script will be executed ONLY at package upgraded. | ||
### Actions after package upgraded. | ||
### ex. restore user settings. | ||
|
||
exit 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,7 @@ | ||
#!/bin/sh | ||
|
||
### This script will be execute when package installed and upgraded. | ||
### Actions before package installed. | ||
### ex. check environment. | ||
|
||
exit 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,7 @@ | ||
#!/bin/sh | ||
|
||
### This script will be executed when package uninstalled and upgraded. | ||
### Actions before package uninstalled | ||
### ex. backup package data. | ||
|
||
exit 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,7 @@ | ||
#!/bin/sh | ||
|
||
### This script will execute ONLY when package upgraded. | ||
### Actions before package upgraded. | ||
### ex. backup user settings for package upgrade. | ||
|
||
exit 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,19 @@ | ||
#!/bin/sh | ||
|
||
case $1 in | ||
start) | ||
exit 0 | ||
;; | ||
stop) | ||
exit 0 | ||
;; | ||
status) | ||
exit 0 | ||
;; | ||
killall) | ||
;; | ||
log) | ||
exit 0 | ||
;; | ||
esac | ||
|