agama/products.d/agama-products.spec
Ladislav Slezák 87a04f1769
Do not build on 32bit architectures (and PPC64-BE) (bsc#1251846) (#2880)
## Problem

- https://bugzilla.suse.com/show_bug.cgi?id=1251846
- Agama does not build on i586
- The reason is that the dependant libsuseconnect does not support that
architecture (because of [this
line](5a200487c5/internal/util/system.go (L24-L27)))

## Solution

- Disable the same architectures also in Agama builds, use [the same
line](5a200487c5/build/packaging/suseconnect-ng.spec (L42))
from libsuseconnect to be compatible with it (this also disables build
on PPC64-BE)
- I was wondering whether `ExcludeArch` is allowed for noarch packages
but the [Fedora packaging
documentation](https://docs.fedoraproject.org/en-US/packaging-guidelines/#_noarch_with_unported_dependencies)
actually suggests this approach exactly for this situation.

## Testing

- Tested manually with agama-web-ui, the package built fine locally
2025-11-20 11:58:48 +01:00

100 lines
3 KiB
RPMSpec

#
# spec file for package agama-products
#
# Copyright (c) 2025 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: agama-products
# This will be set by osc services, that will run after this.
Version: 0
Release: 0
Summary: Definition of products for the Agama installer
License: GPL-2.0-only
URL: https://github.com/agama-project/agama
BuildArch: noarch
Source0: agama.tar
# do not include in the 32bit repos, the Agama is 64bit only
ExcludeArch: %ix86 s390 ppc64
%description
Products definition for Agama installer.
%prep
%autosetup -a0 -n agama
%build
%install
env \
SRCDIR=. \
DESTDIR=%{buildroot} \
datadir=%{_datadir} \
%{_builddir}/agama/install.sh
# for now remove kalpa from all builds until it is fixed
rm -f %{buildroot}%{_datadir}/agama/products.d/kalpa.yaml
# Keep only Leap based distros on Leap
%if 0%{?is_opensuse} && 0%{?suse_version} == 1600
rm -f %{buildroot}%{_datadir}/agama/products.d/microos.yaml
rm -f %{buildroot}%{_datadir}/agama/products.d/tumbleweed.yaml
rm -f %{buildroot}%{_datadir}/agama/products.d/slowroll.yaml
%endif
# Keep TW-based distros on TW (drop Kalpa + Leap + Leap Micro)
%if 0%{?is_opensuse} && 0%{?suse_version} > 1600
rm -f %{buildroot}%{_datadir}/agama/products.d/leap*.yaml
%endif
%package opensuse
Summary: Definition of openSUSE products for the Agama installer.
%description opensuse
Definition of openSUSE products (Tumbleweed, Leap, MicroOS and Slowroll) for the Agama installer.
%files opensuse
%doc README.md
%license LICENSE
%dir %{_datadir}/agama
%dir %{_datadir}/agama/products.d
# if building on SLES add all opensuse products
%if !0%{?is_opensuse} || 0%{?suse_version} > 1600
%{_datadir}/agama/products.d/microos.yaml
%{_datadir}/agama/products.d/tumbleweed.yaml
%{_datadir}/agama/products.d/slowroll.yaml
%endif
%if !0%{?is_opensuse} || 0%{?suse_version} == 1600
%{_datadir}/agama/products.d/leap_160.yaml
%{_datadir}/agama/products.d/leap_micro_62.yaml
%endif
%package sle
Summary: Definition of SLE products for the Agama installer.
%description sle
SLE-based products definition for Agama installer.
Definition of SLE-based products (e.g., SUSE Linux Enterprise Server) for the Agama installer.
%files sle
%doc README.md
%license LICENSE
%dir %{_datadir}/agama
%dir %{_datadir}/agama/products.d
%{_datadir}/agama/products.d/sles_161.yaml
%{_datadir}/agama/products.d/sles_sap_161.yaml
%changelog