소스 검색

minor: init

tuonian 1 주 전
커밋
75cce78224

BIN
DSM_Developer_Guide_7_enu.pdf


+ 25 - 0
INFO.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+source /pkgscripts-ng/include/pkg_util.sh
+
+package="MyApplication"
+version="1.0-0001"
+os_min_ver="7.0-40000"
+#install_dep_packages="WebStation>=3.0.0-0323:PHP7.4>=7.4.18-0114:Apache2.4>=2.4.46-0122"
+maintainer="MyCompany"
+maintainer_url="http://app.mycompany.com"
+distributor="MyCompany"
+distributor_url="http://app.mycompany.com"
+silent_upgrade="no"
+arch="noarch"
+dsmappname="com.mycompany.app"
+displayname="Web example package"
+displayname_enu="Web example package"
+displayname_cht="Web 範例套件"
+description="This my sample package"
+description_enu="This my sample package"
+description_cht="這是我的範例套件"
+
+[ "$(caller)" != "0 NULL" ] && return 0
+
+pkg_dump_info

+ 1 - 0
LICENSE

@@ -0,0 +1 @@
+This is license example

+ 4 - 0
SynoBuildConf/build

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+#make ${MAKE_FLAGS}
+

+ 50 - 0
SynoBuildConf/install

@@ -0,0 +1,50 @@
+#!/bin/bash
+
+### Use PKG_DIR as working directory.
+PKG_DIR="/tmp/_MyApplication_pkg"	# temp folder for package files
+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
+
+	### clear destination directory
+	rm -rf $package_tgz_dir && mkdir -p $package_tgz_dir
+
+	### install needed file into PKG_DIR
+	cp -av ui $package_tgz_dir
+	cp -av src $package_tgz_dir
+	chown -R http:http $package_tgz_dir/src
+
+	### 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
+	cp -av conf $PKG_DIR
+	cp -av ui $PKG_DIR
+	cp -av LICENSE $PKG_DIR
+	cp -av ui/MyIcon_72.png  $PKG_DIR/PACKAGE_ICON.PNG
+	cp -av ui/MyIcon_256.png $PKG_DIR/PACKAGE_ICON_256.PNG
+
+	./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 "$@"

+ 7 - 0
conf/privilege

@@ -0,0 +1,7 @@
+{
+	"defaults":{
+		"run-as": "package"
+	},
+	"username": "MyApplication",
+	"join-groupname": "http"
+}

+ 72 - 0
conf/resource

@@ -0,0 +1,72 @@
+{
+	"webservice": {
+		"services": [{
+			"service": "myapplication",
+			"display_name": "MyApplication",
+			"support_alias": true,
+			"support_server": true,
+			"type": "apache_php",
+			"root": "myapplication",
+			"backend": 2,
+			"icon": "ui/MyIcon_{0}.png",
+			"intercept_errors": false,
+			"php": {
+				"profile_name": "MyApplication Profile",
+				"profile_desc": "PHP Profile for MyApplication",
+				"backend": 8,
+				"open_basedir": "/var/services/web_packages/myapplication:/tmp:/var/services/tmp",
+				"extensions": [
+					"curl",
+					"dom",
+					"exif",
+					"fileinfo",
+					"gd",
+					"hash",
+					"iconv",
+					"imagick",
+					"json",
+					"mbstring",
+					"mysql",
+					"mysqli",
+					"openssl",
+					"pcre",
+					"pdo_mysql",
+					"xml",
+					"zlib",
+					"zip"
+				],
+				"php_settings": {
+					"mysql.default_socket": "/run/mysqld/mysqld10.sock",
+					"mysqli.default_socket": "/run/mysqld/mysqld10.sock",
+					"pdo_mysql.default_socket": "/run/mysqld/mysqld10.sock"
+				},
+				"user": "MyApplication",
+				"group": "http"
+			},
+			"connect_timeout": 60,
+			"read_timeout": 3600,
+			"send_timeout": 60
+		}],
+		"portals": [{
+			"service": "myapplication",
+			"type": "alias",
+			"name": "myapplication",
+			"display_name": "MyApplication",
+			"alias": "myapplication",
+			"app": "com.mycompany.app"
+		}],
+		"migrate": {
+			"vhost": [{
+				"root": "myapplication",
+				"service": "myapplication"
+			}]
+		},
+		"pkg_dir_prepare": [{
+			"source": "/var/packages/MyApplication/target/src",
+			"target": "myapplication",
+			"mode": "0755",
+			"group": "http",
+			"user": "MyApplication"
+		}]
+	}
+}

+ 8 - 0
scripts/postinst

@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+### This script will be executed when package installed and upgraded.
+### Actions after package installed.
+### ex. create database, create symbolic link...
+
+exit 0

+ 8 - 0
scripts/postuninst

@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+### This script will be executed when package uninstalled and upgraded.
+### Actions after package uninstalled.
+### ex. remove garbage files.
+
+exit 0

+ 8 - 0
scripts/postupgrade

@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+### This script will be executed ONLY at package upgraded.
+### Actions after package upgraded.
+### ex. restore user settings.
+
+exit 0

+ 8 - 0
scripts/preinst

@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+### This script will be execute when package installed and upgraded.
+### Actions before package installed.
+### ex. check environment.
+
+exit 0

+ 8 - 0
scripts/preuninst

@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+### This script will be executed when package uninstalled and upgraded.
+### Actions before package uninstalled
+### ex. backup package data.
+
+exit 0

+ 8 - 0
scripts/preupgrade

@@ -0,0 +1,8 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+### This script will execute ONLY before package upgrade
+### Actions before package upgraded.
+### ex. backup user settings for package upgrade.
+
+exit 0

+ 28 - 0
scripts/start-stop-status

@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2000-2020 Synology Inc. All rights reserved.
+
+case $1 in
+	start)
+		### Start this package.
+		# run start command
+		echo "the package has been started" > $SYNOPKG_TEMP_LOGFILE
+		exit 0
+	;;
+	stop)
+		### Stop this package.
+		# run stop command
+		echo "the package has been stopped" > $SYNOPKG_TEMP_LOGFILE
+		exit 0
+	;;
+	status)
+		### Check package alive.
+		# run status command
+		exit 0
+	;;
+	killall)
+        ;;
+	log)
+		exit 0
+	;;
+esac
+

+ 1 - 0
src/index.php

@@ -0,0 +1 @@
+<?php phpinfo(); ?>

BIN
ui/MyIcon_128.png


BIN
ui/MyIcon_16.png


BIN
ui/MyIcon_24.png


BIN
ui/MyIcon_256.png


BIN
ui/MyIcon_28.png


BIN
ui/MyIcon_32.png


BIN
ui/MyIcon_48.png


BIN
ui/MyIcon_512.png


BIN
ui/MyIcon_56.png


BIN
ui/MyIcon_64.png


BIN
ui/MyIcon_72.png


+ 9 - 0
ui/index.conf

@@ -0,0 +1,9 @@
+{
+	"app": "com.mycompany.app"
+	"title": "MyApplication",
+	"desc": "app:wp_str_meta_desc",
+	"stringset": "texts",
+	"keywords":[
+		"myapplication", "MyApplication"
+	]
+}