openSUSE:一键安装 ISV
ISV 一键安装指南
本教程面向希望利用 10.3 及更高版本的一键安装功能的软件分发商。
打包软件
首先,您的软件必须打包成 RPM 格式,并且可供最终用户访问的软件包仓库中。如果尚未这样做,您可以使用 构建服务 创建软件包和仓库。构建服务也可以生成下面描述的 XML 文件。
创建元包
接下来,您需要创建一个 XML 元包文件,该文件将描述这些软件包及其所在位置。完整的模式和复杂示例可在 规范 中找到。对于这个简单的示例,我们将创建一个 XML 文件来安装名为“MyPackage”的软件包,该软件包位于位于 "http://example.com/MyRepository" 的仓库中。
<metapackage xmlns:os="https://opensuse.net.cn/Standards/One_Click_Install" xmlns="https://opensuse.net.cn/Standards/One_Click_Install"> <group> <!-- A software bundle, typically only one, or one for each distribution in each file. --> <name>My Package Bundle</name> <!-- Name of the whole software bundle Displayed in the UI --> <summary>This is a software bundle containing MyPackage</summary> <!-- Summary of the whole software bundle Displayed in the UI --> <description>This is the summary of the MyPackage Package I have made it unnecessarily long. Blah Blah Blah -- ChangeLog -- Some changes here. </description> <!-- Description of the whole software bundle Displayed in the UI --> <remainSubscribed>false</remainSubscribed> <!-- Specifies whether the user should remain subscribed to these repositories post installation, the user can override this. --> <repositories> <!-- A list of repositories required for this installation --> <repository> <name>MyRepository</name> <!-- Name of this repository --> <summary>This repository contains my packages.</summary> <!-- Summary of this repository--> <description>This repository contains my packages.</description><!-- Description of this repository, displayed in the UI--> <url>http://example.com/MyRepository</url><!-- URL of this repository to add--> </repository> </repositories> <software> <!-- A list of software items to install during this installation --> <item> <name>MyPackage</name> <!-- Name of the software, this both identifies it within the repository, and is displayed to the user --> <summary>This is a my package.</summary> <!-- Summary of the software --> <description>This my package, I think you should install it.</description> <!-- Description of the software, displayed in the UI. --> </item> </software> </group> </metapackage>
将此文件保存为 test.ymp,然后在 suse 中的 konqueror 中单击它,安装向导应会显示您输入的值。
创建 Web 安装链接
要在网页上创建安装此文件的链接
- 如果您可以控制 Web 服务器并使其提供这些文件作为 mimetype x-suse-ymp,只需创建指向上述说明中创建的 ymp 文件的链接即可。
<a href="http://example.com/test.ymp">Click here to install my package!</a>
- 如果您不能,或者不确定,只需将上述文件托管在您的 Web 服务器上,并创建如下所示的链接
<a href="data:text/x-suse-ymu,http://example.com/test.ymp">Click here to install my package!</a>
这将创建一些嵌入的 YMU mimetype 数据,处理程序将其理解为指向元包本身的指针。
物理介质
要在物理介质(如 CD)上使用安装程序,请在 CD 上包含仓库和名为“setup.ymp”的元包本身。
翻译 / 多种产品
您可能感兴趣的元包 XML 中的一些其他可能性
- 描述和摘要可以翻译,只需创建一个列表,例如
<description>Base description</description> <description lang="pt_BR">....</description>
等等。
- 可以指定多个组,以便一个文件可以安装在多个发行版上。元包将如下所示
<metapackage xmlns:os="https://opensuse.net.cn/Standards/One_Click_Install" xmlns="https://opensuse.net.cn/Standards/One_Click_Install"> <group> <!--fallback group if no distversion matches--> </group> <group distversion="openSUSE 10.2"> <!--What to install on 10.2--> </group> <group distversion="openSUSE 10.3"> <!--What to install on 10.3--> </group> <group distversion="Fedora 7"> <!--What to install on Fedora 7--> </group> </metapackage>
如果事先知道用户正在使用什么产品以及用户正在使用什么语言(例如,从浏览器标识字符串),建议仅在 YMP 文件中包含所需的信息以减少下载时间。当无法知道此信息时,才提供此灵活性。
这些是主要可能性,XML 中可以指定其他内容,请参阅 规范 以获取完整的模式。
图形
这里有一些可用于网站的按钮。它们由 Alex Hixon 创建,并以 svg 格式提供,以便于修改,例如使用 Inkscape。
http://mediati.org/buttons/(不再可访问,新的 .svg 源代码,由 - 以传统外观重新创建,也提供平板 UI 外观)
: