Repository navigation
Description
Deepin Application Specification
Every application should keep the rule in this document.
1. Application Information
Application should set the property Organization-name and Application-name.
Organization/Application name can contains alphabet, number and other visible ASCII code, BUT space MUST NOT appear in the name. And we do not approve of no-ASCII code character in the Organization/Application name
Application can stay Organization-name empty, but it should always set an Application-name.
2. Standard Path
The log, configure and runtime cache of Application should store in specific path.
If Organization-name is empty, "{Organization-name}/" would not appear in path.
2.1 User Application Standard Path
As an application run for user session, the Standard path should be:
XGD_LOG_HOME_DEEPIN:
Where deepin-user-specific log should be written.
XGD_USER_HOME/.log
DAPP_CONFIG_HOME:
Where application-specific configurations should be written.
XDG_CONFIG_HOME/{Organization-name}/{Application-name}
DAPP_LOG_HOME:
Where application-specific log should be written.
XGD_LOG_HOME_DEEPIN/{Organization-name}/{Application-name}
DAPP_CACHE_HOME:
Where application-specific cache files should be written.
XGD_CACHE_HOME/{Organization-name}/{Application-name}
DAPP_DATA_HOME:
Where application-specific data files should be written.
$XDG_DATA_HOME/{Organization-name}/{Application-name}
2.2 System Application Standard Path
Application run as system daemon, or with user with no home directory should place it's file in this standard path:
DAPP_CONFIG_SYS:
/etc/{Organization-name}/{Application-name}
DAPP_LOG_SYS:
/var/log/{Organization-name}/{Application-name}
DAPP_DATA_SYS:
/usr/share/{Organization-name}/{Application-name}
DAPP_CACHE_SYS:
/var/cache/{Organization-name}/{Application-name}
Refs:
Activity
Iceyer commentedon Feb 18, 2016
Simple example:
The dde-dock is offcial application of deepin and the standard path will be:
fasheng commentedon Feb 19, 2016
s/XGD/XDG/
日志这块推荐使用 syslog, 实在不方便则放到
/var/log或$HOME/.cache, 如$HOME/.cache/deepin/dde-dock/dde-dock.log, 不建议专门使用$HOME/.log目录.关于 Application-name, 可能和之前的规范混淆, 因为按照 #31 的讨论结果, dde-dock 的 Application-name 应该为
Dock, 所以这里要么使用 Project-name, 要么专门解释下 Application-name.Iceyer commentedon Feb 19, 2016
用syslog可以解决存放的问题,但在当用户不想用syslog时,应该给出一个标准的存放路径。用
$HOME/.log是考虑.cache一般存在程序自动生成的文件,到用户可能会清除.cache目录以便解决相关问题, 这时候最好能够保留日志。Application-name这个概念的确和之前的讨论有混淆,应该指生成的二进制文件的名字,主要方便用户查找日志,这个不知道叫什么比较合适。Project下面可能会有多个Application,不大适合。如果名优好的命名可以单独解释一下这里的 Application-name.并给出示例。