Starting in 3006, only onedir packaging will be available. The 3006 onedir packages are built with the relenv tool.
The Salt Project uses docker containers to build our packages. If you are building your own packages you can use the same containers we build with in the Github piplines. These containers are documented here.
Install relenv:
pip install relenv
Fetch toolchain (Only required for linux OSs)
relenv toolchain fetch
Fetch Native Python Build:
relenv fetch --python=<python-version>
Create relenv environment:
relenv create --python=<python-version> <relenv-package-path>
Add Salt into onedir.
<relenv-package-path>/bin/pip install /path/to/salt
Install the dependencies:
yum -y install python3 python3-pip openssl git rpmdevtools rpmlint systemd-units libxcrypt-compat git gnupg2 jq createrepo rpm-sign rustc cargo epel-release yum -y install patchelf pip install awsclipip install -r requirements/static/ci/py{python_version}/tools.txt
(Optional) To build a specific Salt version, you will need to install tools and changelog dependencies:
pip install -r requirements/static/ci/py{python_version}/changelog.txt
Ensure you are in the current Salt cloned git repo:
cd <path-to-salt-repo>
(Optional) To build a specific Salt version, run tools and set Salt version:
tools changelog update-rpm <salt-version>
Build the RPM:
Only the arch argument is required, the rest are optional.
tools pkg build rpm --relenv-version <relenv-version> --python-version <python-version> --arch <arch>
Install the dependencies:
apt install -y apt-utils gnupg jq awscli python3 python3-venv python3-pip build-essential devscripts debhelper bash-completion git patchelf rustcpip install -r requirements/static/ci/py{python_version}/tools.txt
(Optional) To build a specific Salt version, you will need to install changelog dependencies:
pip install -r requirements/static/ci/py{python_version}/changelog.txt
Ensure you are in the current Salt cloned git repo.:
cd <path-to-salt-repo>
(Optional) To build a specific Salt version, run tools and set Salt version:
tools changelog update-deb <salt-version>
Build the deb package:
Only the arch argument is required, the rest are optional.
tools pkg build deb --relenv-version <relenv-version> --python-version <python-version> --arch <arch>
The python library is available in the install directory of the onedir package. For example
on linux the default location would be /opt/saltstack/salt/bin/python3
.