File amazon-q-developer-cli.spec of Package amazon-q-developer-cli

#
# spec file for package amazon-q-developer-cli
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#

%if 0%{?suse_version} && 0%{?suse_version} < 1550
%global force_gcc_version 13
%global force_libstdcxx_version 6
%endif

%if 0%{?suse_version} > 1600
%bcond_without mold
%else
%bcond_with    mold
%endif

%if %{with mold}
%global build_rustflags "-C" "linker=clang" "-C" "link-arg='-fuse-ld=/usr/bin/mold -Wl,-z,relro,-z,now'" "-C" "debuginfo=2" "-C" "incremental=false" "-C" "strip=none"
%endif

Name:           amazon-q-developer-cli
Version:        v1.14.0~git0.a2da6f6e
Release:        0
Summary:	CLI for Amazon Q Developer
License:        Apache-2.0 AND MIT
URL:            https://docs.aws.amazon.com/amazonq/
Source:         %{name}-%{version}.tar.gz
Source1:	vendor.tar.zst
BuildRequires:  rust
BuildRequires:  cargo
BuildRequires:  cargo-packaging
%if 0%{?suse_version} > 1600
BuildRequires:  c++_compiler
BuildRequires:  c_compiler
BuildRequires:  clang
BuildRequires:  mold
%else
BuildRequires:  gcc%{?force_gcc_version}
BuildRequires:  gcc%{?force_gcc_version}-c++
%if 0%{?force_gcc_version}
BuildRequires:  libstdc++6-devel-gcc%{?force_gcc_version}
%else
BuildRequires:  libstdc++-devel
%endif
%endif

%description
✨ Agentic chat experience in your terminal. Build applications using natural language.


%prep
%autosetup -a1 -n %{name}-%{version}

%build
export LDFLAGS="--no-keep-memory"
export CARGO_AUDITABLE="auditable"
export CARGO_INCREMENTAL=0
export CARGO_FEATURE_VENDORED=1
export RUSTFLAGS="%build_rustflags"
export CARGO_NET_OFFLINE=true
%ifarch %rust_tier1_arches
export CARGO_PROFILE_RELEASE_DEBUG=full
%else
export CARGO_PROFILE_RELEASE_DEBUG=limited
%endif
export CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO=off
export CARGO_PROFILE_RELEASE_STRIP=false
%if 0%{?force_gcc_version}
export CC="gcc-%{?force_gcc_version}"
export CXX="g++-%{?force_gcc_version}"
%endif
%{cargo_build}

%install
%__install -m 0755 -D target/release/chat_cli %{buildroot}/%{_bindir}/q

%files
%license LICENSE.*
%doc *.md
%{_bindir}/q

%changelog

openSUSE Build Service is sponsored by