Skip to content

Packaging Guide

Johannes Renner edited this page Aug 29, 2019 · 2 revisions

Installation Path

All Formula sls files (contents of the subdirectory with the name of the Formula) should get installed to /usr/share/susemanager/formulas/states/<formula-name> and the contents of metadata (form.yml, metadata.yml, etc.) to /usr/share/susemanager/formulas/metadata/<formula-name>.

If it should be possible to use the Formula with either standalone Salt or from within Uyuni / SUSE Manager please install to /usr/share/salt-formulas/{states,metadata}. To configure Salt accordingly your Formula package will need to require the salt-formulas-configuration virtual provides.

Important: After SUSE Manager 3.2 EOL (in 2020) the installation path will in all cases be /usr/share/salt-formulas/{states,metadata}/<formula-name>.

Spec File Template

This is a template to be used for the spec file when packaging Formulas. Please make sure to adapt the Formula name and other parameters (e.g. the Version) correctly.

#
# spec file for package template-formula
#
# Copyright (c) 2019 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

%define fname template
%define fdir  %{_datadir}/susemanager/formulas
Name:           template-formula
Version:        0.1
Release:        0
Summary:        Salt Formula to serve as a template for others
License:        Apache-2.0
Group:          System/Packages
Url:            https://github.com/SUSE/salt-formulas
Source:         template-formula-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Salt Formula to serve as a template for others.

%prep
%setup -q

%build

%install
mkdir -p %{buildroot}%{fdir}/states/%{fname}
mkdir -p %{buildroot}%{fdir}/metadata/%{fname}
cp -R %{fname}/* %{buildroot}%{fdir}/states/%{fname}
cp -R metadata/* %{buildroot}%{fdir}/metadata/%{fname}

%files
%defattr(-,root,root)
%license LICENSE
%dir %{_datadir}/susemanager
%dir %{fdir}
%dir %{fdir}/states
%dir %{fdir}/metadata
%{fdir}/states/%{fname}
%{fdir}/metadata/%{fname}

%changelog
Clone this wiki locally