Home Wiki > openSUSE:Build Service product definition xml
Sign up | Login

openSUSE:Build Service product definition xml

tagline: From openSUSE

This is a (very) complex example for a Product Definition, including all possible traps currently known. Please have a look at the comments inside the XML to get an idea about the special solutions. The "normal" and recommended product definition should be much easier.

A subset of this file is installed on the system and parsed by libzypp. See Code11 Installed Products for the rationale.


Product file

Same flags of the product file will be handled like RPM handles the flags in the specfiles. For a full definition of these tags, please refer to the rpm documentation. The notes here are just a short reference.

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:  ?

We use the upcomming SUSE Linux Enterprise Server definition as this definition will use most of the defined flags. For openSUSE based products, some of these flags can be skipped.

<?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 (http://en.opensuse.org/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>

Element documentation

name: The product name. Important for NCC registration. Service Packs should have a different names.

version: The version of the product. Important for NCC registration.

arch: The architecture of the product. Important for NCC registration.

release: The release number of the product.

register/target: The target is important for NCC registration if an updatesource is from type NU. The target is used as filter and is a directory in the path to the update repository. All SUSE LINUX Enterprise Products (version 11) or Add-Ons build for this OS should have the same target: sle-11-%{_target_cpu} . %{_target_cpu} will be replaced with the architecture for what the product is build.

register/release: Special release value used only for NCC registration. The default is empty.

register/flavor: Will mostly describe the installation media. E.g. dvd5, dvd9, livedvd5, etc. It will be replaced with the media typ definition in the mediaset.

productline: A short name of the product which do not change between service packs and versions. E.g. sles, sled, sle-sdk, ...

group files

basis.group

This file includes a pattern definition. The pattern name is the same as the group name.

<?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

This group contains a conditional and platform specific solutions.

<?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

This group includes other groups. Note the conditionals inside the group definitions and the subgroup.

<?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

Special solution with a package where the default architecture should be replaced by another one.

<?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>