Skip to content

Adding new Salt Bundle Dependencies

Alexander Graul edited this page Nov 14, 2024 · 1 revision

This page describes the normal workflow used to add new dependencies to the Salt Bundle. The steps show commands that automatically do the required changes. In the future, we can put these into a script that executes them in order.

The high level approach to new dependencies is to start with the package you want to add. Adjust this package as explained below. Typically new Salt Bundle dependencies require additional dependencies that are not yet built for the Salt Bundle. OBS will show that the package build can't start because of unresolvable. Take a look at the missing dependencies and pick the one of them. Do the adjustments for this transitive dependency before returning to the original package. In other words, take a tree recursion approach.

Adapting a Package for Salt Bundle

Python Library

  1. Create a new OBS package based on the original package. The new package re-uses the old name, except for a s/python-/saltbundlepy-/
osc linkpac SUSE:SLE-15-SP6:Update python-packaging home:PSuarezHernandez:bundle_dbus saltbundlepy-packaging
  1. Rename specfile and changelog file
rename python- saltbundlepy- *.{changes,spec}
  1. Replace the python_module macro with our own flavor
sed -i 'N;/# Please submit bugfixes or comments via https:\/\/bugs.opensuse.org\/\n#/a\%{?!saltbundlepy_module:%define saltbundlepy_module() saltbundlepy-\%{**}}\
\%define pythons saltbundlepy' *.spec
sed -i 's/python-rpm-macros/saltbundlepy-rpm-macros/' *.spec
sed -i 's/python_module/saltbundlepy_module/' *.spec
sed -i 's/^\(Requires:\s*\|Recommends:\s*\)python-/\1saltbundlepy-/' *.spec

Disabling Unwanted Tests

Some Python libraries require a lot of tests to run their test suite in %check. We're not always interested in packaging all test dependencies. When adding a lot of test dependencies is not worth it, we can disable tests within the package. This can be done in different ways, some packages use different build flavors. In this case, delete the test build flavor.

sed -i '/<package>test<\/package>/d' _multibuild 

Other Library

These libraries are often written in C/C++. We keep them as original as possible and only change what we need to build them for our different code streams.

osc linkpac SUSE:SLE-15-SP6:Update glib2 home:PSuarezHernandez:bundle_dbus saltbundle-glib2

Copyright Header

We create new packages, therefore the copyright header must be up to date.

sed -i "s/^#\s*Copyright\s*(c)\s*[[:digit:]]\+\s*SUSE\s*LLC/# Copyright (c) $(date +%Y) SUSE LLC/" *.spec

Adding a new Package to the Code Streams

There are two Salt Bundle code streams at the same time, systemsmanagement:saltstack:bundle and systemsmanagement:saltstack:bundle:next. New packages are generally added to bundle:next first, and to bundle later, through systemsmanagement:saltstack:bundle:testing.

Once the new dependency and all its dependency are building successfully, it is time to submit the work to our code streams. All packages can be submitted together when they are built in a separate project.

Update Documentation & Tools

Package List

We keep the list of packages included in the Salt Bundle in the wiki. Add the new packages and their origins to the wiki page.

Updates Listing Tool

openSUSE/lubed's configuration needs to know about the new packages and their origins, i.e. where we take them from. The configuration is in a TOML file. Add the new packages to the configuration.