openSUSE:Build Service product definition xml

Jump to: navigation, search

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="">
 <product id="sle-11-server">
    - 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?
        <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 (
             for details about the ncc_target. -->
            <!-- release is optional and normally empty -->
          /* 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 
          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 -->

            <url name="releasenotes"></url>
            <url name="smolt"></url>
            <url name="register"></url>
            <url name="optional"></url>
            <url name="update"></url>
            <url name="extra"></url>

            <!-- This section is needed to generate the installation media -->
                <!-- and now a hidden feature: additional language on the media, but not available during install -->
            <!-- should be false for sles -->
            <!-- if above is true, which packagemanager to use? -->

            <!-- All flags needed during installation -->
            <!-- needed for current content file -->
            <references name="sles-release" version="11"/>

            <!-- All Flags needed in the running system -->


        <conditional name="baselibs_only_x86_64">
                <platform onlyarch="x86_64" />
        <conditional name="baselibs_hammer_from_i686">
                <platform arch="x86_64" baselibs_arch="i686" />
        <conditional name="dvd9_media_1">
           <media number="1" />
        <conditional name="dvd5_media_1">
           <media number="2" />

        <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"/>

        <media type="dvd5" 

            <archset basearch="i586">
            <archset basearch="ppc">

          <!-- 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 group="basis_enhanced"/>
          <use group="mozilla" create_pattern="false" />
              <!-- 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" />

        <media type="dvd9" 
            <archset basearch="i586">
            <archset basearch>
          <!-- ... -->

        <media type="ftp">
          <!-- ... -->

        <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" />

    <xi:include href="group.basis.xml" />
    <xi:include href="group.enhanced-basis.xml" />
    <!-- ToDo: check and write catalogs for this: -->
    <xi:include href="" />
    <!-- the statement above will become: <xi:include href="ibs://SLE-10-SP1/group.x11.xml" /> -->
    <xi:include href="" />
    <!-- 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" />

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

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">
            <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>
               <!-- 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" />

        <packagelist relationship="required" id="basis.required">
            <package name="glibc">
                <!-- todo: add way to include i686 arch additionally -->
            <package name="libdb-4_5">
                <conditional name="baselibs_hammer_from_i686" />
            <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" />
        <packagelist relationship="recommended">
            <package name="bash" />

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">
       <packagelist relationship="required">
            <package name="gnome-panel-32bit">
            <conditional name="baselibs_only_x86_64" />
<?xml version="1.0" encoding="UTF-8"?>
    <group name="virt">
            <summary lang="de">viele kleine computer in einem</summary>
        <packagelist relationship="required">
            <package name="xen">
                <!-- TODO: this should *NOT* overwrite the native package -->
                <platform arch="i586" source_arch="x86_64" (replace_native="false") />
        <packagelist relationship="suggested">
        <group name="yast">
           <packagelist relationship="suggested">
            <package name="yast2-s390">
                <platform excludearch="s390" />
                <platform onlyarch="s390x" />

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" />

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">
        <packagelist relationship="required">
             <package name="MozillaFirefox">
                <platform arch="x86_64" source_arch="i586" replace_native="true" />
            <package name="mozilla-xulrunner190" />
            <package name="mozilla-xulrunner190-32bit">
                <platform onlyarch="x86_64" />