openSUSE:Build Service 产品定义 XML
这是一个(非常)复杂的示例,用于,包含了当前已知的所有潜在问题。请查看 XML 内部的注释,以了解特殊的解决方案。 “正常”且推荐的产品定义应该更容易。
此文件的一个子集被安装到系统中,并由 libzypp 解析。有关原因,请参阅 。
产品文件
产品文件的相同标志将像 RPM 处理 spec 文件中的标志一样处理。有关这些标签的完整定义,请参阅 rpm 文档。这里的说明只是一个简短的参考。
Name: No whitespace Version: integer Release: integer Summary: one line only Description: nearly all chars allowed, multiple lines allowed Requires: dependencies Obsoletes: " Recommends: " Suggests: " Interesting/to be discussed: Group: ? License: ?
我们使用即将发布的 SUSE Linux Enterprise Server 定义作为此定义,因为它将使用大多数定义的标志。对于基于 openSUSE 的产品,可以跳过其中一些标志。
<?xml version="1.0" encoding="UTF-8"?>
<productdefinition xmlns:xi="http://www.w3.org/2001/XInclude">
<products>
<product id="sle-11-server">
<!--
todo:
- pattern translations -> tool needs to create pot file from the xml
- solver:
+ choose locales automatically
+ conflicting patterns and packages
+ group with "preferred" packages for the solver (postfix vs. sendmail)
- add on product handling:
+ registration required even for add on products
+ what about openSUSE add ons that don't need registration but an extra update channel?
-->
<vendor>Novell</vendor>
<name>SUSE_SLES</name>
<version>11</version>
<release>0</release> <!-- needed for example if an ISO has to rebuild /* NEEDS TO BE DISCUSSED */ -->
<!-- Please have a look at the Products file definition (https://en.opensuse.net.cn/Build_Service/Product_Definition/products_file).
for details about the ncc_target. -->
<register>
<target>sle-11-%{_target_cpu}</target>
<!-- release is optional and normally empty -->
<release></release>
<flavor>ftp</flavor>
</register>
<!--
/* required for NCC registration */
Note: the target Flag has to be discussed between PrjMgr and NCC-Team -
and shouldn't change the whole lifetime of the product.
Normally, just needed for Enterprise - here just for
reference.
FYI: the distribution tag will be generated during media creation.
* flavor will be replaced with the <media type="dvd5"/> definition in the mediaset.
* the %{_target_cpu} macro will be expanded
with the basearch of the product.
* release is reserved for special versions of a product
-->
<updaterepokey>strings</updaterepokey> /* SPEAK WITH DUNCAN */
<summary>A cool distribution</summary> <!-- one line only -->
<summary lang="de">Einfach genial</summary>
<description>This is the coolest distribution on the world.
Try it out and find it useful.</description> <!-- multiple lines allowed -->
<description lang="de">Was soll man da sagen?
Einfach toll!</description>
<!-- below is a list of Flags which perhaps need to be present in buildconfig, installconfig and runtimeconfig -->
<!-- Available languages for collecting packages and during installation and runtime -->
<linguas>
<lang>da</lang>
<lang>de</lang>
</linguas>
<urls>
<url name="releasenotes">http://www.suse.com/relnotes/i386/SLE/11/release-notes-sles.rpm</url>
<url name="smolt">http://smolt.opensuse.org/register.pl</url>
<url name="register">http://register.novell.com/</url>
<url name="optional">http://download.opensuse.org/debug/</url>
<url name="update">http://update.opensuse.org/</url>
<url name="extra">http://download.opensuse.org/non-oss/</url>
</urls>
<buildconfig>
<!-- This section is needed to generate the installation media -->
<producttheme>SLES</producttheme>
<betaversion>-Alpha3plus</betaversion>
<linguas>
<!-- and now a hidden feature: additional language on the media, but not available during install -->
<lang>af</lang>
</linguas>
<!-- should be false for sles -->
<allowresolving>false</allowresolving>
<!-- if above is true, which packagemanager to use? -->
<packagemanager>zypper</packagemanager>
</buildconfig>
<installconfig>
<!-- All flags needed during installation -->
<defaultlang>en_US</defaultlang>
<!-- needed for current content file -->
<datadir>suse</datadir>
<descrdir>suse/setup/descr</descrdir>
<references name="sles-release" version="11"/>
<distribution>SUSE_SLE</distribution>
</installconfig>
<runtimeconfig>
<!-- All Flags needed in the running system -->
</runtimeconfig>
</product>
</products>
<conditionals>
<conditional name="baselibs_only_x86_64">
<platform onlyarch="x86_64" />
</conditional>
<conditional name="baselibs_hammer_from_i686">
<platform arch="x86_64" baselibs_arch="i686" />
</conditional>
<conditional name="dvd9_media_1">
<media number="1" />
</conditional>
<conditional name="dvd5_media_1">
<media number="2" />
</conditional>
</conditionals>
<repositories>
<repository name="standard" priority="1" href="obs:SUSE:SLE-11-SP0:GA"/>
<repository name="Education" priority="3" href="obs://Education:desktop"/>
<repository name="local_app" priority="4" href="file:///space/tree/suse"/>
</repository>
<mediasets>
<media type="dvd5"
product="sle-11-server"
name="sle-11-server-dvd5"
sourcemedia="false"
create_pattern="true"
use_required="true"
use_recommended="true"
use_suggested="false">
<mediaarchs>
<archset basearch="i586">
<arch="i586"/>
<arch="i686"/>
<arch="x86_64"/>
</archset>
<archset basearch="ppc">
<arch="ppc"/>
<arch="ppc64"/>
</archset>
</mediaarchs>
<!-- we put all packages (even suggested) on the media for the two groups below -->
<use group="apparmor" use_suggested="true" />
<use group="base" use_suggested="true" />
<!-- packages from the other groups will be included if defined as required or recommended only -->
<!-- can be overwritten in each section of the group for single pacakges -->
<use group="Basis-Devel" />
<use group="dhcp_dns_server" />
<use group="virtualisation">
<!-- mark a recommended package as required on this media -->
<package name="kernel-xen" relationship="required" />
</use>
<use group="basis_enhanced"/>
<use group="mozilla" create_pattern="false" />
<metadata>
<!-- if you like to add a metapackage to the real media, add it in a normal group.xml file -->
<package name="dosutils" />
<package name="installation-images" />
<package name="yast2-slide-show-SLES" />
<!-- needed ? -->
<file name="README.txt" />
</metadata>
</media>
<media type="dvd9"
product="sle-11-server"
name="sle-11-server-dvd9"
create_pattern="true"
use_required="true"
use_recommended="true"
use_suggested="false">
<mediaarchs
<archset basearch="i586">
<arch="i586"/>
<arch="x86_64"/>
<archset basearch>
</mediaarchs>
<!-- ... -->
</media>
<media type="ftp">
<!-- ... -->
</media>
<media type="livedvd5" ... >
<use group="basis" />
<use group="basis_enhanced" create_pattern="true" use_required="true" />
<!-- /product/packages/group[@name='gnome' -->
<use group="gnome" create_pattern="true" use_required="true">
<!-- too big for this -->
<include group="banshee" relationship="suggested" />
</use>
</media>
</mediasets>
<xi:include href="group.basis.xml" />
<xi:include href="group.enhanced-basis.xml" />
<!-- ToDo: check and write catalogs for this: -->
<xi:include href="https://api.suse.de/products/SLE-10-SP1/group.x11.xml" />
<!-- the statement above will become: <xi:include href="ibs://SLE-10-SP1/group.x11.xml" /> -->
<xi:include href="https://api.opensuse.org/products/openSUSE_11.0/group.banshee.xml" />
<!-- the statement above will become: <xi:include href="obs://openSUSE_11.0/group.banshee.xml" /> -->
<xi:include href="obs://openSUSE_11.0/group.gnome.xml" />
</productdefinition>
元素文档
name:产品名称。NCC 注册很重要。服务包应具有不同的名称。
version:产品的版本。NCC 注册很重要。
arch:产品的架构。NCC 注册很重要。
release:产品的发布号。
register/target:如果 updatesource 的类型为 NU,则目标对于 NCC 注册非常重要。目标用作过滤器,是更新仓库路径中的一个目录。所有 SUSE LINUX Enterprise 产品(版本 11)或为此操作系统构建的附加组件应具有相同的目标:sle-11-%{_target_cpu} 。%{_target_cpu} 将被替换为构建产品的架构。
register/release:仅用于 NCC 注册的特殊发布值。默认情况下为空。
register/flavor:将主要描述安装介质。例如,dvd5、dvd9、livedvd5 等。它将被 mediaset 中的媒体类型定义替换。
productline:产品的一个简短名称,在服务包和版本之间不会更改。例如,sles、sled、sle-sdk、...
group 文件
basis.group
此文件包含一个模式定义。模式名称与组名称相同。
<?xml version="1.0" encoding="UTF-8"?>
<group name="basis" version="11" release="0">
<!-- Pattern definition - Ordernumber is unique -->
<pattern ordernumber="1020">
<name>basis</name>
<icon>pattern-basis</icon>
<visible>true</visible>
<category>Base Technologies</category>
<category lang="de">Basis Technologien</category>
<summary>Base System</summary>
<summary lang="de">Basis System</summary>
<description>Very long description what the Base System is.</description>
<description lang="de">Eine sehr lange Beschreibung über das Basis-System.</description>
<relationships>
<!-- provides -->
<pattern name="basesystem" relationship="provides" />
<!-- conflicts -->
<pattern name="gnome" relationship="conflicts" />
<!-- obsoletes with version and release tag -->
<obsoletes pattern="voip_server" version="10.3" release="0" flag="lt" />
<!-- this pattern depends on other patterns -->
<pattern name="apparmor" relationship="recommended" />
<pattern name="sw_management" relationship="recommended" />
<pattern name="yast2_install_wf" relationship="required" />
<!-- other examples taken from the 11.1 patterns -->
<pattern name="gnome" relationship="freshens" />
<pattern name="games" relationship="extends" />
<pattern name="games" relationship="supplements" />
</relationships>
</pattern>
<packagelist relationship="required" id="basis.required">
<package name="glibc">
<!-- todo: add way to include i686 arch additionally -->
</package>
<package name="libdb-4_5">
<conditional name="baselibs_hammer_from_i686" />
</package>
<package name="glibc-32bit">
<!-- the default would be taking the baselibs from i586 just use i686 here -->
<conditional name="baselibs_hammer_from_i686" />
<conditional name="dvd5_media_2" />
</package>
</packagelist>
<packagelist relationship="recommended">
<package name="bash" />
</packagelist>
</group>
enhanced_base.group
此组包含条件和特定于平台的解决方案。
<?xml version="1.0" encoding="UTF-8"?>
<group name="enhanced-basis" relationship="recommended">
<pattern odernumber="1030">
<name>enhanced_base</name>
</pattern>
<packagelist relationship="required">
<package name="gnome-panel-32bit">
<conditional name="baselibs_only_x86_64" />
</package>
</packagelist>
</group>
<?xml version="1.0" encoding="UTF-8"?>
<group name="virt">
<pattern>
<name>virtualisation</name>
<summary lang="de">viele kleine computer in einem</summary>
</pattern>
<packagelist relationship="required">
<package name="xen">
<!-- TODO: this should *NOT* overwrite the native package -->
<platform arch="i586" source_arch="x86_64" (replace_native="false") />
</package>
</packagelist>
<packagelist relationship="suggested">
<group name="yast">
<packagelist relationship="suggested">
<package name="yast2-s390">
<platform excludearch="s390" />
<platform onlyarch="s390x" />
</package>
</packagelist>
</packagelist>
</group>
gnome.group
此组包含其他组。请注意组定义内部的条件和子组。
<?xml version="1.0" encoding="UTF-8"?>
<group name="gnome">
<include group="mozilla" />
<include group="banshee" />
<group name="gnome_with_baselibs">
<conditional name="baselibs_only_x86_64" />
<package name="gnome-main-menu-32bit" />
</group>
</group>
mozilla.group
一个特殊的解决方案,其中默认架构应替换为另一个架构。
<?xml version="1.0" encoding="UTF-8"?>
<group name="mozilla">
<pattern ordernumber="1050">
<name>Vogelsoftware</name>
</pattern>
<packagelist relationship="required">
<package name="MozillaFirefox">
<platform arch="x86_64" source_arch="i586" replace_native="true" />
</package>
<package name="mozilla-xulrunner190" />
<package name="mozilla-xulrunner190-32bit">
<platform onlyarch="x86_64" />
</package>
</packagelist>
</group>