synology-wireguard/SynoBuildConf/install
Andreas Runfalk f4876efbc3 Initial commit
Signed-off-by: Andreas Runfalk <andreas@runfalk.se>
2019-03-17 16:02:37 +01:00

51 lines
1.1 KiB
Bash

#!/bin/bash
### Use PKG_DIR as working directory.
PKG_DIR=/tmp/_test_spk
rm -rf $PKG_DIR
mkdir -p $PKG_DIR
### get spk packing functions
source /pkgscripts-ng/include/pkg_util.sh
create_package_tgz() {
local package_tgz_dir=/tmp/_package_tgz
### clear destination directory
rm -rf $package_tgz_dir && mkdir -p $package_tgz_dir
### install needed file into PKG_DIR
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(){
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
### Generate INFO file
./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_name)
}
main() {
create_package_tgz
create_spk
}
main "$@"