openSUSE:Build Service baselibs.conf

Jump to: navigation, search

Template:TOC limit

Quickstart

To support so-called "bi-arch" distributions, special library packages need to be created. In 32-bit environments, 32-bit packages need to be created for use with 64-bit environments, and potentially also vice-versa. The build service can be instructed to create such packages automatically by including a file called baselibs.conf in the package sources. However, it has been common practice to not create any baselibs.conf until someone explicitly requests it (usually because they attempted to build some software – without the use of OBS – in 32-bit mode from a 64-bit environment).

The most basic form of that file is to just list the necessary packages, one per line. For example, the file for libxml looks like this:

libxml2
libxml2-devel

Libraries in the common library directories will automatically be included. It is also possible to include additional files, such as plugins or changing, for example, requirements.

tcl does this for example:

tcl
    +/usr/lib(64)?/tcl/.*
    requires -tcl-<targettype>

The package name (or subpackage name) must be located at the beginning of a line. Following lines should start with whitespace and constitute additional options for the package, for example:

  • +regex: add all files matching regex into the XXbit package
  • requires string: add additional dependencies to the XXbit package. To remove, a dependency start the string with a - (all RPM-supported deps such as provides or obsoletes are supported as well)
  • targetarch x86_64 block!: do not create a 32-bit package for x86_64
  • targettype x86 package foo: just create foo-x86 (and not foo-32bit) (analog: targettype x86 requires foo, provides, ....)

Supported macros:

  • <extension>
  • <name>
  • <version>
  • <targettype>
  • <prefix> ("" or "/emul/ia32-linux" depending on target)

Another example:

readline-devel
    requires -readline-<targettype>
    requires "libreadline5-<targettype> = <version>"

If you need XXbit packages just for a single arch, use the following example taken from numactl:

arch ppc package libnuma-devel
    requires -numactl-<targettype>
    requires "numactl1-<targettype> = <version>"

In general, bi-arch processed packages are stripped of any scriptlets (e.g. preinst, postinst) and supporting conffiles. If any are needed, they must be provided through the appropriate directives.

Directives

arch

The arch directive specifies how to handle packages of this architecture type.

The arch directive takes the following form:

 arch <arch> targets <target_arch>[:<target_type>] [<target_arch>[:<target_type>]...]

<arch> is the architecture to be built; e.g. i586
<target_arch> is the architecture of the package to be constructed; e.g. armv5el. It also sets the <targetarch> macro
<target_type> sets the <targettype> macro and is typicaly used as the suffix for the baselibs created packages

so

 arch i586 targets armv5el:x86lib armv7el:x86lib

means that subsequent package directives will be repackaged to both armv5el using <targettype>=x86lib and armv7el using <targettype>=x86lib

Each package declaration is processed multiple times with the <targettype> & <targetarch> pair set differently each time

targettype

Within a package declaration the targettype directive allows filtering of the actions applied

e.g.:

 bash
   targettype x86lib requires "libreadline6-x86lib"
   targettype cross_armv7 requires "libncurses5-armlib"

The first directive adds a requires for the x86lib pass, the second adds a different requires for the cross_armv7 pass

targetarch

Within a package declaration the targetarch directive allows filtering of the actions applied in the same way as targettype

It is used to specify package directives common to a target output architecture.

e.g.:

 bash
   targetarch armv5el requires "libncurses5-armlib"
   targetarch armv7el requires "libncurses5a-armlib"

prefix

Prefix can be used to add a custom prefix to all files. Normally prefix is "". A prefix of "/foo" would move files from e.g. /bin to /foo/bin .

legacyversion

extension

configdir

targetname

Package Relationships

Packages modified by baselibs.conf have their package relationship modifiers reset to empty; any desired relationships must be set in the baselibs.conf file.

The following directives all follow the same basic model:

[<filter> <criteria>] <directive> <value>

<filter> is one of targettype, targetarch


requires

rpm: requires
deb: Depends:

prereq

rpm: prerequires
deb: Pre-Depends:

provides

rpm: provides
deb: Provides:

conflicts

rpm: conflicts
deb: Conflicts:

recommends

rpm: reccomends
deb: Reccomends:

suggests

rpm: n/a
deb: Suggests:

supplements

rpm: supplements
deb: Enhances:

obsoletes

rpm: Obsoletes
deb: Replaces:

autoreqprov

This directive, when set to "off", limits the provides and requires to only those specified in the baselibs.conf. Note for .deb users, "AutoReqProv:" is a spec/rpm only directive.

Scripts

Packages modified by baselibs.conf have their pre-/post- scripts removed; any desired relationships must be set in the baselibs.conf file.

The following directives all follow the same basic model:

[<filter> <criteria>] <directive> <value>

<filter> is one of targettype, targetarch

A multi-line script needs multiple directives.

pre(in)

rpm: prein
deb: DEBIAN/preinst

post(in)

rpm: postin
deb: DEBIAN/postinst

preun

rpm: preun
deb: DEBIAN/prerm

postun

rpm: postun
deb: DEBIAN/postrm

Misc

baselib

config