openSUSE:Package Conditional Build Dependencies

Jump to: navigation, search


Our base packages include support for all sorts of features, making our base OS very large due to dependencies. While this is not a problem for e.g. openSUSE Tumbleweed, where the extra packages do not really matter in the overall size, it is a big problem when building a small single-purpose OS where you want something really small without any unnecessary packages. The "useless" packages create yet another problem:

Libraries are installed for features that are not supported or do not work. E.g. AppArmor and SELinux are exclusive, so why should e.g. ALP ship AppArmor that can't work and isn't supported, but creates a high maintenance overhead on all sides without any benefit?

Conditional Build Requires per project

The solution is to enable/disable BuildRequires and code in the spec file for packages per project with %bcond (see

The functionality should be enabled by default as it is today, for special cases or new features this could be different.

A spec file could look like the following example for openssh:

# Enable kerberos by default
%bcond_without kerberos
%if %{with kerberos}
%if 0%{?suse_version} > 1500
BuildRequires:  pkgconfig(krb5)
BuildRequires:  krb5-mini-devel
%if %{with kerberos}
    --with-kerberos5=%{_prefix} \
%files common
%if %{with kerberos}
%doc README.kerberos

Keywords for features

The following keywords will be used to enable/disable functionality per project in the prjconf:

  • aac
  • acl_tests only for the 'acl' package itself to declare the test suite not to run in the distro bootstrap
  • ada shouldn't be used - some specs wrongly use bcond to disable a non-working feature in their source (ncurses, plplot)
  • apparmor
  • aspell utilize aspell functionality (e. g. enchant)
  • avif avif support trough libavif (e. g. gd)
  • djvu utilize djvu functionality (e. g. trough djvulibre in ImageMagick)
  • faac Freeware Advanced Audio Coder - to be disabled in the reference OBS, some 3rd parties rebuild sources with this enabled
  • faad faad2 media support; must be disabled inside the reference OBS, but 3rd-parties rebuild sources with this enabled
  • fdk_aac Fraunhofer FDK AAC support - to be disable in the reference OBS, enabled by 3rd parties
  • ffmpeg
  • fltk use fltk as a backend (e. g. pinentry)
  • fluidsynth
  • gnome
  • gstreamer
  • java
  • kerberos
  • ldap
  • libnsl (NIS support)
  • mono
  • openblas
  • sbl (screen-reader for linux; only used by installation-images to shrink stagings)
  • selinux
  • slp Enable/disable SLP support (
  • utmp Enable/disable utmp and wtmp support in applications
  • vnc